Skip to content

feat(ci): Add Node 18 to test matrix #5049

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [8, 10, 12, 14, 16]
node: [8, 10, 12, 14, 16, 18]
steps:
- name: Check out current commit (${{ env.HEAD_COMMIT }})
uses: actions/checkout@v2
Expand Down Expand Up @@ -318,7 +318,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: [10, 12, 14, 16]
node: [10, 12, 14, 16, 18]
steps:
- name: Check out current commit (${{ env.HEAD_COMMIT }})
uses: actions/checkout@v2
Expand Down Expand Up @@ -518,7 +518,7 @@ jobs:
continue-on-error: true
strategy:
matrix:
node: [10, 12, 14, 16]
node: [10, 12, 14, 16, 18]
steps:
- name: Check out current commit (${{ github.sha }})
uses: actions/checkout@v2
Expand Down
13 changes: 13 additions & 0 deletions packages/nextjs/test/run-integration-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,19 @@ for NEXTJS_VERSION in 10 11 12; do
WEBPACK_VERSION=5 ||
WEBPACK_VERSION=4

# Node v18 only with Webpack 5 and above
# https://github.com/webpack/webpack/issues/14532#issuecomment-947513562
# Context: https://github.com/vercel/next.js/issues/30078#issuecomment-947338268
if [ "$NODE_MAJOR" -gt "17" ] && [ "$WEBPACK_VERSION" -eq "4" ]; then
echo "[nextjs$NEXTJS_VERSION | webpack@$WEBPACK_VERSION] Node $NODE_MAJOR not compatible with Webpack $WEBPACK_VERSION"
exit 0
fi
if [ "$NODE_MAJOR" -gt "17" ] && [ "$NEXTJS_VERSION" -eq "10" ]; then
echo "[nextjs$NEXTJS_VERSION | webpack@$WEBPACK_VERSION] Node $NODE_MAJOR not compatible with Webpack $WEBPACK_VERSION"
exit 0
fi


# next 10 defaults to webpack 4 and next 11 defaults to webpack 5, but each can use either based on settings
if [ "$NEXTJS_VERSION" -eq "10" ]; then
sed "s/%RUN_WEBPACK_5%/$RUN_WEBPACK_5/g" <next10.config.template >next.config.js
Expand Down
7 changes: 6 additions & 1 deletion packages/node/test/manual/webpack-domain/npm-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ const path = require('path');
const webpack = require('webpack');
const { execSync } = require('child_process');

// Webpack test does not work in Node 18 and above.
if (Number(process.versions.node.split('.')[0]) >= 18) {
return;
}

// prettier-ignore
webpack(
{
Expand All @@ -13,7 +18,7 @@ webpack(
target: 'node',
mode: 'development',
},
function(err, stats) {
function (err, stats) {
if (err) {
console.error(err.stack || err);
if (err.details) {
Expand Down
2 changes: 1 addition & 1 deletion packages/serverless/src/awslambda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function init(options: Sentry.NodeOptions = {}): void {
version: Sentry.SDK_VERSION,
};

options.dsn = extensionRelayDSN(options.dsn)
options.dsn = extensionRelayDSN(options.dsn);

Sentry.init(options);
Sentry.addGlobalEventProcessor(serverlessEventProcessor);
Expand Down
1 change: 0 additions & 1 deletion packages/utils/src/dsn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ export function makeDsn(from: DsnLike): DsnComponents {
return components;
}


/**
* Changes a Dsn to point to the `relay` server running in the Lambda Extension.
*
Expand Down
3 changes: 3 additions & 0 deletions packages/utils/src/normalize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type ObjOrArray<T> = { [key: string]: T };
* object in the normallized output..
* @returns A normalized version of the object, or `"**non-serializable**"` if any errors are thrown during normalization.
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function normalize(input: unknown, depth: number = +Infinity, maxProperties: number = +Infinity): any {
try {
// since we're at the outermost level, we don't provide a key
Expand All @@ -42,6 +43,7 @@ export function normalize(input: unknown, depth: number = +Infinity, maxProperti

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

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