diff --git a/src/Components/Web.JS/src/Boot.Server.ts b/src/Components/Web.JS/src/Boot.Server.ts index 824c12546963..3ab5f4ea1ef2 100644 --- a/src/Components/Web.JS/src/Boot.Server.ts +++ b/src/Components/Web.JS/src/Boot.Server.ts @@ -18,7 +18,8 @@ function boot(userOptions?: Partial): Promise { } started = true; - const configuredOptions = resolveOptions(userOptions); + const circuitOptions = userOptions?.circuit ?? userOptions ?? {}; + const configuredOptions = resolveOptions(circuitOptions); setCircuitOptions(Promise.resolve(configuredOptions || {})); JSEventRegistry.create(Blazor); diff --git a/src/Components/Web.JS/src/Boot.WebAssembly.ts b/src/Components/Web.JS/src/Boot.WebAssembly.ts index ca1523f60f1c..971b7368c556 100644 --- a/src/Components/Web.JS/src/Boot.WebAssembly.ts +++ b/src/Components/Web.JS/src/Boot.WebAssembly.ts @@ -20,7 +20,8 @@ async function boot(options?: Partial): Promise { } started = true; - setWebAssemblyOptions(Promise.resolve(options || {})); + const webAssemblyOptions = options?.webAssembly ?? options ?? {}; + setWebAssemblyOptions(Promise.resolve(webAssemblyOptions || {})); JSEventRegistry.create(Blazor); const webAssemblyComponents = discoverComponents(document, 'webassembly') as WebAssemblyComponentDescriptor[]; diff --git a/src/Components/Web.JS/src/Platform/Circuits/CircuitStartOptions.ts b/src/Components/Web.JS/src/Platform/Circuits/CircuitStartOptions.ts index ac94b7a2d781..651e232c828f 100644 --- a/src/Components/Web.JS/src/Platform/Circuits/CircuitStartOptions.ts +++ b/src/Components/Web.JS/src/Platform/Circuits/CircuitStartOptions.ts @@ -20,6 +20,7 @@ export interface CircuitStartOptions { reconnectionHandler?: ReconnectionHandler; initializers : ServerInitializers; circuitHandlers: CircuitHandler[]; + circuit?: CircuitStartOptions; } export function resolveOptions(userOptions?: Partial): CircuitStartOptions { diff --git a/src/Components/Web.JS/src/Platform/WebAssemblyStartOptions.ts b/src/Components/Web.JS/src/Platform/WebAssemblyStartOptions.ts index 6eec9e2b9a1e..d34e9a9139c6 100644 --- a/src/Components/Web.JS/src/Platform/WebAssemblyStartOptions.ts +++ b/src/Components/Web.JS/src/Platform/WebAssemblyStartOptions.ts @@ -34,6 +34,11 @@ export interface WebAssemblyStartOptions { * Allows to override .NET runtime configuration. */ configureRuntime(builder: DotnetHostBuilder): void; + + /** + * Allows to use the same structure as WebStartOptions + */ + webAssembly?: WebAssemblyStartOptions } // This type doesn't have to align with anything in BootConfig.