-
Notifications
You must be signed in to change notification settings - Fork 789
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
Enable nodejs_compat by default for new projects created by C3 #8310
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: a479da7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
A wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13596487290/npm-package-wrangler-8310 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/8310/npm-package-wrangler-8310 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13596487290/npm-package-wrangler-8310 dev path/to/script.js Additional artifacts:cloudflare-workers-bindings-extension: wget https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13596487290/npm-package-cloudflare-workers-bindings-extension-8310 -O ./cloudflare-workers-bindings-extension.0.0.0-v60c7bd564.vsix && code --install-extension ./cloudflare-workers-bindings-extension.0.0.0-v60c7bd564.vsix create-cloudflare: npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13596487290/npm-package-create-cloudflare-8310 --no-auto-update @cloudflare/kv-asset-handler: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13596487290/npm-package-cloudflare-kv-asset-handler-8310 miniflare: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13596487290/npm-package-miniflare-8310 @cloudflare/pages-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13596487290/npm-package-cloudflare-pages-shared-8310 @cloudflare/unenv-preset: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13596487290/npm-package-cloudflare-unenv-preset-8310 @cloudflare/vite-plugin: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13596487290/npm-package-cloudflare-vite-plugin-8310 @cloudflare/vitest-pool-workers: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13596487290/npm-package-cloudflare-vitest-pool-workers-8310 @cloudflare/workers-editor-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13596487290/npm-package-cloudflare-workers-editor-shared-8310 @cloudflare/workers-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13596487290/npm-package-cloudflare-workers-shared-8310 @cloudflare/workflows-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13596487290/npm-package-cloudflare-workflows-shared-8310 Note that these links will no longer work once the GitHub Actions artifact expires.
Please ensure constraints are pinned, and |
I would lean towards all docs that require nodejs_compat to avoid errors should include it in the steps, even if nodejs_compat becomes a default, in case for some reason, someone has a cloudflare worker without nodejs compat enabled. So I would lean towards leaving https://developers.cloudflare.com/hyperdrive/get-started/#enable-nodejs-compatibility (maybe switch 'Enable' to 'Ensure') and I think we should still merge cloudflare/cloudflare-docs#19860 |
refs #7388
We've gone back and forth on this in the past — but in practice, have found that:
nodejs_compat
is enabled. Hit the ground running, and NPM packages you want to use are more likely to work.nodejs_compat
is not enabled by default for new projects, products like Hyperdrive, or tutorials that use any NPM packages, need to explain extra steps and caveats to developers. Steps that are easy to miss, or misunderstand.Getting the ecosystem using shared standards is important. That's why WinterTC exists, why all the awesome work that @jasnell and others do matters. How we get there is by working with WinterTC and the broader community — not by holding back
nodejs_compat
to developers getting started building Workers. The whole point is that developers and open-source maintainers shouldn't have to navigate a maze of differences — and enablingnodejs_compat
for new projects furthers that goal.We're going to keep making
nodejs_compat
better, more native to the Workers Runtime, and more comprehensive. And listen to what the vast majority of people want and expect when starting new projects. Disabling nodejs_compat is just one line of configuration to remove :)