Skip to content

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!

@codesandbox-ci
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.

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

3 participants