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

Drop support for Node 18 and installGlobals #12171

Merged
merged 7 commits into from
Oct 22, 2024
Merged

Conversation

brophdawg11
Copy link
Contributor

@brophdawg11 brophdawg11 commented Oct 21, 2024

Per https://nodejs.org/en/about/previous-releases:

  • Node 20 has been the Active LTS version for a year now
  • Node 22 will become Active LTS this month
  • Node 18 will be losing it's "Maintenance LTS" status in April 2025
  • With React Router v7 landing (hopefully) in late 2024, it makes sense to go ahead and drop support for Node 18 and focus on Node 20/22

This means we no longer need an installGlobals method because fetch is stable in Node 20 🎉

TODO:

  • Add docs section showing how to install your own polyfills if needed (basically write your own installGlobals in userland)

Copy link

changeset-bot bot commented Oct 21, 2024

🦋 Changeset detected

Latest commit: f1fcf52

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

This PR includes changesets to release 10 packages
Name Type
@react-router/express Major
@react-router/node Major
@react-router/dev Major
react-router Major
@react-router/serve Major
@react-router/architect Major
@react-router/fs-routes Major
@react-router/remix-config-routes-adapter Major
@react-router/cloudflare Major
react-router-dom Major

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


if (!globalThis.fetch) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not quite sure why this is still needed - but unit tests fail without it - maybe a jsdom issue?

>  pnpm test packages/react-router/__tests__/router/navigation-test.ts
...
  ● navigations › navigation states › loader submission + redirect

    ReferenceError: Request is not defined

      4978 |   }
      4979 |
    > 4980 |   return new Request(url, init);
           |   ^
      4981 | }
      4982 |
      4983 | function convertFormDataToSearchParams(formData: FormData): URLSearchParams {

      at createClientSideRequest (lib/router/router.ts:4980:3)
      at createClientSideRequest (lib/router/router.ts:1560:19)
      at Object.startNavigation [as navigate] (lib/router/router.ts:1411:11)
      at Object.navigate (__tests__/router/utils/data-router-setup.ts:642:19)
      at Object.navigate (__tests__/router/navigation-test.ts:1250:23)

@brophdawg11 brophdawg11 merged commit 813497a into dev Oct 22, 2024
7 of 8 checks passed
@brophdawg11 brophdawg11 deleted the brophdawg11/node-20 branch October 22, 2024 15:24
Copy link
Contributor

🤖 Hello there,

We just published version 7.0.0 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

Copy link
Contributor

🤖 Hello there,

We just published version 6.28.1-pre.0 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

Copy link
Contributor

🤖 Hello there,

We just published version 6.28.1 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

Copy link
Contributor

🤖 Hello there,

We just published version 7.1.0 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

Copy link
Contributor

🤖 Hello there,

We just published version 6.28.2-pre.0 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant