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

Dependency upgrade: Minimum supported node version v18 #345

Merged
merged 19 commits into from
Jul 19, 2024

Conversation

echo-bravo-yahoo
Copy link
Contributor

@echo-bravo-yahoo echo-bravo-yahoo commented Jul 12, 2024

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

➜  fauna-shell git:(punycode-deprecation-warnings) fauna shell
(node:11997) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Connected to endpoint: cloud
Type Ctrl+D or .exit to exit the shell
>
➜  fauna-shell git:(punycode-deprecation-warnings) node bin/run shell
Connected to endpoint: cloud
Type Ctrl+D or .exit to exit the shell
>

Change Details

Testing

As we don't have 100% coverage, I went through and did some light manual testing for the following commands

  • cloud-login
  • add-endpoint
  • create-database
  • create-key
  • default-endpoint
  • delete-database
  • delete-endpoint
  • delete-key
  • eval
  • help
  • import
  • list-databases
  • list-endpoints
  • list-keys
  • run-queries
  • shell
  • upload-graphql-schema

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:
@mwilde345 mwilde345 changed the title Remove punycode deprecation warnings Dependency upgrade: Minimum supported node version v18 Jul 18, 2024
Copy link
Contributor

@henryfauna henryfauna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably consider doing a major version bump when this goes out

Copy link
Contributor

@henryfauna henryfauna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You will also likely need to update the pipeline as it runs tests against node 16

@echo-bravo-yahoo
Copy link
Contributor Author

You will also likely need to update the pipeline as it runs tests against node 16

Done!

@mwilde345 mwilde345 merged commit a1453ee into main Jul 19, 2024
1 check passed
@mwilde345 mwilde345 deleted the punycode-deprecation-warnings branch July 19, 2024 18:50
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.

3 participants