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

Hybrid Hosted WebAssembly/Server-side hosting mode #252

Open
omcnoe opened this issue Feb 12, 2022 · 1 comment
Open

Hybrid Hosted WebAssembly/Server-side hosting mode #252

omcnoe opened this issue Feb 12, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@omcnoe
Copy link

omcnoe commented Feb 12, 2022

It's great that it's so easy to swap building an application between Hosted WebAssembly & Server-side, the feature works really well.

But it's a shame that it's an all or nothing choice for the entire application. I can think of some use cases where some hybrid of the two modes would be useful. For example, blocking some very expensive functionality from executing server-side in an otherwise server side app, for backend performance/hosting cost reasons. Or running some functionality server side in an otherwise hosted wasm app, if it's too much of a performance hit on clients.

Or even an automatic hybrid mode that runs simultaneously on client & server, and uses response from whichever is able to complete faster.

@Tarmil
Copy link
Member

Tarmil commented Apr 17, 2022

We could easily make it so that you can pass a config to rootComp to specify the hosting mode of an individual component. But unfortunately, Blazor itself is not amenable to this. The page must include blazor.server.js or blazor.webassembly.js, and they aren't compatible. They both define differently the same JavaScript globals. So we can't mix both modes on the same page.

We might be able to make it so that some pages have server-side components and other pages have wasm components, but even then I'm not sure that the compile-time tooling will follow.

@Tarmil Tarmil added the enhancement New feature or request label Apr 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants