Skip to content

Commit b90d046

Browse files
AbhiPrasadJonasBa
andauthored
feat(node): [v7] Support Node 22 (#11754)
tracking issue: #11455 ABI is 126: https://github.com/electron/node-abi/blob/bd11f2da07c5da324e735e2de5bf6716ce97b11c/abi_registry.json#L95-L102 ~Waiting for nodejs/node#52505 to release!~ Added changelog entry for `7.113.0`, will cut a release after this gets merged. --------- Co-authored-by: JonasBa <[email protected]>
1 parent 6f7095d commit b90d046

File tree

8 files changed

+79
-18
lines changed

8 files changed

+79
-18
lines changed

.github/workflows/build.yml

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ jobs:
533533
strategy:
534534
fail-fast: false
535535
matrix:
536-
node: [8, 10, 12, 14, 16, 18, 20, 21]
536+
node: [8, 10, 12, 14, 16, 18, 20, 22]
537537
steps:
538538
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
539539
uses: actions/checkout@v4
@@ -595,7 +595,7 @@ jobs:
595595
strategy:
596596
fail-fast: false
597597
matrix:
598-
node: [10, 12, 14, 16, 18, 20, 21]
598+
node: [10, 12, 14, 16, 18, 20, 22]
599599
steps:
600600
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
601601
uses: actions/checkout@v4
@@ -884,12 +884,12 @@ jobs:
884884
strategy:
885885
fail-fast: false
886886
matrix:
887-
node: [10, 12, 14, 16, 18, 20, 21]
887+
node: [10, 12, 14, 16, 18, 20, 22]
888888
typescript:
889889
- false
890890
include:
891891
# Only check typescript for latest version (to streamline CI)
892-
- node: 20
892+
- node: 22
893893
typescript: '3.8'
894894
steps:
895895
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
@@ -925,7 +925,7 @@ jobs:
925925
strategy:
926926
fail-fast: false
927927
matrix:
928-
node: [18, 20, 21]
928+
node: [18, 20, 22]
929929
remix: [1, 2]
930930
# Remix v2 only supports Node 18+, so run Node 14, 16 tests separately
931931
include:
@@ -1338,6 +1338,8 @@ jobs:
13381338
node: 18
13391339
- os: ubuntu-20.04
13401340
node: 20
1341+
- os: ubuntu-20.04
1342+
node: 22
13411343

13421344
# x64 musl
13431345
- os: ubuntu-20.04
@@ -1349,6 +1351,9 @@ jobs:
13491351
- os: ubuntu-20.04
13501352
container: node:20-alpine3.17
13511353
node: 20
1354+
- os: ubuntu-20.04
1355+
container: node:22-alpine3.18
1356+
node: 22
13521357

13531358
# arm64 glibc
13541359
- os: ubuntu-20.04
@@ -1360,6 +1365,9 @@ jobs:
13601365
- os: ubuntu-20.04
13611366
arch: arm64
13621367
node: 20
1368+
- os: ubuntu-20.04
1369+
arch: arm64
1370+
node: 22
13631371

13641372
# arm64 musl
13651373
- os: ubuntu-20.04
@@ -1374,6 +1382,10 @@ jobs:
13741382
arch: arm64
13751383
container: node:20-alpine3.17
13761384
node: 20
1385+
- os: ubuntu-20.04
1386+
arch: arm64
1387+
container: node:22-alpine3.18
1388+
node: 22
13771389

13781390
# macos x64
13791391
- os: macos-11
@@ -1385,35 +1397,42 @@ jobs:
13851397
- os: macos-11
13861398
node: 20
13871399
arch: x64
1400+
- os: macos-11
1401+
node: 22
1402+
arch: x64
13881403

13891404
# macos arm64
13901405
- os: macos-12
13911406
arch: arm64
13921407
node: 16
13931408
target_platform: darwin
1394-
13951409
- os: macos-12
13961410
arch: arm64
13971411
node: 18
13981412
target_platform: darwin
1399-
14001413
- os: macos-12
14011414
arch: arm64
14021415
node: 20
14031416
target_platform: darwin
1417+
- os: macos-12
1418+
arch: arm64
1419+
node: 22
1420+
target_platform: darwin
14041421

14051422
# windows x64
14061423
- os: windows-2022
14071424
node: 16
14081425
arch: x64
1409-
14101426
- os: windows-2022
14111427
node: 18
14121428
arch: x64
1413-
14141429
- os: windows-2022
14151430
node: 20
14161431
arch: x64
1432+
- os: windows-2022
1433+
node: 22
1434+
arch: x64
1435+
14171436
steps:
14181437
- name: Setup (alpine)
14191438
if: contains(matrix.container, 'alpine')

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@
44

55
- "You miss 100 percent of the chances you don't take. — Wayne Gretzky" — Michael Scott
66

7+
## 7.113.0
8+
9+
- **feat(node): Support Node 22 (#11754)**
10+
11+
This release adds support for Node 22! 🎉
12+
13+
It also adds prebuilt-binaries for Node 22 to `@sentry/profiling-node`.
14+
715
## 7.112.2
816

917
- fix(nextjs|sveltekit): Ensure we can pass `browserTracingIntegration` (#11765)

packages/profiling-node/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ npm i -g windows-build-tools
6868

6969
### Prebuilt binaries
7070

71-
We currently ship prebuilt binaries for a few of the most common platforms and node versions (v16-20).
71+
We currently ship prebuilt binaries for a few of the most common platforms and node versions (v16-22).
7272

7373
- macOS x64
7474
- Linux ARM64 (musl)

packages/profiling-node/binding.gyp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,15 @@
66
# Silence gcc8 deprecation warning https://github.com/nodejs/nan/issues/807#issuecomment-455750192
77
"cflags": ["-Wno-cast-function-type"]
88
},
9-
]
9+
],
10+
'conditions': [
11+
[ 'OS=="win"', {
12+
'defines': [
13+
# Stop <windows.h> from defining macros that conflict with
14+
# std::min() and std::max(). We don't use <windows.h> (much)
15+
# but we still inherit it from uv.h.
16+
'NOMINMAX',
17+
]
18+
}],
19+
],
1020
}

