Can Blazor create wasm modules without any UI references or code?

人盡茶涼 提交于 2020-01-06 02:48:06

问题


Looking at the Blazor documentation I get the impression that it is meant to be used to develop client side browser applications.

A subset of this should be creating WASM output in the same way Rust does, but I cannot see any documentation that explains how can I create standalone WASM output which then can be called from JavaScript or if I can do it at all.

So is it possible to use Blazor or Belero (its F# cousin, based on Blazor) to create wasm libraries and not full applications?


回答1:


A subset of this should be creating WASM output in the same way Rust does

No.

Blazor runs on Mono. Mono itself is compiled to Wasm, but both Blazor and your software run as IL modules inside Mono. In the current implementation they are interpreted, not compiled to Wasm.

So is it possible to use Blazor [or ...] to create wasm libraries and not full applications?

No.




回答2:


You can create ASP.NET Core Razor components class libraries. Those libraries can contains code only such as services, and js interop scripts.

I wrote this library for exemple to use some AWS services in a Blazor app : Aguacongas.AwsServices



来源:https://stackoverflow.com/questions/59090045/can-blazor-create-wasm-modules-without-any-ui-references-or-code

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!