Skip to content
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

[Breaking change]: Legacy Mono and Emscripten JavaScript APIs are not exported to global namespace in Blazor WebAssembly applications #516

Open
3 tasks
maraf opened this issue Nov 15, 2024 · 0 comments
Labels
Breaking change Documented The breaking change has been published to the .NET Core docs

Comments

@maraf
Copy link

maraf commented Nov 15, 2024

Description

In previous versions of Blazor WebAssembly, legacy Mono and Emscripten APIs were exported to global namespace.
From 9.0 those APIs are accessible throught Blazor.runtime object.

Version

.NET 9 GA

Previous behavior

Legacy Mono (MONO, BINDING) and Emscripten Module object was exported to global window object.
For example window.Module.FS returned emscripten virtual filesystem.

New behavior

Emscripten Module object is now exported to Blazor.runtime object.
For example Blazor.runtime.Module.FS returns emscripten virtual filesystem.
Legacy Mono API for interop was removed completely (MONO and BINDING) and replaced with JSImport/JSExport.

Type of breaking change

  • Binary incompatible: Existing binaries may encounter a breaking change in behavior, such as failure to load or execute, and if so, require recompilation.
  • Source incompatible: When recompiled using the new SDK or component or to target the new runtime, existing source code may require source changes to compile successfully.
  • Behavioral change: Existing binaries may behave differently at run time.

Reason for change

The general goal is not to polute global namespace and keep all the APIs accessible from single Blazor object.

Recommended action

Replace accessing Emscripten APIs from window object to Blazor.runtime object.

Affected APIs

window.MONO.*
window.BINDING.*
window.Module.*

@dotnet-policy-service dotnet-policy-service bot locked and limited conversation to collaborators Nov 15, 2024
@gewarren gewarren added the Documented The breaking change has been published to the .NET Core docs label Dec 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Breaking change Documented The breaking change has been published to the .NET Core docs
Projects
None yet
Development

No branches or pull requests

2 participants