packages/profiling-node/bindings/cpu_profiler.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#ifndef NOMINMAX
2+
#define NOMINMAX
3+
#endif
14

25
#include <assert.h>
36
#include <math.h>

packages/profiling-node/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@
6565
},
6666
"dependencies": {
6767
"detect-libc": "^2.0.2",
68-
"node-abi": "^3.52.0"
68+
"node-abi": "^3.61.0"
6969
},
7070
"devDependencies": {
7171
"@sentry/core": "7.112.2",
7272
"@sentry/node": "7.112.2",
7373
"@sentry/types": "7.112.2",
7474
"@sentry/utils": "7.112.2",
7575
"@types/node": "16.18.70",
76-
"@types/node-abi": "^3.0.0",
76+
"@types/node-abi": "^3.0.3",
7777
"clang-format": "^1.8.0",
7878
"cross-env": "^7.0.3",
7979
"node-gyp": "^9.4.1",

packages/profiling-node/src/cpu_profiler.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ export function importCppBindingsModule(): PrivateV8CpuProfilerBindings {
4848
if (abi === '115') {
4949
return require('./sentry_cpu_profiler-darwin-x64-115.node');
5050
}
51+
if (abi === '127') {
52+
return require('./sentry_cpu_profiler-darwin-x64-127.node');
53+
}
5154
}
5255

5356
if (arch === 'arm64') {
@@ -60,6 +63,9 @@ export function importCppBindingsModule(): PrivateV8CpuProfilerBindings {
6063
if (abi === '115') {
6164
return require('./sentry_cpu_profiler-darwin-arm64-115.node');
6265
}
66+
if (abi === '127') {
67+
return require('./sentry_cpu_profiler-darwin-arm64-127.node');
68+
}
6369
}
6470
}
6571

@@ -74,6 +80,9 @@ export function importCppBindingsModule(): PrivateV8CpuProfilerBindings {
7480
if (abi === '115') {
7581
return require('./sentry_cpu_profiler-win32-x64-115.node');
7682
}
83+
if (abi === '127') {
84+
return require('./sentry_cpu_profiler-win32-x64-127.node');
85+
}
7786
}
7887
}
7988

@@ -89,6 +98,9 @@ export function importCppBindingsModule(): PrivateV8CpuProfilerBindings {
8998
if (abi === '115') {
9099
return require('./sentry_cpu_profiler-linux-x64-musl-115.node');
91100
}
101+
if (abi === '127') {
102+
return require('./sentry_cpu_profiler-linux-x64-musl-127.node');
103+
}
92104
}
93105
if (stdlib === 'glibc') {
94106
if (abi === '93') {
@@ -100,6 +112,9 @@ export function importCppBindingsModule(): PrivateV8CpuProfilerBindings {
100112
if (abi === '115') {
101113
return require('./sentry_cpu_profiler-linux-x64-glibc-115.node');
102114
}
115+
if (abi === '127') {
116+
return require('./sentry_cpu_profiler-linux-x64-glibc-127.node');
117+
}
103118
}
104119
}
105120
if (arch === 'arm64') {
@@ -113,6 +128,9 @@ export function importCppBindingsModule(): PrivateV8CpuProfilerBindings {
113128
if (abi === '115') {
114129
return require('./sentry_cpu_profiler-linux-arm64-musl-115.node');
115130
}
131+
if (abi === '127') {
132+
return require('./sentry_cpu_profiler-linux-arm64-musl-127.node');
133+
}
116134
}
117135
if (stdlib === 'glibc') {
118136
if (abi === '93') {
@@ -124,6 +142,9 @@ export function importCppBindingsModule(): PrivateV8CpuProfilerBindings {
124142
if (abi === '115') {
125143
return require('./sentry_cpu_profiler-linux-arm64-glibc-115.node');
126144
}
145+
if (abi === '127') {
146+
return require('./sentry_cpu_profiler-linux-arm64-glibc-127.node');
147+
}
127148
}
128149
}
129150
}

yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6769,7 +6769,7 @@
67696769
dependencies:
67706770
"@types/unist" "^2"
67716771

6772-
"@types/node-abi@^3.0.0":
6772+
"@types/node-abi@^3.0.3":
67736773
version "3.0.3"
67746774
resolved "https://registry.yarnpkg.com/@types/node-abi/-/node-abi-3.0.3.tgz#a8334d75fe45ccd4cdb2a6c1ae82540a7a76828c"
67756775
integrity sha512-5oos6sivyXcDEuVC5oX3+wLwfgrGZu4NIOn826PGAjPCHsqp2zSPTGU7H1Tv+GZBOiDUY3nBXY1MdaofSEt4fw==
@@ -23205,10 +23205,10 @@ node-abi@^3.3.0:
2320523205
dependencies:
2320623206
semver "^7.3.5"
2320723207

23208-
node-abi@^3.52.0:
23209-
version "3.54.0"
23210-
resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-3.54.0.tgz#f6386f7548817acac6434c6cba02999c9aebcc69"
23211-
integrity sha512-p7eGEiQil0YUV3ItH4/tBb781L5impVmmx2E9FRKF7d18XXzp4PGT2tdYMFY6wQqgxD0IwNZOiSJ0/K0fSi/OA==
23208+
node-abi@^3.61.0:
23209+
version "3.61.0"
23210+
resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-3.61.0.tgz#9248f8b8e35dbae2fafeecd6240c5a017ea23f3f"
23211+
integrity sha512-dYDO1rxzvMXjEMi37PBeFuYgwh3QZpsw/jt+qOmnRSwiV4z4c+OLoRlTa3V8ID4TrkSQpzCVc9OI2sstFaINfQ==
2321223212
dependencies:
2321323213
semver "^7.3.5"
2321423214

0 commit comments

Comments
 (0)