Skip to content

Commit 66f1f79

Browse files
committed
feat(ci): Add Node 18 to test matrix (#5049)
https://nodejs.org/en/blog/announcements/v18-release-announce/ From reviewing the CHANGELOG (https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V18.md), there seems to be no changes that will affect us in the code. See v17 CHANGELOG: https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V17.md
1 parent 8f2a216 commit 66f1f79

File tree

6 files changed

+26
-6
lines changed

6 files changed

+26
-6
lines changed

.github/workflows/build.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ jobs:
281281
runs-on: ubuntu-latest
282282
strategy:
283283
matrix:
284-
node: [8, 10, 12, 14, 16]
284+
node: [8, 10, 12, 14, 16, 18]
285285
steps:
286286
- name: Check out current commit (${{ env.HEAD_COMMIT }})
287287
uses: actions/checkout@v2
@@ -318,7 +318,7 @@ jobs:
318318
runs-on: ubuntu-latest
319319
strategy:
320320
matrix:
321-
node: [10, 12, 14, 16]
321+
node: [10, 12, 14, 16, 18]
322322
steps:
323323
- name: Check out current commit (${{ env.HEAD_COMMIT }})
324324
uses: actions/checkout@v2
@@ -518,7 +518,7 @@ jobs:
518518
continue-on-error: true
519519
strategy:
520520
matrix:
521-
node: [10, 12, 14, 16]
521+
node: [10, 12, 14, 16, 18]
522522
steps:
523523
- name: Check out current commit (${{ github.sha }})
524524
uses: actions/checkout@v2

packages/nextjs/test/run-integration-tests.sh

+13
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,19 @@ for NEXTJS_VERSION in 10 11 12; do
7878
WEBPACK_VERSION=5 ||
7979
WEBPACK_VERSION=4
8080

81+
# Node v18 only with Webpack 5 and above
82+
# https://github.com/webpack/webpack/issues/14532#issuecomment-947513562
83+
# Context: https://github.com/vercel/next.js/issues/30078#issuecomment-947338268
84+
if [ "$NODE_MAJOR" -gt "17" ] && [ "$WEBPACK_VERSION" -eq "4" ]; then
85+
echo "[nextjs$NEXTJS_VERSION | webpack@$WEBPACK_VERSION] Node $NODE_MAJOR not compatible with Webpack $WEBPACK_VERSION"
86+
exit 0
87+
fi
88+
if [ "$NODE_MAJOR" -gt "17" ] && [ "$NEXTJS_VERSION" -eq "10" ]; then
89+
echo "[nextjs$NEXTJS_VERSION | webpack@$WEBPACK_VERSION] Node $NODE_MAJOR not compatible with Webpack $WEBPACK_VERSION"
90+
exit 0
91+
fi
92+
93+
8194
# next 10 defaults to webpack 4 and next 11 defaults to webpack 5, but each can use either based on settings
8295
if [ "$NEXTJS_VERSION" -eq "10" ]; then
8396
sed "s/%RUN_WEBPACK_5%/$RUN_WEBPACK_5/g" <next10.config.template >next.config.js

packages/node/test/manual/webpack-domain/npm-build.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ const path = require('path');
22
const webpack = require('webpack');
33
const { execSync } = require('child_process');
44

5+
// Webpack test does not work in Node 18 and above.
6+
if (Number(process.versions.node.split('.')[0]) >= 18) {
7+
return;
8+
}
9+
510
// prettier-ignore
611
webpack(
712
{
@@ -13,7 +18,7 @@ webpack(
1318
target: 'node',
1419
mode: 'development',
1520
},
16-
function(err, stats) {
21+
function (err, stats) {
1722
if (err) {
1823
console.error(err.stack || err);
1924
if (err.details) {

packages/serverless/src/awslambda.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export function init(options: Sentry.NodeOptions = {}): void {
7979
version: Sentry.SDK_VERSION,
8080
};
8181

82-
options.dsn = extensionRelayDSN(options.dsn)
82+
options.dsn = extensionRelayDSN(options.dsn);
8383

8484
Sentry.init(options);
8585
Sentry.addGlobalEventProcessor(serverlessEventProcessor);

packages/utils/src/dsn.ts

-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ export function makeDsn(from: DsnLike): DsnComponents {
108108
return components;
109109
}
110110

111-
112111
/**
113112
* Changes a Dsn to point to the `relay` server running in the Lambda Extension.
114113
*

packages/utils/src/normalize.ts

+3
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ type ObjOrArray<T> = { [key: string]: T };
3131
* object in the normallized output..
3232
* @returns A normalized version of the object, or `"**non-serializable**"` if any errors are thrown during normalization.
3333
*/
34+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
3435
export function normalize(input: unknown, depth: number = +Infinity, maxProperties: number = +Infinity): any {
3536
try {
3637
// since we're at the outermost level, we don't provide a key
@@ -42,6 +43,7 @@ export function normalize(input: unknown, depth: number = +Infinity, maxProperti
4243

4344
/** JSDoc */
4445
export function normalizeToSize<T>(
46+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
4547
object: { [key: string]: any },
4648
// Default Node.js REPL depth
4749
depth: number = 3,
@@ -241,6 +243,7 @@ function utf8Length(value: string): number {
241243
}
242244

243245
/** Calculates bytes size of input object */
246+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
244247
function jsonSize(value: any): number {
245248
return utf8Length(JSON.stringify(value));
246249
}

0 commit comments

Comments
 (0)