-
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] Accept the blazor.web.js
startup options format in blazor.{server|webassembly}.js
#51611
Comments
Thanks for contacting us. We're moving this issue to the |
Thanks for contacting us. We're moving this issue to the |
@MackinnonBuck can you please follow the https://aka.ms/aspnet/processes/help-wanted process to turn this into a |
Help WantedIssue SummarySee #51611 (comment) Potential DesignWe can add one additional property to export interface CircuitStartOptions {
// <existing members>
// Exists for compatibility with WebStartOptions.
circuit?: CircuitStartOptions;
}
export interface WebAssemblyStartOptions {
// <existing members>
// Exists for compatibility with WebStartOptions.
webAssembly?: WebAssemblyStartOptions;
} Then we'll update async function boot(options?: Partial<WebAssemblyStartOptions>): Promise<void> {
// ...
const normalizedOptions = options?.webAssembly ?? options ?? {};
setWebAssemblyOptions(Promise.resolve(normalizedOptions));
} This approach always prioritizes the "nested" options over top-level options. I don't anticipate there being any cases where nested and top-level options are specified on the same object, so the simplicity of this approach seems preferable over introducing more complicated option merging semantics. Code References
Additional Notes
|
Looks like this issue has been identified as a candidate for community contribution. If you're considering sending a PR for this issue, look for the |
Hello, I'm starting to get my feet wet in open source development, mind if I try my hand at this issue? |
Hi there, |
Hello, I created a PR that I believe will resolve this issue, can somebody please take a look if it is valid? |
Problem
When a Blazor app uses
blazor.web.js
, the options object passed toBlazor.start()
has the following format:However, when using
blazor.server.js
orblazor.webassembly.js
, runtime-specific options are specified as top-level properties on the options object. So, for example, if you're usingblazor.webassembly.js
and you attempt to customize the loading of boot resources like this:...then it will just silently "not work". This could create a pit of failure for customers who see examples in docs using the
blazor.web.js
options format but are writing a Blazor WebAssembly standalone app, for example.Solution
We should update
blazor.webassembly.js
andblazor.server.js
to accept the options format used byblazor.web.js
.Summary Comment: #51611 (comment)
The text was updated successfully, but these errors were encountered: