Skip to content

Commit 8880fa1

Browse files
authored
feat(nextjs): Add Next 13 to peer dependencies and integration tests (#6042)
1 parent b2948e8 commit 8880fa1

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

packages/nextjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"next": "10.1.3"
3838
},
3939
"peerDependencies": {
40-
"next": "^10.0.8 || ^11.0 || ^12.0",
40+
"next": "^10.0.8 || ^11.0 || ^12.0 || ^13.0",
4141
"react": "15.x || 16.x || 17.x || 18.x",
4242
"webpack": ">= 4.0.0"
4343
},

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

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ echo "Running integration tests on Node $NODE_VERSION"
3030
# make a backup of our config file so we can restore it when we're done
3131
mv next.config.js next.config.js.bak
3232

33-
for NEXTJS_VERSION in 10 11 12; do
33+
for NEXTJS_VERSION in 10 11 12 13; do
3434

3535
# export this to the env so that we can behave differently depending on which version of next we're testing, without
3636
# having to pass this value from function to function to function to the one spot, deep in some callstack, where we
@@ -44,8 +44,14 @@ for NEXTJS_VERSION in 10 11 12; do
4444
fi
4545

4646
# Next.js v11 requires at least Node v12
47-
if [ "$NODE_MAJOR" -lt "12" ] && [ "$NEXTJS_VERSION" -eq "11" ]; then
48-
echo "[nextjs$NEXTJS_VERSION] Not compatible with Node $NODE_MAJOR"
47+
if [ "$NODE_MAJOR" -lt "12" ] && [ "$NEXTJS_VERSION" -ge "11" ]; then
48+
echo "[nextjs@$NEXTJS_VERSION] Not compatible with Node $NODE_MAJOR"
49+
exit 0
50+
fi
51+
52+
# Next.js v13 requires at least Node v14
53+
if [ "$NODE_MAJOR" -lt "14" ] && [ "$NEXTJS_VERSION" -ge "13" ]; then
54+
echo "[nextjs@$NEXTJS_VERSION] Not compatible with Node $NODE_MAJOR"
4955
exit 0
5056
fi
5157

@@ -61,6 +67,11 @@ for NEXTJS_VERSION in 10 11 12; do
6167
else
6268
sed -i /"next.*latest"/s/latest/"${NEXTJS_VERSION}.x"/ package.json
6369
fi
70+
71+
# Next.js v13 requires React 18.2.0
72+
if [ "$NEXTJS_VERSION" -eq "13" ]; then
73+
npm i --save react@18.2.0 react-dom@18.2.0
74+
fi
6475
# We have to use `--ignore-engines` because sucrase claims to need Node 12, even though tests pass just fine on Node
6576
# 10
6677
yarn --no-lockfile --ignore-engines --silent >/dev/null 2>&1
@@ -84,11 +95,11 @@ for NEXTJS_VERSION in 10 11 12; do
8495
# https://github.com/webpack/webpack/issues/14532#issuecomment-947513562
8596
# Context: https://github.com/vercel/next.js/issues/30078#issuecomment-947338268
8697
if [ "$NODE_MAJOR" -gt "17" ] && [ "$WEBPACK_VERSION" -eq "4" ]; then
87-
echo "[nextjs$NEXTJS_VERSION | webpack@$WEBPACK_VERSION] Node $NODE_MAJOR not compatible with Webpack $WEBPACK_VERSION"
98+
echo "[nextjs@$NEXTJS_VERSION | webpack@$WEBPACK_VERSION] Node $NODE_MAJOR not compatible with Webpack $WEBPACK_VERSION"
8899
exit 0
89100
fi
90101
if [ "$NODE_MAJOR" -gt "17" ] && [ "$NEXTJS_VERSION" -eq "10" ]; then
91-
echo "[nextjs$NEXTJS_VERSION | webpack@$WEBPACK_VERSION] Node $NODE_MAJOR not compatible with Webpack $WEBPACK_VERSION"
102+
echo "[nextjs@$NEXTJS_VERSION | webpack@$WEBPACK_VERSION] Node $NODE_MAJOR not compatible with Webpack $WEBPACK_VERSION"
92103
exit 0
93104
fi
94105

0 commit comments

Comments
 (0)