nodejs / nodejs.org

The Node.js® Website
https://nodejs.org
MIT License
6k stars 6.16k forks source link

feat: add support for Node.js v22 #6732

Closed RedYetiDev closed 1 month ago

RedYetiDev commented 1 month ago

Description

This PR changes all instances of import ... from ... assert { ... } to import ... from ... with { ... }

Validation

A reviewer should verify that the tests pass in both Node.js v22 and Node.js v20.

Related Issues

N/A

Check List

vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview May 21, 2024 8:19pm
ovflowd commented 1 month ago

We can't do this, as Vercel only supports Node.js v20. And this syntax is Node.js v22+ only.

Sorry, closing this PR as we simply cannot use this now. I appreciate the effort, tho!

ovflowd commented 1 month ago

(Although the deployment passed I want to avoid using features of an unsupported version on our cloud provider)

AugustinMauroy commented 1 month ago

on node V20.13.1 it's work with the with keyword

https://nodejs.org/docs/latest-v20.x/api/esm.html#import-attributes

ovflowd commented 1 month ago

on node V20.13.1 it's work with the with keyword

nodejs.org/docs/latest-v20.x/api/esm.html#import-attributes

Yes, it got backported recently, but this PR also changes the target Node version on package.json to >=20; I really want to avoid adding features that are specific to a version (that might be backported or not) to a stable-running environment.

We don't need to be in the edge of Node.js here, let's wait until Vercel officially supports v22.