-
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] Have a way to configure dotnet runtime for blazor apps #49264
Comments
I prefer JS API |
@maraf do we have a list? |
We have the API, I don't want to duplicate that API as msbuild properties. |
It's not a complete list, but it includes. For some of them we already have MSBuild properties/items.
I think that for vanilla wasm app, it's okay to configure the runtime in JS, because you have to deal with the runtime JS anyway. In Blazor, users typically don't have deal with the platform startup. In general I would say that having an MSBuild way to define "everything" that is in the MonoConfig/MonoConfigInternal is benefitial. |
Fair point |
@maraf what would entail to expose whatever is needed to configure the underlying runtime. Would that be a callback users can register in |
@javiercn Yes, to modifying runtime options export interface WebAssemblyStartOptions {
loadBootResource(type: WebAssemblyBootResourceType, name: string, defaultUri: string, integrity: string): string | Promise<Response> | null | undefined;
environment?: string;
applicationCulture?: string;
+ configureRuntime(builder: DotnetHostBuilder): void;
} Second part to that is exposing running instance API, so that users can call export const Blazor: IBlazor = {
navigateTo,
registerCustomEventType,
rootComponents: RootComponentsFunctions,
+ runtime: RuntimeAPI,
_internal: {
navigationManager: navigationManagerInternalFunctions,
domWrapper: domFunctions,
Virtualize,
PageTitle,
InputFile,
NavigationLock,
getJSDataStreamChunk: getNextChunk,
attachWebRendererInterop,
},
}; @pavelsavara Blazor users can't use JSImport/JSExport currently, because there is not way to set imports or get exports, right? |
they could use JSImport with ES6 module. They could also obtain the runtime by Adding Note: |
No, I'll file a separate PR |
Current JavaScript runtime API allows to configure various parameters. We should have a way to allow Blazor users to leverage them.
Some of the features are currently configurable through MSBuild (and boot config).
Should we allow Blazor users to interact with JavaScript runtime API directly? aka make
dotnet
builder visible on Blazor JavaScript api?Should we have MSBuild (and boot config) alternative for every configuration that is possible in JavaScript api?
The text was updated successfully, but these errors were encountered: