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

Conversation

jculvey
Copy link
Contributor

@jculvey jculvey commented Sep 28, 2023

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):

  • [insert associated docs issue(s)/PR(s)]

Author has included the following, where applicable:

Reviewer is to perform the following, as applicable:

  • Checked for inclusion of relevant tests
  • Checked for inclusion of a relevant changeset
  • Checked for creation of associated docs updates
  • Manually pulled down the changes and spot-tested

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.

@jculvey jculvey requested review from a team as code owners September 28, 2023 22:24
@changeset-bot
Copy link

changeset-bot bot commented Sep 28, 2023

🦋 Changeset detected

Latest commit: febc2e4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
create-cloudflare Minor

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

@github-actions
Copy link
Contributor

github-actions bot commented Sep 28, 2023

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 with this latest build directly:

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.


wrangler@3.10.1 includes the following runtime dependencies:

Package Constraint Resolved
miniflare 3.20230922.0 3.20230922.0
workerd 1.20230922.0 1.20230922.0
workerd --version 1.20230922.0 2023-09-22

|

Please ensure constraints are pinned, and miniflare/workerd minor versions match.

@@ -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 🙂

@codecov
Copy link

codecov bot commented Oct 2, 2023

Codecov Report

Merging #4063 (febc2e4) into main (3127071) will increase coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            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     

see 2 files with indirect coverage changes

Copy link
Member

@dario-piotrowicz dario-piotrowicz left a 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

@jculvey jculvey merged commit cb4309f into main Oct 3, 2023
24 of 26 checks passed
@jculvey jculvey deleted the c3-bump-engines-version branch October 3, 2023 00:54
@workers-devprod workers-devprod mentioned this pull request Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🚀 BUG: bump node engines to v18 in c3
4 participants