js2 icon indicating copy to clipboard operation
js2 copied to clipboard

Non-trivial NPM test: fails-components/webtransport

Open guest271314 opened this issue 4 months ago • 27 comments

Is your feature request related to a problem? Please describe. fail-components/webtransport uses a .node file for google/quiche dependency, and uses networking to implement WebTransport server and client. Describe the solution you'd like

  • google/quiche compiled to WASM

  • Straight up networking in WASM using WASI P*; or a WASM state machine to handle input/output to the WebTransport WASM implementation. Here's is such a WebTransport state machine compiled to WASM - without using WASI

  • https://github.com/guest271314/quic-zig-wasm/tree/wasm-experiment Describe alternatives you've considered

  • https://github.com/fails-components/webtransport/issues/354 Additional context Add any other context or screenshots about the feature request here. This is a non-trivial example to test the goals of this repository re NPM packages.

guest271314 avatar Jul 10 '26 13:07 guest271314

Motivation:

On Tue, Mar 11, 2025 at 12:35 AM Reilly Grant [email protected] wrote:

That issue is obsolete. There is nothing stopping you from implementing a WebTransport server other than building an implementation using JavaScript or WebAssembly. Reilly Grant | Software Engineer | [email protected] | Google Chrome

On Mon, Mar 10, 2025 at 5:22 PM guest271314 [email protected] wrote:

The goal with HTTPS/TLS being able to create a WebTransport server with TCPSeverSocket, for full-duplex streaming using WHATWG Streams.

On Mon, Mar 10, 2025 at 11:53 PM Reilly Grant [email protected] wrote:

There's nothing stopping you from implementing your own TLS client/server library on top of the Direct Sockets API. The API proposed here makes that easier by allowing you to validate certificates using the browser's certificate store instead of providing your own. Reilly Grant | Software Engineer | [email protected] | Google Chrome

My implementations

  • https://github.com/guest271314/webtransport/tree/wasm
  • https://github.com/guest271314/webtransport/tree/js
  • https://github.com/guest271314/webtransport/tree/runtime-agnostic

guest271314 avatar Jul 10 '26 14:07 guest271314

Thanks for this, and for linking the branches — I went through them to see where the compiler fits.

The genuinely portable compute here — the QUIC/TLS state machine — is already WebAssembly in your runtime-agnostic branch (quic.wasm), which is the right call. What's left in webtransport-example.js is host-integration glue: it instantiates that module, pokes bytes into its memory, and wires it to UDP sockets (node:dgram / Direct Sockets), WHATWG Streams, WebTransport, and crypto.subtle. Every meaningful line is a call out to a host API.

That's the mismatch: js2wasm compiles JavaScript/TypeScript logic to WebAssembly. Running that driver through it wouldn't remove any of those dependencies — a socket or a ReadableStream can't be compiled away, only imported — so you'd get a wasm module that still needs all the same host functions supplied to it, plus a shim to provide them. More glue, not less.

