-
Notifications
You must be signed in to change notification settings - Fork 984
Use workerd node:process
v2 when available
#10577
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 0782e55 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
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 |
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
I believe that in most of the cases where unenv is providing an implementation of a function like For undocumented APIs, I notice For non-function bindings, like |
When you say "Simply copying over the throwing stub [...]" do you mean copying the implementation to workerd? If you rather mean copying the implementation to the unev preset in this repo then that would still be an hybrid polyfill and I don't really see the point?
I agree that the likeness those
Sorry, I'm not exactly sure where you'd want to create the issue and what the content should be. Feel free to start someone and I'll contribute if needed. |
4967ba8
to
c94f131
Compare
c94f131
to
0baeb4a
Compare
0baeb4a
to
8ff1a67
Compare
8ff1a67
to
0782e55
Compare
This PR enabled using workerd
node:process
v2 when it is enabled (by flag or date).It depends on the implemntation being available:
A few notes:
This PR still fails the remote tests as the v2 changes have not reached production yet.
Some of the v2 APIs are
undefined
.For that reason we still need an hybrid polyfill pulling their implementation from
unenv
. Otherwise the following code might break:Because we have to use an hybrid polyfill anyway, we keep all the APIs that are implemented in
unenv
and missing fromworkerd
:_...
APIs (_channel
,_debugEnd
, ...)addListener
,assert
, ...addListener
,assert
, ... are not all documented on nodejs.org and a few are deprecated. But they all are available for Node 22.16.0 (tested in the REPL).Maybe we can refine and better handle deprecated APIs now that we have a dedicated workerd flag. Comments welcome.
@petebacondarwin @guybedford could you please review the PR, the API surface is quite large and having more eyes would be helpful.