-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(nextjs): Add Next 13 to peer dependencies and integration tests #6042
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
3 commits
Select commit
Hold shift + click to select a range
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ 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; do | ||
for NEXTJS_VERSION in 10 11 12 13; do | ||
|
||
# export this to the env so that we can behave differently depending on which version of next we're testing, without | ||
# 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 | |
fi | ||
|
||
# Next.js v11 requires at least Node v12 | ||
if [ "$NODE_MAJOR" -lt "12" ] && [ "$NEXTJS_VERSION" -eq "11" ]; then | ||
echo "[nextjs$NEXTJS_VERSION] Not compatible with Node $NODE_MAJOR" | ||
if [ "$NODE_MAJOR" -lt "12" ] && [ "$NEXTJS_VERSION" -ge "11" ]; then | ||
echo "[nextjs@$NEXTJS_VERSION] Not compatible with Node $NODE_MAJOR" | ||
exit 0 | ||
fi | ||
|
||
# Next.js v13 requires at least Node v14 | ||
if [ "$NODE_MAJOR" -lt "14" ] && [ "$NEXTJS_VERSION" -ge "13" ]; then | ||
echo "[nextjs@$NEXTJS_VERSION] Not compatible with Node $NODE_MAJOR" | ||
exit 0 | ||
fi | ||
|
||
|
@@ -61,6 +67,11 @@ for NEXTJS_VERSION in 10 11 12; do | |
else | ||
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 | ||
# We have to use `--ignore-engines` because sucrase claims to need Node 12, even though tests pass just fine on Node | ||
# 10 | ||
yarn --no-lockfile --ignore-engines --silent >/dev/null 2>&1 | ||
|
@@ -84,11 +95,11 @@ for NEXTJS_VERSION in 10 11 12; do | |
# 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" | ||
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" | ||
echo "[nextjs@$NEXTJS_VERSION | webpack@$WEBPACK_VERSION] Node $NODE_MAJOR not compatible with Webpack $WEBPACK_VERSION" | ||
exit 0 | ||
fi | ||
|
||
|
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.
Should this maybe use
yarn
instead?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.
Actually, I tried running the full test suite with react 18.2.0 and it works fine, even for Next 10, so rather than doing it here, let's just change
package.json
and use that version for everything.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.
I figured that you want to make sure it also still works with older versions of react, hence the package update. If you think that's not necessary I'll update the default version to 18.
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 let's stick with the older versions, especially to get this in so we can release. We can re-evaluate bumping the overall version later on.