And feeding the js-branch quic.js (the wasm2js transliteration — it's a JS emulation of a wasm VM: one ArrayBuffer as memory, HEAP32/|0/Math.imul throughout) back through the compiler is a round-trip: it reconstructs wasm from a JS emulation of the quic.wasm you already have, giving a larger, slower copy rather than a win. The native dependency is already gone the moment quiche became quic.wasm.

If the actual goal is a single self-contained module rather than a driver plus a separate quic.wasm, that's a module-composition problem, not a recompilation one — you'd link the modules with Binaryen wasm-merge or the Component Model, keeping quic.wasm at native quality. (The host I/O — sockets, Streams — still has to be imported by the merged module either way; that part is a runtime concern, not something a compiler synthesizes.)

Where the project is right now, we're deliberately focused on simpler packages without native dependencies, so we can push on the core JS-to-Wasm compilation itself. A package whose core is a native addon sits outside that focus, and the remaining work for your use case is runtime integration around the existing quic.wasm rather than anything this compiler produces. So I don't think there's a fit here today — but appreciate the detailed writeup.

ttraenkler avatar Jul 13 '26 00:07 ttraenkler

And feeding the js-branch quic.js (the wasm2js transliteration

Technically wasm2lang got it right, handling BigInt; wasm2js did not get it right, converting the expected BigInt to something else. wasm2js doesn't support BigInt output.

The native dependency is already gone the moment quiche became quic.wasm.

The source of the QUIC/WebTransport implementation for fails-components/webtransport is not Zig https://github.com/endel/quic-zig/tree/wasm-experiment, it's Google quiche's C++, which AFAICT has not been compiled to WASM https://github.com/google/quiche/issues/86.

Yeah, endel and I made the linked version(s) so, but that's not the point. The point is a challenge for this repository to at least reproduce what was done with a non-NPM project in a roughly similar NPM package. To test and vet the goals of this repository. Else, we can just arbitrarily exclude any NPM package that is challenging, or that you decide already has a WASM type implementation as N/A, without ever having to vet the goals re those packages; thus an asterisk for this repository's goals.

guest271314 avatar Jul 13 '26 01:07 guest271314

WASI has HTTP and Sockets, etc. So, in theory all of the networking farmed out in fail-components/webtransport can happen in WASI P N world.

There's a few different ways to approach the challenge. Another state machine, something similar to what the linked Zig repository does; outright networking in WASM, e.g., https://github.com/birneee/quiche-wasm, which I guess is closest to WebTransport compiled to WASM - which is kinda moving target depending on what draft is being implemented.

I.e., it's a non-trivial issue. But I get it if you decide to not take on the challenge, and close the issue; no worries. Just means that there are some NPM packages (*) that are deliberately not gonna be included in the NPM "compatibility" (*) chart.

guest271314 avatar Jul 13 '26 01:07 guest271314

WASI has HTTP and Sockets, etc. So, in theory all of the networking farmed out in fail-components/webtransport can happen in WASI P N world.

There's a few different ways to approach the challenge. Another state machine, something similar to what the linked Zig repository does; outright networking in WASM, e.g., https://github.com/birneee/quiche-wasm, which I guess is closest to WebTransport compiled to WASM - which is kinda moving target depending on what draft is being implemented.

I.e., it's a non-trivial issue. But I get it if you decide to not take on the challenge, and close the issue; no worries. Just means that there are some NPM packages () that are deliberately not gonna be included in the NPM "compatibility" () chart.

This advanced example is not a good fit for the early phase of the project where ECMAScript compatibility is the primary focus.

ttraenkler avatar Jul 14 '26 02:07 ttraenkler

So close for now?

guest271314 avatar Jul 14 '26 02:07 guest271314

So close for now?

Fine for me. Once compatibility with ECMAScript and simple NPM packages is further along might make sense to revisit, but for now I don't see this actionable.

ttraenkler avatar Jul 14 '26 02:07 ttraenkler

Once compatibility with ECMAScript and simple NPM packages

See, that wording. "simple"? That's arbitrary. This issue was/is about the "NPM compatibility" claim baked into this repository somewhere. Not ECMAScript.

I'm just trying to speak on when claims are vague or capable of misconception as to actual technical intent.

guest271314 avatar Jul 14 '26 02:07 guest271314

Once compatibility with ECMAScript and simple NPM packages

See, that wording. "simple"? That's arbitrary. This issue was/is about the "NPM compatibility" claim baked into this repository somewhere. Not ECMAScript.

I'm just trying to speak on when claims are vague or capable of misconception as to actual technical intent.

I reviewed the claims in the readme and on the landing page. While I didn’t find a claim the project already supports any NPM packages in this early phase, I have made the wording in the goals section of the landing page even more explicit being NPM compatible is a goal not a claim about the status quo since you keep confusing the two.

Closing this issue also does not equal to dropping this goal. I closed this issue following your suggestion as it is not only a bit early to work on advanced cases like this but also it is not formulated in a way that I can focus on the general aspects of NPM compatibility but have to dig into the specifics of your use case which I don’t have time to if I don’t want to abandon more fundamental work.

I will definitely look into NPM compatibility in a more general issue and if that’s implemented we can revisit this issue as a bug report if something should work but doesn’t, but currently it „tests“ against something that is still in development and not ready to be tested, so I would rather rephrase this issue into a minimal test case instead of your specific use case.

ttraenkler avatar Jul 14 '26 03:07 ttraenkler

It's not my specific use case.

It's a challenge to this repository handle .node files in an NPM package, and handle networking in an NPM package.

I persoanlly don't think that NPM goal is attaintable. Whether you say it's a goal or not it's a claim when phrased as a goal. That somehow you are gonna reach that state, or try to.

Well, here's one for you to try to reach, that I know is non-trivial. That's what this issue is about. Not my use cases, as I have already achieved that goal if you will, based on the claim made by a Google software engineer that it was possible to implement a WebTransport server in the browser.

guest271314 avatar Jul 14 '26 12:07 guest271314

It's a challenge to this repository handle .node files in an NPM package, and handle networking in an NPM package. I persoanlly don't think that NPM goal is attaintable. Whether you say it's a goal or not it's a claim when phrased as a goal. That somehow you are gonna reach that state, or try to.

If I understand correctly the confusion is what NPM compatibility means and your intent with this issue is to probe if and how js2wasm will eventually compile arbitrary NPM packages into .wasm modules including Node.js C++ addons.

Let me clarify the terms first: An NPM package a bit simplified imho is an artifact to ship arbitrary JavaScript code that for the build step requires a Node.js compatible installation to be present, but not necessarily at runtime. For example React would not require Node at runtime in the browser.

The plan is that js2wasm will represent any host specific code as module imports - which includes Node.js C++ addons. In your test case this would mean if your NPM package contains .js code importing a Node C++ addon, the .wasm module will represent the C++ addon as an import that has to be satisfied by the consumer. The consumer can either run the .wasm module inside a Node.js host and provide the original C++ addon or run the .wasm module inside a WASI host, but it would then be the consumers responsibility to provide WASI compatible imports. Compiling the native C++ addon to .wasm or provide WASI shims is outside of the scope of js2wasm and the consumer would need to use third party solutions like Edge.js or toolchains like Emscripten to replace the Node.js dependency.

In scope and valuable for js2wasm would be to test whether the compiled .wasm can run in a real Node.js host with the original C++ addon. Also in scope would be if you provide a .wasm version of the native dependency to see whether it can be provided as an import to the js2wasm produced .wasm module.

ttraenkler avatar Jul 14 '26 15:07 ttraenkler

If I understand correctly the confusion is what NPM compatibility means and your intent with this issue is to probe if and how js2wasm will eventually compile arbitrary NPM packages into .wasm modules including Node.js C++ addons.

Yes. That's a helluva "goal". Nobody has done it, yet.

Let me clarify the terms first: An NPM package a bit simplified imho is an artifact to ship arbitrary JavaScript code that for the build step requires a Node.js compatible installation to be present, but not necessarily at runtime.

Yes. I'm pedantic, at a bare minimum. If you say "arbitrary" that's what I expect; not asterisks and exceptions, exclusions, and fine print, after the "goal" is so far reaching that nobody has done it.

Compiling the native C++ addon to .wasm or provide WASI shims is outside of the scope of js2wasm

It can't be outside the scope of js2wasm if your broad goal is "NPM compatibility" and "arbitrary" code execution in WASM that node would execute. You've made the scope so broad as to literally cover any NPM package. I picked one that happens to use .node file; there are many others that do, too.

and the consumer would need to use third party solutions like Edge.js or toolchains like Emscripten to replace the Node.js dependency.

I really have no idea why you mention Edge.js. Edge.js doesn't do anything special from what I can tell. Formerly WinterJS, now just pretends to be node, userAgent and all. I don't get it.

guest271314 avatar Jul 15 '26 00:07 guest271314

The whole package can be run in WASM. The google/quiche part compiled to WASM and the Node.js networking parts executed in WASM. That's the whole point of WASI, P N. That's the challenge.

guest271314 avatar Jul 15 '26 00:07 guest271314

I couldn't build edge last time I tried. Issue was closed before anything was verified fixed https://github.com/wasmerio/edgejs/issues/70. I'm highly skeptical. I'll try to build from source, again.

guest271314 avatar Jul 15 '26 00:07 guest271314

I agree I should clarify in the docs what I mean by being NPM compatible.

Yes. I'm pedantic, at a bare minimum. If you say "arbitrary" that's what I expect; not asterisks and exceptions, exclusions, and fine print, after the "goal" is so far reaching that nobody has done it.

You're overgeneralizing here as native code is not "arbitrary Javascript" – and this is important to slice correctly to make it work. Anything not .js or .ts must be outside of the js2wasm module and turn into an import. If this mechanism works correctly it will allow for plugging the real Node.js and C++ addon directly to be trivially compatible or alternatively a compatible WASI port. In this way js2wasm is pluggable and can stay agnostic of Node, Deno, Bun or the Web host and focus on ECMAScript while staying NPM compatible in the sense that the produced modules can replace the .js or .ts files in any NPM package. I understand that you are interested in the harder scenario replacing also the host and native dependencies, but a claim that js2wasm would provide WASI ports of all host APIs and native modules is doomed to fail as all bets are off regarding native toolchains and there is no one size fits all.

Compiling the native C++ addon to .wasm or provide WASI shims is outside of the scope of js2wasm

It can't be outside the scope of js2wasm if your broad goal is "NPM compatibility" and "arbitrary" code execution in WASM that node would execute. You've made the scope so broad as to literally cover any NPM package. I picked one that happens to use .node file; there are many others that do, too.

js2wasm – as the name suggests – compiles JavaScript/TypeScript to WebAssembly, not arbitrary native code. Achievable NPM compatibility would mean that you can compile the JavaScript/TypeScript files of any NPM package to WebAssembly and dependencies on host APIs or native modules require them to be present or a port provided by the consumer.

I really have no idea why you mention Edge.js. Edge.js doesn't do anything special from what I can tell. Formerly WinterJS, now just pretends to be node, userAgent and all. I don't get it.

As far as I understood Edge.js emulates the Node APIs with WASIX.

ttraenkler avatar Jul 15 '26 02:07 ttraenkler

You might want to check out these:

  • NAPI to Wasm: https://github.com/toyobayashi/emnapi
  • V8 APIs for other JS Engines (WIP): https://github.com/littledivy/v8x

ttraenkler avatar Jul 15 '26 02:07 ttraenkler

I agree I should clarify in the docs what I mean by being NPM compatible.

Concur. Specifity.

You're overgeneralizing here as native code is not "arbitrary Javascript" – and this is important to slice correctly to make it work.

I kinda looked at Node.js and NPM "compatibility" as overgneralizations.

Achievable NPM compatibility would mean that you can compile the JavaScript/TypeScript files of any NPM package to WebAssembly and dependencies on host APIs or native modules require them to be present or a port provided by the consumer.

Ah, well, that's not "NPM compatibility", in my opinion. You can't have asterisks next to "compatibility". Make it all so, or just say JavaScript/TypeScript and leave package managers out of it. You don't know what you're getting in any package in a registry.

As far as I understood Edge.js emulates the Node APIs with WASIX.

Alright, I did git pull in edgjs repository. Tried to build from source. Machine froze. Re-boot, start over. Repeat. Machine froze around 72%. I checked the build-edge folder and edge is there. The build didn't complete successfully.

Standard Native Messaging test, using nm_nodejs.js

~/bin/nm_standalone_test_node.js ~/bin/nm_edge.sh
Testing /home/user/bin/nm_edge.sh Native Messaging host

[ <209715 empty items> ]
{ write: false }
read
file:///home/user/bin/nm_standalone_test_node.js:36
      header.set(headerBuffer, 0);
             ^

TypeError: Cannot convert undefined or null to object
    at Uint8Array.set (<anonymous>)
    at Socket.read (file:///home/user/bin/nm_standalone_test_node.js:36:14)
    at Socket.emit (node:events:514:20)
    at emitReadable_ (node:internal/streams/readable:850:12)
    at onEofChunk (node:internal/streams/readable:828:5)
    at readableAddChunkPushByteMode (node:internal/streams/readable:473:5)
    at Readable.push (node:internal/streams/readable:399:5)
    at Pipe.onStreamRead (node:internal/stream_base_commons:231:12)

Node.js v27.0.0-nightly20260714ed63b195cd

Sure enough wasmer is running something. What, I don't know.

wasmer run --experimental-napi wasmer/edgejs@=0.0.0-0ff2433 --volume=. --net -- /home/user/localscripts/native-messaging-nodejs/nm_nodejs.mjs /home/user/bin/nm_edge.sh

Let's try the deno version of the test, with the .js extension

~/bin/nm_standalone_test.js ~/bin/nm_edge.sh
{ path: "/home/user/bin/nm_edge.sh", allowed_origin: undefined }
Testing /home/user/bin/nm_edge.sh Native Messaging host

node:internal/modules/cjs/loader:1451
  throw err;
  ^


Error: Cannot find module '/home/user/localscripts/native-messaging-nodejs/nm_nodejs.js'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1448:15)
    at defaultResolveImpl (node:internal/modules/cjs/loader:1059:19)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1064:22)
    at Module._load (node:internal/modules/cjs/loader:1234:25)
    at TracingChannel.traceSync (node:diagnostics_channel:328:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:245:24)
    at Module.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:154:5)
    at node:internal/main/run_main_module:33:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v24.13.2
