-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[blazor] Use JSImport for loading satellite assemblies #46477
[blazor] Use JSImport for loading satellite assemblies #46477
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
src/Components/WebAssembly/WebAssembly/src/Hosting/WebAssemblyCultureProvider.cs
Show resolved
Hide resolved
src/Components/WebAssembly/WebAssembly/src/Hosting/WebAssemblyCultureProvider.cs
Outdated
Show resolved
Hide resolved
@@ -27,54 +24,6 @@ public void GetCultures_ReturnsCultureClosure(string cultureName, string[] expec | |||
Assert.Equal(expected, actual); | |||
} | |||
|
|||
[Fact] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that it's fine to remove these tests since they were tied to the old implementation of LoadCurrentCultureResourcesAsync()
.
Thankfully, it looks like this was one of the only cases where we were mocking IJSUnmarshalledRuntime
for test purposes, so I think it should be unlikely that switching to the new JSImport
/JSExport
interop model will force us to remove a bunch of similar tests in the future.
The one exception to this is WebAssemblyHostBuilder
, which relies heavily on IJSUnmarshalledRuntime
. Tests currently use TestJSUnmarshalledRuntime
to mock JS interop functionality. I would imagine that in this case, we could create an IWebAssemblyHostInterop
interface to provide strongly-typed interop, and we could have a "test" interop class along with the "real" one whose implementation invokes the static [JSImport]
methods. The same pattern could be applied in other cases, if they arise.
This isn't really a PR suggestion, just some ideas about the future.
…CultureProvider.cs Co-authored-by: Mackinnon Buck <mackinnon.buck@gmail.com>
src/Components/WebAssembly/WebAssembly/src/Hosting/WebAssemblyCultureProvider.cs
Outdated
Show resolved
Hide resolved
src/Components/WebAssembly/WebAssembly/src/Hosting/WebAssemblyCultureProvider.cs
Show resolved
Hide resolved
…CultureProvider.cs Co-authored-by: Steve Sanderson <SteveSandersonMS@users.noreply.github.com>
# Conflicts: # src/Components/Web.JS/src/GlobalExports.ts # src/Components/Web.JS/src/Platform/Mono/MonoPlatform.ts
…spnetcore into blazor_satelite_assemblies
Motivation
getSatelliteAssemblies
is implemented using legacy/obsolete JS interop.Contributes to #37787
Description
[JSImport]
IJSUnmarshalledRuntime
as that is no longer a dependency.