-
Notifications
You must be signed in to change notification settings - Fork 733
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
C3: Bump node engines version in package.json #4063
Conversation
🦋 Changeset detectedLatest commit: febc2e4 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/6386228185/npm-package-wrangler-4063 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/6386228185/npm-package-wrangler-4063 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6386228185/npm-package-wrangler-4063 dev path/to/script.js Additional artifacts:npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6386228185/npm-package-cloudflare-pages-shared-4063 Note that these links will no longer work once the GitHub Actions artifact expires.
| Please ensure constraints are pinned, and |
@@ -0,0 +1,10 @@ | |||
--- | |||
"create-cloudflare": minor |
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.
Should this be minor? Changing a minimum node version is usually considered major
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.
Technically, yes, it should be major. However, we've talked about this a good deal internally and we decided to make it a minor bump for a couple of reasons.
Changing a minimum node version is usually considered major, but most of the time this is done for a different reason. Usually it means that the module in question is using features that are only available in newer version of node, and running them on older versions won't work anymore.
That's not really the case here. What's happening is that our upstream dependencies are themselves dropping support for node and changing their engines spec, all at different cadences. So the answer to Does c3 work with node v16
is: Sometimes, it depends on the framework you're using.
In our case we'd like to change our engines spec because we started testing exclusively on v18, and it feels a little dis-ingenuous to claim we support v16 support since we know it will break in some cases, and we don't be detecting new failures as they arise with different create-*
tools.
If we were to strictly follow semver, it seems like we'd need to bump a major version each time we bump to a new major version of a framework, since technically it's a breaking change if that's the framework you use. This leaves us with 2 options: do major bumps as frequently as we bump our dependencies, or keep stale dependencies around longer so we can batch them up into major bumps of c3. Neither seem like great options.
There's also the unfortunate reality that frameworks don't often align the major versions of their framework in respective scaffolding tools. Sometimes a new minor version of create-*
will use a new major version of framework-*
.
Major bumps are a little challenging for us logistically. We've got calls to create cloudflare@2
throughout wrangler
itself, and in tons of documentation that would be tough to update in a coordinated manner.
Another issue is that C3 now automatically run the latest version if it detects one is available, but only if it's a minor version difference. We do this since most people use npx
or it's counterpart in other package managers, which cache versions of these pretty aggressively.
This means that as we release major versions of c3, many users would get stuck on older versions, which we don't really want at the moment since many frameworks are churning to drop node v16 support.
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.
I agree with these justifications for keeping this a minor bump, not major.
Just want to call out that wrangler's calls to create cloudflare@2
are to protect old installations of wrangler. When C3 needs a major bump, wrangler will update those calls to the latest major for future releases
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.
Appreciate the explanation - no complaints there 🙂
9ec35ee
to
febc2e4
Compare
Codecov Report
@@ Coverage Diff @@
## main #4063 +/- ##
==========================================
+ Coverage 75.07% 75.09% +0.02%
==========================================
Files 216 216
Lines 12056 12056
Branches 3124 3124
==========================================
+ Hits 9051 9054 +3
+ Misses 3005 3002 -3 |
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.
Approving based on the fact that we've discussed this internally and agreed on avoiding a major bump for this change
Fixes #3932.
What this PR solves / how to test:
We've recently switched out testing infrastructure to test C3 on node version 18.14.1. As of earlier this month, Node v16 is no longer supported, and many of the underlying framework scaffolding tools that C3 uses (ex.
create-astro
,gatsby
) have dropped support for node v16, which in turn causes C3 to fail for those frameworks.Associated docs issue(s)/PR(s):
Author has included the following, where applicable:
Reviewer is to perform the following, as applicable:
Note for PR author:
We want to celebrate and highlight awesome PR review! If you think this PR received a particularly high-caliber review, please assign it the label
highlight pr review
so future reviewers can take inspiration and learn from it.