-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Use the native node:wasi module when available
#11025
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
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
🦋 Changeset detectedLatest commit: 8829564 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Failed to automatically backport this PR's changes to Wrangler v3. Please manually create a PR targeting the Depending on your changes, running Notes:
|
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
@cloudflare/workers-utils
wrangler
commit: |
c39b635 to
295ddc7
Compare
|
Here is the workerd implementation: https://github.com/cloudflare/workerd/blob/6daa2ba8e02a3ea25cc7afd60d70f70bd9a38c7e/src/node/wasi.ts#L22 |
|
Here is the Node.js implementation https://github.com/nodejs/node/blob/0b6ae6df14ac7b6dbec4ad5c0473b63072d98cff/lib/wasi.js#L37 |
3a78787 to
7316bdf
Compare
vicb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Pete!
|
❌ Cannot revive Devin session - the session is too old. Please start a new session instead. |
dcebd73 to
55423bc
Compare
|
force push is rebase + format |
55423bc to
8829564
Compare
|
rebased (with conflicts resolution) |
Adds support for using the native
node:wasimodule from workerd when available, following the pattern established in previous module conversion PRs.This is part of a series to convert 9 remaining Node.js modules from unenv polyfills to native workerd implementations.
Changes
getWasiOverrides()function to enable/disable the native wasi module based on compatibility flagsexperimentalflag andenable_nodejs_wasi_moduleflag to enabledisable_nodejs_wasi_moduleflagKey Differences: workerd vs unenv
The workerd implementation has complete constructor validation for all WASI options (version, args, env, preopens, stdin, stdout, stderr, returnOnExit), while unenv just throws immediately without validation. Both are non-functional stubs.
Review Focus
enable_nodejs_wasi_module/disable_nodejs_wasi_moduleLink to Devin run: https://app.devin.ai/sessions/f2a8f635e47b47e8baa9bc1b68af0635
Requested by: @petebacondarwin ([email protected])