-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(nextjs): Bump minimum required Next.js version to 13.2.0
#11097
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
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
352aea5
feat(nextjs): Bump minimum required Next.js version to `13.2.0`
lforst 2638403
.
lforst 858f7d3
hm
lforst 39a3622
fix
lforst de7a1a9
fix
lforst ccddc92
Merge branch 'develop' into lforst-min-nextjs-version
lforst 6bfbfbb
test
lforst 6a89e31
.
lforst 55103c8
Merge remote-tracking branch 'origin/develop' into lforst-min-nextjs-…
lforst 80a9ef6
test(replay): Skip flaky replay integration tests
AbhiPrasad fe56cfc
disable more tests
AbhiPrasad a0be4c7
Merge branch 'develop' into lforst-min-nextjs-version
lforst 2224f7a
Merge branch 'develop' into abhi-skip-flaky-replay-tests
lforst 16f8a21
Merge remote-tracking branch 'origin/abhi-skip-flaky-replay-tests' in…
lforst 2c6020b
Unskip non-flakey test
lforst 7b3152e
Merge branch 'abhi-skip-flaky-replay-tests' into lforst-min-nextjs-ve…
lforst ba0844a
Merge remote-tracking branch 'origin/develop' into lforst-min-nextjs-…
lforst e4ae858
Revert "Unskip non-flakey test"
lforst c59a18c
Merge branch 'abhi-skip-flaky-replay-tests' into lforst-min-nextjs-ve…
lforst 599eed9
wth man
lforst File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
/// <reference types="next" /> | ||
/// <reference types="next/image-types/global" /> | ||
/// <reference types="next/navigation-types/compat/navigation" /> | ||
|
||
// NOTE: This file should not be edited | ||
// see https://nextjs.org/docs/basic-features/typescript for more information. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,10 +31,10 @@ echo "Running integration tests on Node $NODE_VERSION" | |
# make a backup of our config file so we can restore it when we're done | ||
mv next.config.js next.config.js.bak | ||
|
||
for NEXTJS_VERSION in 10 11 12 13; do | ||
for NEXTJS_VERSION in 13; do | ||
for USE_APPDIR in true false; do | ||
if ([ "$NEXTJS_VERSION" -lt "13" ] || [ "$NODE_MAJOR" -lt "16" ]) && [ "$USE_APPDIR" == true ]; then | ||
# App dir doesn not work on Next.js < 13 or Node.js < 16 | ||
if ([ "$NODE_MAJOR" -lt "16" ]) && [ "$USE_APPDIR" == true ]; then | ||
# App dir doesn not work on Node.js < 16 | ||
AbhiPrasad marked this conversation as resolved.
Show resolved
Hide resolved
|
||
continue | ||
fi | ||
|
||
|
@@ -64,11 +64,6 @@ for NEXTJS_VERSION in 10 11 12 13; do | |
sed -i /"next.*latest"/s/latest/"${NEXTJS_VERSION}.x"/ package.json | ||
fi | ||
|
||
# Next.js v13 requires React 18.2.0 | ||
if [ "$NEXTJS_VERSION" -eq "13" ]; then | ||
npm i --save [email protected] [email protected] | ||
fi | ||
|
||
# Yarn install randomly started failing because it couldn't find some cache so for now we need to run these two commands which seem to fix it. | ||
# It was pretty much this issue: https://github.com/yarnpkg/yarn/issues/5275 | ||
rm -rf node_modules | ||
|
@@ -82,84 +77,45 @@ for NEXTJS_VERSION in 10 11 12 13; do | |
linkcli && linkplugin | ||
mv -f package.json.bak package.json 2>/dev/null || true | ||
|
||
SHOULD_RUN_WEBPACK_5=(true) | ||
# Only run Webpack 4 tests for Next 10 and Next 11 | ||
if [ "$NEXTJS_VERSION" -eq "10" ] || [ "$NEXTJS_VERSION" -eq "11" ]; then | ||
SHOULD_RUN_WEBPACK_5+=(false) | ||
fi | ||
|
||
for RUN_WEBPACK_5 in ${SHOULD_RUN_WEBPACK_5[*]}; do | ||
[ "$RUN_WEBPACK_5" == true ] && | ||
WEBPACK_VERSION=5 || | ||
WEBPACK_VERSION=4 | ||
|
||
if [ "$NODE_MAJOR" -gt "17" ]; then | ||
# Node v17+ does not work with NextJS 10 and 11 because of their legacy openssl use | ||
# Ref: https://github.com/vercel/next.js/issues/30078 | ||
if [ "$NEXTJS_VERSION" -lt "12" ]; then | ||
echo "[nextjs@$NEXTJS_VERSION Node $NODE_MAJOR not compatible with NextJS $NEXTJS_VERSION" | ||
# Continues the 2nd enclosing loop, which is the outer loop that iterates over the NextJS version | ||
continue 2 | ||
fi | ||
|
||
# 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 [ "$WEBPACK_VERSION" -eq "4" ]; then | ||
echo "[nextjs@$NEXTJS_VERSION | webpack@$WEBPACK_VERSION] Node $NODE_MAJOR not compatible with Webpack $WEBPACK_VERSION" | ||
# Continues the 1st enclosing loop, which is the inner loop that iterates over the Webpack version | ||
continue | ||
fi | ||
|
||
if [ "$NEXTJS_VERSION" -eq "13" ]; then | ||
if [ "$USE_APPDIR" == true ]; then | ||
cat next13.appdir.config.template > next.config.js | ||
else | ||
cat next13.config.template > next.config.js | ||
fi | ||
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 | ||
elif [ "$NEXTJS_VERSION" -eq "11" ]; then | ||
sed "s/%RUN_WEBPACK_5%/$RUN_WEBPACK_5/g" <next11.config.template >next.config.js | ||
elif [ "$NEXTJS_VERSION" -eq "12" ]; then | ||
sed "s/%RUN_WEBPACK_5%/$RUN_WEBPACK_5/g" <next12.config.template >next.config.js | ||
elif [ "$NEXTJS_VERSION" -eq "13" ]; then | ||
if [ "$USE_APPDIR" == true ]; then | ||
sed "s/%RUN_WEBPACK_5%/$RUN_WEBPACK_5/g" <next13.appdir.config.template >next.config.js | ||
else | ||
sed "s/%RUN_WEBPACK_5%/$RUN_WEBPACK_5/g" <next13.config.template >next.config.js | ||
fi | ||
fi | ||
echo "[nextjs@$NEXTJS_VERSION] Building..." | ||
yarn build | ||
|
||
echo "[nextjs@$NEXTJS_VERSION | webpack@$WEBPACK_VERSION] Building..." | ||
yarn build | ||
# we keep this updated as we run the tests, so that if it's ever non-zero, we can bail | ||
EXIT_CODE=0 | ||
|
||
# we keep this updated as we run the tests, so that if it's ever non-zero, we can bail | ||
EXIT_CODE=0 | ||
if [ "$USE_APPDIR" == true ]; then | ||
echo "Skipping server tests for appdir" | ||
else | ||
echo "[nextjs@$NEXTJS_VERSION] Running server tests with options: $args" | ||
(cd .. && yarn test:integration:server) || EXIT_CODE=$? | ||
fi | ||
|
||
if [ "$USE_APPDIR" == true ]; then | ||
echo "Skipping server tests for appdir" | ||
else | ||
echo "[nextjs@$NEXTJS_VERSION | webpack@$WEBPACK_VERSION] Running server tests with options: $args" | ||
(cd .. && yarn test:integration:server) || EXIT_CODE=$? | ||
fi | ||
if [ $EXIT_CODE -eq 0 ]; then | ||
echo "[nextjs@$NEXTJS_VERSION] Server integration tests passed" | ||
else | ||
echo "[nextjs@$NEXTJS_VERSION] Server integration tests failed" | ||
exit 1 | ||
fi | ||
|
||
if [ "$NODE_MAJOR" -lt "14" ]; then | ||
echo "[nextjs@$NEXTJS_VERSION] Skipping client tests on Node $NODE_MAJOR" | ||
else | ||
echo "[nextjs@$NEXTJS_VERSION] Running client tests with options: $args" | ||
(cd .. && yarn test:integration:client) || EXIT_CODE=$? | ||
if [ $EXIT_CODE -eq 0 ]; then | ||
echo "[nextjs@$NEXTJS_VERSION | webpack@$WEBPACK_VERSION] Server integration tests passed" | ||
echo "[nextjs@$NEXTJS_VERSION] Client integration tests passed" | ||
else | ||
echo "[nextjs@$NEXTJS_VERSION | webpack@$WEBPACK_VERSION] Server integration tests failed" | ||
echo "[nextjs@$NEXTJS_VERSION] Client integration tests failed" | ||
exit 1 | ||
fi | ||
|
||
if [ "$NODE_MAJOR" -lt "14" ]; then | ||
echo "[nextjs@$NEXTJS_VERSION | webpack@$WEBPACK_VERSION] Skipping client tests on Node $NODE_MAJOR" | ||
else | ||
echo "[nextjs@$NEXTJS_VERSION | webpack@$WEBPACK_VERSION] Running client tests with options: $args" | ||
(cd .. && yarn test:integration:client) || EXIT_CODE=$? | ||
if [ $EXIT_CODE -eq 0 ]; then | ||
echo "[nextjs@$NEXTJS_VERSION | webpack@$WEBPACK_VERSION] Client integration tests passed" | ||
else | ||
echo "[nextjs@$NEXTJS_VERSION | webpack@$WEBPACK_VERSION] Client integration tests failed" | ||
exit 1 | ||
fi | ||
fi | ||
done | ||
fi | ||
done | ||
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,6 @@ | |
"test": "ts-node test.ts" | ||
}, | ||
"dependencies": { | ||
"next": "12.3.1" | ||
"next": "13.2.0" | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO we should make this
14.1.3
for vercel/next.js#61194There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand how that would be useful. Can you elaborate? We still have to maintain anything pre 14.1.3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well if we make
14.1.3
the minimum forv14
, we don't have to maintain anything pre14.1.3
. It incentivizes people to use the framework version that works best for the SDK, but I can also see how it introduces friction.