BrokenPipe: Broken pipe (os error 32)
    at async Object.write (ext:deno_web/06_streams.js:1:23643)
Trace
    at file:///home/user/bin/nm_standalone_test.js:146:11
error: Uncaught (in promise) TypeError: Child process has already terminated
  subprocess.kill("SIGTERM");
             ^
    at ChildProcess.kill (ext:deno_process/40_process.js:1:9499)
    at file:///home/user/bin/nm_standalone_test.js:148:14

I re-saved teh same file with .mjs extension. edge --safe still exits.

Again wasmer runs per Task Manager

wasmer run --experimental-napi wasmer/edgejs@=0.0.0-0ff2433 --volume=. --net -- /home/user/localscripts/native-messaging-nodejs/nm_nodejs.mjs /home/user/bin/nm_edge.sh undefined

Again, exits

~/bin/nm_standalone_test.js ~/bin/nm_edge.sh
{ path: "/home/user/bin/nm_edge.sh", allowed_origin: undefined }
Testing /home/user/bin/nm_edge.sh Native Messaging host

node:internal/modules/cjs/loader:1451
  throw err;
  ^


Error: Cannot find module '/home/user/localscripts/native-messaging-nodejs/nm_nodejs.mjs'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1448:15)
    at defaultResolveImpl (node:internal/modules/cjs/loader:1059:19)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1064:22)
    at Module._load (node:internal/modules/cjs/loader:1234:25)
    at TracingChannel.traceSync (node:diagnostics_channel:328:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:245:24)
    at Module.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:154:5)
    at node:internal/main/run_main_module:33:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v24.13.2
