Skip to content

Use compiler.wasm via NodeJS Create cli.mjs and engine.mjs - #33

Open
JamesParrott wants to merge 1 commit into
dylan-sutton-chavez:mainfrom
JamesParrott:main
Open

Use compiler.wasm via NodeJS Create cli.mjs and engine.mjs#33
JamesParrott wants to merge 1 commit into
dylan-sutton-chavez:mainfrom
JamesParrott:main

Conversation

@JamesParrott

@JamesParrott JamesParrott commented Jul 29, 2026

Copy link
Copy Markdown

I fully understand if you don't want to support these from now until the end of time, or otherwise decide not to merge this (I don't go around making AI PRs, I have to deal with enough of those myself).

But personally, outside of the browser, especially from the command line, these scripts are how I'd prefer to use and test EdgePython's WASM module. Perhaps someone else will find them useful too.

From Claude: https://claude.ai/share/c7fb9bc5-8532-4cc9-8b42-24c71a0b57fc

Overall, despite the language breaks, I'm really impressed with the project by the way - great job!

@dylan-sutton-chavez
dylan-sutton-chavez self-requested a review July 30, 2026 08:30
@dylan-sutton-chavez dylan-sutton-chavez self-assigned this Jul 30, 2026
@dylan-sutton-chavez

Copy link
Copy Markdown
Owner

Hey @JamesParrott :) Thanks for this, impressive reverse engineering. I'm not merging node/ because the host std modules (dom, network, storage, time) are main-thread browser JS, which is exactly why the CLI drives Chromium today.

The official non-browser path will be a native Rust host on this same contract, and you exposed a real docs gap because the embedder ABI has no page. Land your example beside it?

docs/content/reference/
├── wasm-abi.md
├── embedding.md
└── community/
    └── node-host.md
  • wasm-abi.md is the existing plugin (PDK) ABI and stays untouched.
  • embedding.md is new and covers the env.* signatures, exports and status word. Help here would be very welcome.
  • community/node-host.md is your engine.mjs plus cli.mjs walkthrough (unofficial, Node).

One fix before it lands. Drop the sources map because quoted imports resolve only via register_code_module while host_fetch_bytes just serves packages.json manifests (see src/wasm/resolver.rs). Worth a line on why the std host libs don't work outside the browser.

@dylan-sutton-chavez dylan-sutton-chavez left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leave a comment in "Conversation" section.

@dylan-sutton-chavez dylan-sutton-chavez added documentation Improvements or additions to documentation good first issue Good for newcomers enhancement New feature or request and removed documentation Improvements or additions to documentation good first issue Good for newcomers enhancement New feature or request labels Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants