Skip to content

i18n: Fix node version compatible#48368

Closed
gvgvgvijayan wants to merge 1 commit intoWordPress:trunkfrom
gvgvgvijayan:patch-4
Closed

i18n: Fix node version compatible#48368
gvgvgvijayan wants to merge 1 commit intoWordPress:trunkfrom
gvgvgvijayan:patch-4

Conversation

@gvgvgvijayan
Copy link
Copy Markdown
Contributor

@gvgvgvijayan gvgvgvijayan commented Feb 23, 2023

What?

Part of Upgrade node and npm to latest LTS versions.

Fix node version compatible with null coalescing operator.

  • The null coalescing operator support is available from node 14 only.

Reference:

https://node.green/#ES2020-features--nullish-coalescing-operator-----

Resolves:

https://github.com/WordPress/gutenberg/pull/45414/files

Why?

Resolves syntax error unexpected token in older node version.

Screenshots or screencast

null-coalescing

Fix node version compatible with null coalescing operator.

- The null coalescing operator support is available from node 14 only.

Reference:

https://node.green/#ES2020-features--nullish-coalescing-operator-----

Resolves:

https://github.com/WordPress/gutenberg/pull/45414/files
@swissspidy
Copy link
Copy Markdown
Member

The change makes sense, but AFAIK all packages have the same "node": ">=12" setting. (See #31270 for when this was updated the last time).

Maybe this should now be changed again for all packages simultaneously?

@gziolo @youknowriad maybe one of you could chime in on that?

@youknowriad
Copy link
Copy Markdown
Contributor

I agree we need to make some upgrades to node version (minimum and used version) and npm versions. What would you suggest @gziolo? Last LTS?

@gziolo
Copy link
Copy Markdown
Member

gziolo commented Feb 24, 2023

Node 14 is the last supported LTS version. They will stop supporting Node 14 on April 30, so we should start thinking about setting the minimum version to Node 16. However, we would have to switch to Node 18 and npm 9 in the Gutenberg project and also in WordPress core.

@youknowriad
Copy link
Copy Markdown
Contributor

So I guess it's safe to say that today we can update all these minimum versions for our packages to 14 or we can wait a bit and go directly to 16 on April 30.

@gziolo
Copy link
Copy Markdown
Member

gziolo commented Feb 24, 2023

So I guess it's safe to say that today we can update all these minimum versions for our packages to 14 or we can wait a bit and go directly to 16 on April 30.

Yes, for now, we can do Node 14 everywhere, which should also be annotated in CHANGELOG files as a breaking change to enforce a major version bump for updated packages. I can find some prior art in a bit.

Edit: #43141. I'm not sure why we are still at Node 12 being the minimum for production packages 😅

@gziolo gziolo changed the title Fix node version compatible i18n: Fix node version compatible Mar 1, 2023
@gziolo gziolo added the [Package] i18n /packages/i18n label Mar 1, 2023
@swissspidy swissspidy closed this Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] i18n /packages/i18n

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants