Meziantou.Framework.WebPlatform.Wasm
1.0.6
Prefix Reserved
dotnet add package Meziantou.Framework.WebPlatform.Wasm --version 1.0.6
NuGet\Install-Package Meziantou.Framework.WebPlatform.Wasm -Version 1.0.6
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Meziantou.Framework.WebPlatform.Wasm" Version="1.0.6" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Meziantou.Framework.WebPlatform.Wasm" Version="1.0.6" />
<PackageReference Include="Meziantou.Framework.WebPlatform.Wasm" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Meziantou.Framework.WebPlatform.Wasm --version 1.0.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Meziantou.Framework.WebPlatform.Wasm, 1.0.6"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Meziantou.Framework.WebPlatform.Wasm@1.0.6
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Meziantou.Framework.WebPlatform.Wasm&version=1.0.6
#tool nuget:?package=Meziantou.Framework.WebPlatform.Wasm&version=1.0.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Meziantou.Framework.WebPlatform.Wasm
Runs the WebAssembly modules of the scripts of Meziantou.Framework.WebPlatform
with Meziantou.Framework.WasmEngine: a WebAssemblyRuntime for the
WebAssembly JavaScript API (WasmWebAssemblyRuntime).
using var runtime = new WasmWebAssemblyRuntime(); // can be shared by the browsing contexts
using var engine = new JavaScriptScriptEngine();
using var context = new BrowsingContext(new BrowsingContextOptions
{
ScriptEngine = engine,
WebAssemblyRuntime = runtime,
});
var document = await context.NavigateAsync("https://example.com/", _ => """
<output></output>
<script>
// (module (func (export "add") (param i32 i32) (result i32) local.get 0 local.get 1 i32.add))
const bytes = new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 7, 1, 96, 2, 127, 127, 1, 127, 3, 2, 1, 0,
7, 7, 1, 3, 97, 100, 100, 0, 0, 10, 9, 1, 7, 0, 32, 0, 32, 1, 106, 11]);
WebAssembly.instantiate(bytes).then(({ instance }) => {
document.querySelector('output').textContent = instance.exports.add(2, 3);
});
</script>
""");
await context.EventLoop.RunUntilIdleAsync();
Assert.Equal("5", document.QuerySelector("output")!.TextContent);
See scripting.md.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. net11.0 is compatible. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Meziantou.Framework.WasmEngine (>= 1.0.3)
- Meziantou.Framework.WebPlatform (>= 1.0.22)
-
net11.0
- Meziantou.Framework.WasmEngine (>= 1.0.3)
- Meziantou.Framework.WebPlatform (>= 1.0.22)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.