BrokenPipe: Broken pipe (os error 32)
    at async Object.write (ext:deno_web/06_streams.js:1:23643)
Trace
    at file:///home/user/bin/nm_standalone_test.js:146:11
error: Uncaught (in promise) TypeError: Child process has already terminated
  subprocess.kill("SIGTERM");
             ^
    at ChildProcess.kill (ext:deno_process/40_process.js:1:9499)
    at file:///home/user/bin/nm_standalone_test.js:148:14

CommonJS loader?

There's no --help entry. Is edge expecting a package.json file with {"type":"module"}? Dunno. Node.js node has syntax detection to use ECMAScript or CommonJS or TypeScript loaders, respectively; at a cost. Not sure what edge is doing here.

Something was downloaded by wasmer on first run with edge. But I'm already using edge. In /home/user/.wasmer/cache/queries/https___wasmer.io_graphql/wasmer#edgejs

{
  "unix_timestamp": 1784091088,
  "package_name": "wasmer/edgejs",
  "response": {
    "data": {
      "getPackage": {
        "packageName": "edgejs",
        "namespace": "wasmer",
        "versions": [
          {
            "version": "0.0.2",
            "isArchived": false,
            "v2": {
              "piritaDownloadUrl": null,
              "piritaSha256Hash": null,
              "webcManifest": null
            },
            "v3": {
              "piritaDownloadUrl": "https://cdn.wasmer.io/webcimages/5b84e8eeec1452143e17ce22b56d10f17fdf0e7ecafcdb81096035134f9316ea.webc",
              "piritaSha256Hash": "5b84e8eeec1452143e17ce22b56d10f17fdf0e7ecafcdb81096035134f9316ea",
              "webcManifest": "{\"atoms\":{\"edgejs\":{\"kind\":\"https://webc.org/kind/wasm\",\"signature\":\"sha256:VyhqLWA+SCwgzgSWW76mHXYLeIGR4IbkfnpbYRQUQbM=\"}},\"commands\":{\"edgejs\":{\"annotations\":{\"atom\":{\"name\":\"edgejs\"},\"wasi\":{\"atom\":\"edgejs\"}},\"runner\":\"https://webc.org/runner/wasi\"}},\"entrypoint\":\"edgejs\",\"package\":{\"fs\":[{\"from\":null,\"mount_path\":\"/node-lib\",\"volume_name\":\"/lib\"}],\"wapm\":{}}}"
            }
          },
          {

At least a 25 MiB file and another 65 MiB file wind up in ~/.wasmer (cache).

edge executes the code without --safe. wasmer doesn't run then. So, what's the technical benefit then of not just running node, when there's no --safe with edge?

Nope, that ain't it.

You might want to check out these:

  • NAPI to Wasm: https://github.com/toyobayashi/emnapi
  • V8 APIs for other JS Engines (WIP): https://github.com/littledivy/v8x

Yeah, I tried some stuff with emnapi https://github.com/toyobayashi/emnapi/issues/178. This package https://github.com/vmeansdev/webtransport-bun/issues/12 is on NPM and uses napi-rs https://github.com/napi-rs/napi-rs; more Node.js native add on stuff to be found in arbtitrary packages on NPM.

Yeah, I filed an issue/feature request over in v8x https://github.com/littledivy/v8x/issues/64. Building with Deno core alone ain't enough. That's still too expensive. roll-your-own-javascript-runtime is still spitting out 40 MiB plus executables for basic core.ops stuff. Something like what you are doing here.

However, I would just implement the whole engine in WASM straightaway. I think you're moving in that direction. However, the Node.js/NPM/package "compatibility" thing is a whole different angle.

guest271314 avatar Jul 15 '26 05:07 guest271314

When I read libraries/runtimes/repositories/whatever writing they are "Node.js compatible", I take them at their word - and test.

Even setting aside that "Node compatibility" prima facie means all of Node.js API's and peculiarities, including CommonJS and Node API's in C/C++ of some sort, just the ordinary API implementations, AFAICT no software that is not node is really Node.js "compatible", once somebody who doesn't want the claimaint/goal to be true and correct or possible, starts beating the shallow and tall grass.

"Node.js compatible" like Deno with no node:wasi implementation?

"Node.js compatible" like Bun where I have do this for fs.watch() to behave in Bun world similar to how it behaves using node

import { readFile, stat, truncate, watch, writeFile } from "node:fs/promises";

const _stdin = "./stdin";
const _stdout = "./stdout";

async function writeStdout(data) {
  let watcher = watch(_stdin);
  // Bun doesn't call Symbol.asyncIterator, call manually
  if (!watcher?.next) {
    watcher = watcher[Symbol.asyncIterator]();
  } 

No Node.js Add On stuff going on there... Still not really "compatible".

guest271314 avatar Jul 15 '26 06:07 guest271314

„The goal is for the compiler to consume and AOT-compile JavaScript from npm packages, while lowering host API and native addon references to imports that are left to be satisfied by the host runtime. The resulting modules will still depend on a compatible host environment - which could be the Web, Node, or Deno - or an API compatible WASI port if provided by consumer.“

Does that sound right?

ttraenkler avatar Jul 15 '26 08:07 ttraenkler

When I read libraries/runtimes/repositories/whatever writing they are "Node.js compatible", I take them at their word - and test.

There was deliberately no "Node.js compatible" anywhere on the page - even if "NPM compatibility" as a goal (stands for NPM is not an acronym) I agree can be misleading as it is commonly understood as "Node Package Manager" and often implicitly has a Node dependency.

I think it is good to think of host specific dependencies as environment. You would also not expect Web APIs and their browser builtin C++ implementations to be compiled to Wasm but provided as imports by the host.

I see hosts like Node or Deno in the same way - the host is not to be compiled away but a natural dependency provided as imports to the module. That's a clean concept that allows modules compiled by js2wasm to be compatible to run within any host while not precluding the host is only emulated.

ttraenkler avatar Jul 15 '26 08:07 ttraenkler