Dependency upgrade: Minimum supported node version v18#345
Merged
Conversation
This project's package.json engines field declared support all the way back to node 10, but we've taken dependencies that are incompatible with anything older than node 18! After updating the engines field, I did some digging and realized that native nodeJS fetch landed in v18, so we have an opportunity here to formalize our support boundary as node 18 and throw out the several fetch implementations we had lying around (one of which was responsible for the punycode deprecation warnings). Also includes a .nvmrc to pin to v18 so we don't accidentally include libraries that require v19+ in the future. Previous error installing on node v17: > yarn install error mute-stream@1.0.0: The engine "node" is incompatible with this module. Expected version "^14.17.0 || ^16.13.0 || >=18.0.0". Got "17.9.1" error Found incompatible module. Previous error running on node v17: > ./bin/run eval "Database.all()" › Error: fetch is not defined:
145a0d2 to
7b71874
Compare
827a303 to
5ee34df
Compare
henryfauna
approved these changes
Jul 18, 2024
Contributor
henryfauna
left a comment
There was a problem hiding this comment.
We should probably consider doing a major version bump when this goes out
henryfauna
reviewed
Jul 18, 2024
Contributor
henryfauna
left a comment
There was a problem hiding this comment.
You will also likely need to update the pipeline as it runs tests against node 16
Contributor
Author
Done! |
wildemat
approved these changes
Jul 19, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket(s): FE-5645
Problem
Deprecation errors on every usage of the CLI
Solution
This project's package.json engines field declared support all the way back to node 10, but we've taken dependencies that are incompatible with anything older than node 18! After updating the engines field, I did some digging and realized that native nodeJS fetch landed in v18, so we have an opportunity here to formalize our support boundary as node 18 and throw out the several fetch implementations we had lying around (one of which was responsible for the punycode deprecation warnings).
Also includes a .nvmrc to pin to v18 so we don't accidentally include libraries that require v19+ in the future.
Result
Change Details
duplex: "half"attribute RequestInit: duplex option is required when sending a body nodejs/node#46221nockrequired upgrade to support native fetch interceptors Node 18+: makenockwork nativefetchnock/nock#2397 (comment)@oclif/testrequired upgrade to get rid of the oldernockdependencyjestforexpecthttps://jest-archive-august-2023.netlify.app/docs/28.x/upgrading-to-jest28/#expect@oclif/corenow exported as a module, moved out ofrequirewhere necessaryrequireoutside of thecatchinbin/runas that fixed an issue where uncaught errors from OCLIF were having their entire stack trace printed.Testing
As we don't have 100% coverage, I went through and did some light manual testing for the following commands