-
Notifications
You must be signed in to change notification settings - Fork 1k
Use the native node:domain module when available
#11353
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
🦋 Changeset detectedLatest commit: 4770579 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: |
petebacondarwin
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.
- Unenv code: https://github.com/unjs/unenv/blob/main/src/runtime/node/internal/domain/domain.ts
- workerd code: https://github.com/cloudflare/workerd/blob/main/src/node/domain.ts
- Node.js code: https://github.com/nodejs/node/blob/main/lib/domain.js
I checked how the workerd implementation compares to unenv... Most methods are equivalent noops. The bind, intercept and run methods used to throw in unenv but now just return the callback with no side-effects.
The one potential breaking change is that the members property in unenv is initialized to [] but is undefined in workerd. But this is what Node.js does itself so we are good there.
The native implementation is available since cloudflare/workerd#5031
It is a superset of the unenv implementation.
/cc @anonrig @jasnell