Skip to content

Commit

Permalink
chore(deps): update nodejs to v22 (major) (#86922)
Browse files Browse the repository at this point in the history
* chore(deps): update nodejs to v22

* Update package.json to Node 22

* Update NVM to Node 22

* Disable the server profiler

This is due to not-compatibility with Node 22

* Deduplicate dependencies with overlapping ranges

* Update `@types/node` for all packages

---------

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Miroslav Mitev <m1r0@users.noreply.github.com>
  • Loading branch information
3 people authored Oct 16, 2024
1 parent ce020ef commit fdcdf4b
Show file tree
Hide file tree
Showing 14 changed files with 52 additions and 344 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ references:
defaults: &defaults
working_directory: ~/wp-calypso
docker:
- image: cimg/node:20.8.1
- image: cimg/node:22.9.0
environment:
CIRCLE_ARTIFACTS: /tmp/artifacts
CIRCLE_TEST_REPORTS: /tmp/test_results
Expand Down Expand Up @@ -142,7 +142,7 @@ commands:
jobs:
wp-desktop-assets:
docker:
- image: cimg/node:20.8.1-browsers
- image: cimg/node:22.9.0-browsers
<<: *desktop_defaults
environment:
VERSION: << pipeline.git.tag >>
Expand Down Expand Up @@ -247,7 +247,7 @@ jobs:
docker:
# Important: the build fails on 18.13.0, so we pin it to a slightly older
# version to keep this one working for now.
- image: cimg/node:20.8.1-browsers
- image: cimg/node:22.9.0-browsers
<<: *desktop_defaults
resource_class: medium+
shell: /bin/bash --login
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.8.1
22.9.0
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG use_cache=false
ARG node_version=20.8.1
ARG node_version=22.9.0
ARG base_image=registry.a8c.com/calypso/base:latest

###################
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#### This image is not pushed to any repository and it shouldn't be used as base image for any other docker build.
#### Its main goal is to create a `/calypso/.cache` that can be copied over other images that can benefit from a warm cache.
#### Note that yarn v3 cache lives in `/calypso/.yarn`
FROM node:20.8.1-bullseye-slim as cache
FROM node:22.9.0-bullseye-slim as cache
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

ARG node_memory=8192
Expand Down Expand Up @@ -30,7 +30,7 @@ ENTRYPOINT [ "/bin/bash" ]

#### base image
#### This image can be used as a base image for other builds, or to test and build calypso.
FROM node:20.8.1-bullseye-slim as base
FROM node:22.9.0-bullseye-slim as base
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

ARG node_memory=8192
Expand Down
6 changes: 5 additions & 1 deletion client/server/boot/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ export default function setup() {
app.use( loggerMiddleware() );

if ( process.env.USE_SERVER_PROFILER === 'true' ) {
app.use( require( 'calypso/server/middleware/profiler' )() );
// TODO: Re-enable this middleware once `v8-profiler-next` adds support for Node.js 22
// app.use( require( 'calypso/server/middleware/profiler' )() );
console.warn(
'Server profiling is temporarily disabled until `v8-profiler-next` adds support for Node.js 22.'
);
}

if ( 'development' === process.env.NODE_ENV ) {
Expand Down
3 changes: 3 additions & 0 deletions docs/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

## Server Request Profiling

> [!NOTE]
> The profiler is temporarily disabled due to non-compatibility with the current Node version.
We've included [`v8-profiler-next`](https://www.npmjs.com/package/v8-profiler-next) which allows you to generate CPU profiles (including flamegraphs) for requests to the Calypso NodeJS server. This is helpful for finding functions which impact performance the most on a given route.

To use the profiler:
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
]
},
"engines": {
"node": "^v20.8.1",
"node": "^v22.9.0",
"yarn": "^4.0.0"
},
"scripts": {
Expand Down Expand Up @@ -172,7 +172,7 @@
"@types/fast-json-stable-stringify": "^2.0.0",
"@types/jest": "^29.5.12",
"@types/lodash": "^4.14.199",
"@types/node": "^20.8.6",
"@types/node": "^22.7.5",
"@types/page": "^1.11.5",
"@types/qs": "^6.9.7",
"@types/react": "^18.2.6",
Expand Down Expand Up @@ -311,7 +311,6 @@
"stylelint": "^16.8.2",
"tslib": "^2.3.0",
"typescript": "^5.3.3",
"v8-profiler-next": "^1.10.0",
"webpack": "^5.94.0",
"webpack-bundle-analyzer": "^4.10.2",
"webpack-cli": "^4.10.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/calypso-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"dependencies": {
"@automattic/create-calypso-config": "workspace:^",
"@types/cookie": "^0.4.1",
"@types/node": "^20.8.6",
"@types/node": "^22.7.5",
"cookie": "^0.4.1",
"tslib": "^2.3.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/calypso-e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@automattic/languages": "workspace:^",
"@automattic/zendesk-client": "workspace:^",
"@jest/globals": "^29.7.0",
"@types/node": "^20.8.6",
"@types/node": "^22.7.5",
"@types/node-fetch": "^2.6.1",
"@wordpress/i18n": "^5.8.0",
"asana-phrase": "^0.0.8",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-wpcalypso/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"lib/"
],
"engines": {
"node": ">=v20.8.1"
"node": ">=v22.9.0"
},
"peerDependencies": {
"@babel/core": ">=7.24.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/fingerprintjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"@types/karma": "^6.3.3",
"@types/karma-spec-reporter": "^0.0.3",
"@types/karma-summary-reporter": "^3.1.0",
"@types/node": "^22.2.0",
"@types/node": "^22.7.5",
"@types/ua-parser-js": "^0.7.36",
"@typescript-eslint/eslint-plugin": "^5.44.0",
"@typescript-eslint/parser": "^5.44.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-circus-allure-reporter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"devDependencies": {
"@automattic/calypso-eslint-overrides": "workspace:^",
"@automattic/calypso-typescript-config": "workspace:^",
"@types/node": "^20.8.6",
"@types/node": "^22.7.5",
"typescript": "^5.3.3"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/wp-babel-makepot/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20.8.1
FROM node:22.9.0

# /src is where we expect source javascript to run our babel config over
RUN mkdir /src
Expand Down
Loading

0 comments on commit fdcdf4b

Please sign in to comment.