Skip to content
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

Merged
merged 4 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/fair-seahorses-arrive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"create-cloudflare": minor
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor

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

Copy link
Contributor

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 🙂

---

Bump supported node version to 18.14.1

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.
2 changes: 1 addition & 1 deletion packages/create-cloudflare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,6 @@
"@types/semver": "^7.5.1"
},
"engines": {
"node": ">=16.13.0"
"node": ">=18.14.1"
}
}