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

Upgrade to node v18 #184

Merged
merged 3 commits into from
Dec 13, 2023
Merged

Upgrade to node v18 #184

merged 3 commits into from
Dec 13, 2023

Conversation

r-n-o
Copy link
Contributor

@r-n-o r-n-o commented Dec 13, 2023

Summary & Motivation

Node 16 has been deprecated since September. Time to upgrade! This PR addresses #120. Because node v18 comes with its own experimental fetch API our code which tried to mock fetch was failing. I've opted to always use cross-fetch regardless of whether fetch is available in globalThis because cross-fetch is meant to be used for exactly this reason! It detects when native implementations are available and uses either browser or node fetch when they're available.

Having fetch in a known location is nice because we have a seam to mock it.

How I Tested These Changes

Unit tests

Did you add a changeset?

Changeset added and packages bumped!

Copy link

codesandbox-ci bot commented Dec 13, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

pnpm-lock.yaml Outdated Show resolved Hide resolved
Copy link
Collaborator

@andrewkmin andrewkmin left a comment

Choose a reason for hiding this comment

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

lgtm!

@andrewkmin
Copy link
Collaborator

I've opted to always use cross-fetch regardless of whether fetch is available in globalThis because cross-fetch is meant to be used for exactly this reason! It detects when native implementations are available and uses either browser or node fetch when they're available.

thanks for adding this clarity

@r-n-o r-n-o force-pushed the rno/upgrade-to-node18 branch from 6bb9ad3 to eb8f13d Compare December 13, 2023 17:21
Copy link
Collaborator

@andrewkmin andrewkmin left a comment

Choose a reason for hiding this comment

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

🚢

@r-n-o r-n-o merged commit 83a162b into main Dec 13, 2023
5 checks passed
@r-n-o r-n-o deleted the rno/upgrade-to-node18 branch December 13, 2023 19:24
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.

2 participants