Skip to content

#51611 - Extended Blazor server and webassembly options to match web format. #54649

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

Closed
wants to merge 9 commits into from
3 changes: 2 additions & 1 deletion src/Components/Web.JS/src/Boot.Server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ function boot(userOptions?: Partial<CircuitStartOptions>): Promise<void> {
}
started = true;

const configuredOptions = resolveOptions(userOptions);
const normalizedOptions = userOptions?.circuit ?? userOptions;
const configuredOptions = resolveOptions(normalizedOptions);
setCircuitOptions(Promise.resolve(configuredOptions || {}));

JSEventRegistry.create(Blazor);
Expand Down
3 changes: 2 additions & 1 deletion src/Components/Web.JS/src/Boot.WebAssembly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ async function boot(options?: Partial<WebAssemblyStartOptions>): Promise<void> {
}
started = true;

setWebAssemblyOptions(Promise.resolve(options || {}));
const normalizedOptions = options?.webAssembly ?? options;
setWebAssemblyOptions(Promise.resolve(normalizedOptions || {}));

JSEventRegistry.create(Blazor);
const webAssemblyComponents = discoverComponents(document, 'webassembly') as WebAssemblyComponentDescriptor[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export interface CircuitStartOptions {
reconnectionHandler?: ReconnectionHandler;
initializers : ServerInitializers;
circuitHandlers: CircuitHandler[];
// Exists for compatibility with WebStartOptions.
circuit?: CircuitStartOptions;
}

export function resolveOptions(userOptions?: Partial<CircuitStartOptions>): CircuitStartOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ export interface WebAssemblyStartOptions {
* Allows to override .NET runtime configuration.
*/
configureRuntime(builder: DotnetHostBuilder): void;

/**
* Exists for compatibility with WebStartOptions.
*/
webAssembly?: WebAssemblyStartOptions;
}

// This type doesn't have to align with anything in BootConfig.
Expand Down
Loading