dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.2k stars 9.95k forks source link

how to run Blazor in asm.js #15673

Closed moataz1991 closed 4 years ago

moataz1991 commented 6 years ago

Hello how to run Blazor App in asm.js , as the issue title says :)

whats the main difference between asm.js and webassembly ?

jbomhold3 commented 6 years ago

asm.js from what I understand is the fallback for browsers that does not support webassembly to allow blazor to still boot. From everything I watched and read this happens automatically for you when needed. Not sure if there is anyway to force it, but I wouldn't use something that's meant to be the fail safe myself. https://webassembly.org/docs/faq/ http://asmjs.org/faq.html

SteveSandersonMS commented 6 years ago

Blazor automatically switches to asm.js if the browser doesn't support WebAssembly.

whats the main difference between asm.js and webassembly ?

I'd recommend a web search to find info about this. Hope that's OK!

danroth27 commented 6 years ago

@moataz1991 Blazor will fallback to an asmjs based runtime automatically if it detects that WebAssembly isn't supported. However, for older browsers that don't support WebAssembly you will also run into issues with lack of support for other JS features that Blazor uses, like promises. You'll need polyfills to deal with these limitations that Blazor doesn't currently provide. There are some community projects to provide these polyfills though that you can try out: https://github.com/Daddoon/Blazor.Polyfill