Skip to content

Commit 14c9376

Browse files
timneutkenshuozhi
andauthored
BREAKING CHANGE: Remove React 17 (vercel#41629)
Next.js 13 will require React 18. In this PR I've only updated the peerDependency and removed the test runs in GH actions. Further cleanup will follow later, this allows us to remove the code supporting it later. ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md) Co-authored-by: Jiachi Liu <[email protected]>
1 parent 7102050 commit 14c9376

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+45
-517
lines changed

.github/workflows/build_test_deploy.yml

-288
Original file line numberDiff line numberDiff line change
@@ -316,82 +316,6 @@ jobs:
316316
path: |
317317
test/traces
318318
319-
testDevReact17:
320-
name: Test Development (react v17)
321-
runs-on: ubuntu-latest
322-
needs: [build, build-native-test]
323-
env:
324-
NEXT_TELEMETRY_DISABLED: 1
325-
NEXT_TEST_JOB: 1
326-
NEXT_TEST_REACT_VERSION: ^17
327-
strategy:
328-
fail-fast: false
329-
matrix:
330-
group: [1, 2]
331-
steps:
332-
- name: Setup node
333-
uses: actions/setup-node@v3
334-
if: ${{needs.build.outputs.docsChange == 'nope'}}
335-
with:
336-
node-version: 16
337-
check-latest: true
338-
339-
- run: echo ${{needs.build.outputs.docsChange}}
340-
341-
# https://github.com/actions/virtual-environments/issues/1187
342-
- name: tune linux network
343-
run: sudo ethtool -K eth0 tx off rx off
344-
345-
- uses: actions/cache@v3
346-
if: ${{needs.build.outputs.docsChange == 'nope'}}
347-
id: restore-build
348-
with:
349-
path: ./*
350-
key: ${{ github.sha }}-${{ github.run_number }}
351-
352-
- uses: actions/download-artifact@v3
353-
if: ${{needs.build.outputs.docsChange == 'nope'}}
354-
with:
355-
name: next-swc-test-binary
356-
path: packages/next-swc/native
357-
358-
- run: npm i -g pnpm@${PNPM_VERSION}
359-
if: ${{needs.build.outputs.docsChange == 'nope'}}
360-
361-
- run: npm i -g [email protected] && npx playwright install-deps
362-
timeout-minutes: 10
363-
if: ${{needs.build.outputs.docsChange == 'nope'}}
364-
365-
- run: npx @replayio/playwright install chromium
366-
if: ${{needs.build.outputs.docsChange == 'nope'}}
367-
368-
- run: node run-tests.js --type development --timings -g ${{ matrix.group }}/2
369-
name: Run test/development
370-
if: ${{needs.build.outputs.docsChange == 'nope'}}
371-
env:
372-
RECORD_REPLAY_METADATA_TEST_RUN_TITLE: testDevReact17 / Group ${{ matrix.group }}
373-
RECORD_ALL_CONTENT: 1
374-
RECORD_REPLAY: 1
375-
RECORD_REPLAY_TEST_METRICS: 1
376-
RECORD_REPLAY_WEBHOOK_URL: ${{ secrets.RECORD_REPLAY_WEBHOOK_URL }}
377-
378-
- uses: replayio/[email protected]
379-
if: always()
380-
with:
381-
api-key: rwk_iKsQnEoQwKd31WAJxgN9ARPFuAlyXlVrDH4uhYpRnti
382-
public: true
383-
filter: ${{ 'function($v) { $v.metadata.test.result = "failed" }' }}
384-
385-
- name: Upload test trace
386-
if: always()
387-
uses: actions/upload-artifact@v3
388-
with:
389-
name: test-trace
390-
if-no-files-found: ignore
391-
retention-days: 2
392-
path: |
393-
test/traces
394-
395319
testDevE2E:
396320
name: Test Development (E2E)
397321
runs-on: ubuntu-latest
@@ -471,84 +395,6 @@ jobs:
471395
path: |
472396
test/traces
473397
474-
testDevE2EReact17:
475-
name: Test Development (E2E) (react v17)
476-
runs-on: ubuntu-latest
477-
needs: [build, build-native-test]
478-
env:
479-
NEXT_TELEMETRY_DISABLED: 1
480-
NEXT_TEST_JOB: 1
481-
NEXT_TEST_REACT_VERSION: ^17
482-
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }}
483-
strategy:
484-
fail-fast: false
485-
matrix:
486-
group: [1, 2, 3]
487-
steps:
488-
- name: Setup node
489-
uses: actions/setup-node@v3
490-
if: ${{needs.build.outputs.docsChange == 'nope'}}
491-
with:
492-
node-version: 16
493-
check-latest: true
494-
495-
- run: echo ${{needs.build.outputs.docsChange}}
496-
497-
# https://github.com/actions/virtual-environments/issues/1187
498-
- name: tune linux network
499-
run: sudo ethtool -K eth0 tx off rx off
500-
501-
- uses: actions/cache@v3
502-
if: ${{needs.build.outputs.docsChange == 'nope'}}
503-
id: restore-build
504-
with:
505-
path: ./*
506-
key: ${{ github.sha }}-${{ github.run_number }}
507-
508-
- uses: actions/download-artifact@v3
509-
if: ${{needs.build.outputs.docsChange == 'nope'}}
510-
with:
511-
name: next-swc-test-binary
512-
path: packages/next-swc/native
513-
514-
- run: npm i -g pnpm@${PNPM_VERSION}
515-
if: ${{needs.build.outputs.docsChange == 'nope'}}
516-
517-
- run: npm i -g [email protected] && npx playwright install-deps
518-
timeout-minutes: 10
519-
if: ${{needs.build.outputs.docsChange == 'nope'}}
520-
521-
- run: npx @replayio/playwright install chromium
522-
if: ${{needs.build.outputs.docsChange == 'nope'}}
523-
524-
- run: node run-tests.js --type e2e --timings -g ${{ matrix.group }}/3
525-
name: Run test/e2e (dev)
526-
if: ${{needs.build.outputs.docsChange == 'nope'}}
527-
env:
528-
RECORD_REPLAY_METADATA_TEST_RUN_TITLE: testDevE2EReact17 / Group ${{ matrix.group }}
529-
RECORD_ALL_CONTENT: 1
530-
RECORD_REPLAY: 1
531-
NEXT_TEST_MODE: dev
532-
RECORD_REPLAY_TEST_METRICS: 1
533-
RECORD_REPLAY_WEBHOOK_URL: ${{ secrets.RECORD_REPLAY_WEBHOOK_URL }}
534-
535-
- uses: replayio/[email protected]
536-
if: always()
537-
with:
538-
api-key: rwk_iKsQnEoQwKd31WAJxgN9ARPFuAlyXlVrDH4uhYpRnti
539-
public: true
540-
filter: ${{ 'function($v) { $v.metadata.test.result = "failed" }' }}
541-
542-
- name: Upload test trace
543-
if: always()
544-
uses: actions/upload-artifact@v3
545-
with:
546-
name: test-trace
547-
if-no-files-found: ignore
548-
retention-days: 2
549-
path: |
550-
test/traces
551-
552398
testProd:
553399
name: Test Production
554400
runs-on: ubuntu-latest
@@ -616,72 +462,6 @@ jobs:
616462
public: true
617463
filter: ${{ 'function($v) { $v.metadata.test.result = "failed" }' }}
618464

619-
testProdReact17:
620-
name: Test Production (react v17)
621-
runs-on: ubuntu-latest
622-
needs: [build, build-native-test]
623-
env:
624-
NEXT_TELEMETRY_DISABLED: 1
625-
NEXT_TEST_JOB: 1
626-
NEXT_TEST_REACT_VERSION: ^17
627-
strategy:
628-
fail-fast: false
629-
matrix:
630-
group: [1, 2]
631-
steps:
632-
- name: Setup node
633-
uses: actions/setup-node@v3
634-
if: ${{needs.build.outputs.docsChange == 'nope'}}
635-
with:
636-
node-version: 16
637-
check-latest: true
638-
639-
- run: echo ${{needs.build.outputs.docsChange}}
640-
641-
# https://github.com/actions/virtual-environments/issues/1187
642-
- name: tune linux network
643-
run: sudo ethtool -K eth0 tx off rx off
644-
645-
- uses: actions/cache@v3
646-
if: ${{needs.build.outputs.docsChange == 'nope'}}
647-
id: restore-build
648-
with:
649-
path: ./*
650-
key: ${{ github.sha }}-${{ github.run_number }}
651-
652-
- uses: actions/download-artifact@v3
653-
if: ${{needs.build.outputs.docsChange == 'nope'}}
654-
with:
655-
name: next-swc-test-binary
656-
path: packages/next-swc/native
657-
658-
- run: npm i -g pnpm@${PNPM_VERSION}
659-
if: ${{needs.build.outputs.docsChange == 'nope'}}
660-
661-
- run: npm i -g [email protected] && npx playwright install-deps
662-
timeout-minutes: 10
663-
if: ${{needs.build.outputs.docsChange == 'nope'}}
664-
665-
- run: npx @replayio/playwright install chromium
666-
if: ${{needs.build.outputs.docsChange == 'nope'}}
667-
668-
- run: node run-tests.js --type production --timings -g ${{ matrix.group }}/2
669-
name: Run test/production
670-
if: ${{needs.build.outputs.docsChange == 'nope'}}
671-
env:
672-
RECORD_REPLAY_METADATA_TEST_RUN_TITLE: testProdReact17 / Group ${{ matrix.group }}
673-
RECORD_ALL_CONTENT: 1
674-
RECORD_REPLAY: 1
675-
RECORD_REPLAY_TEST_METRICS: 1
676-
RECORD_REPLAY_WEBHOOK_URL: ${{ secrets.RECORD_REPLAY_WEBHOOK_URL }}
677-
678-
- uses: replayio/[email protected]
679-
if: always()
680-
with:
681-
api-key: rwk_iKsQnEoQwKd31WAJxgN9ARPFuAlyXlVrDH4uhYpRnti
682-
public: true
683-
filter: ${{ 'function($v) { $v.metadata.test.result = "failed" }' }}
684-
685465
testProdE2E:
686466
name: Test Production (E2E)
687467
runs-on: ubuntu-latest
@@ -751,74 +531,6 @@ jobs:
751531
public: true
752532
filter: ${{ 'function($v) { $v.metadata.test.result = "failed" }' }}
753533

754-
testProdE2EReact17:
755-
name: Test Production (E2E) (react v17)
756-
runs-on: ubuntu-latest
757-
needs: [build, build-native-test]
758-
env:
759-
NEXT_TELEMETRY_DISABLED: 1
760-
NEXT_TEST_JOB: 1
761-
NEXT_TEST_REACT_VERSION: ^17
762-
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }}
763-
strategy:
764-
fail-fast: false
765-
matrix:
766-
group: [1, 2, 3]
767-
steps:
768-
- name: Setup node
769-
uses: actions/setup-node@v3
770-
if: ${{needs.build.outputs.docsChange == 'nope'}}
771-
with:
772-
node-version: ${{ matrix.node }}
773-
check-latest: true
774-
775-
- run: echo ${{needs.build.outputs.docsChange}}
776-
777-
# https://github.com/actions/virtual-environments/issues/1187
778-
- name: tune linux network
779-
run: sudo ethtool -K eth0 tx off rx off
780-
781-
- uses: actions/cache@v3
782-
if: ${{needs.build.outputs.docsChange == 'nope'}}
783-
id: restore-build
784-
with:
785-
path: ./*
786-
key: ${{ github.sha }}-${{ github.run_number }}
787-
788-
- uses: actions/download-artifact@v3
789-
if: ${{needs.build.outputs.docsChange == 'nope'}}
790-
with:
791-
name: next-swc-test-binary
792-
path: packages/next-swc/native
793-
794-
- run: npm i -g pnpm@${PNPM_VERSION}
795-
if: ${{needs.build.outputs.docsChange == 'nope'}}
796-
797-
- run: npm i -g [email protected] && npx playwright install-deps
798-
timeout-minutes: 10
799-
if: ${{needs.build.outputs.docsChange == 'nope'}}
800-
801-
- run: npx @replayio/playwright install chromium
802-
if: ${{needs.build.outputs.docsChange == 'nope'}}
803-
804-
- run: node run-tests.js --type e2e --timings -g ${{ matrix.group }}/3
805-
name: Run test/e2e (production)
806-
if: ${{needs.build.outputs.docsChange == 'nope'}}
807-
env:
808-
RECORD_REPLAY_METADATA_TEST_RUN_TITLE: testProdE2EReact17 / Group ${{ matrix.group }}
809-
RECORD_ALL_CONTENT: 1
810-
RECORD_REPLAY: 1
811-
NEXT_TEST_MODE: start
812-
RECORD_REPLAY_TEST_METRICS: 1
813-
RECORD_REPLAY_WEBHOOK_URL: ${{ secrets.RECORD_REPLAY_WEBHOOK_URL }}
814-
815-
- uses: replayio/[email protected]
816-
if: always()
817-
with:
818-
api-key: rwk_iKsQnEoQwKd31WAJxgN9ARPFuAlyXlVrDH4uhYpRnti
819-
public: true
820-
filter: ${{ 'function($v) { $v.metadata.test.result = "failed" }' }}
821-
822534
testIntegration:
823535
name: Test Integration
824536
runs-on: ubuntu-latest

bench/minimal-server/start.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
process.env.__NEXT_REACT_CHANNEL = 'exp'
21
process.env.NODE_ENV = 'production'
32

43
require('../../test/lib/react-channel-require-hook')

docs/upgrading.md

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ The [Supported Browsers](/docs/basic-features/supported-browsers-features.md) ha
1010

1111
The minimum Node.js version has been bumped from 12.22.0 to 14.0.0, since 12.x has reached end-of-life.
1212

13+
The minimum React version has been bumped from 17.0.2 to 18.2.0.
14+
1315
The `swcMinify` configuration property was changed from `false` to `true`. See [Next.js Compiler](/docs/advanced-features/compiler.md) for more info.
1416

1517
The `next/image` import was renamed to `next/legacy/image`. The `next/future/image` import was renamed to `next/image`.

examples/auth-with-stytch/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"@stytch/stytch-react": "^3.0.3",
1010
"next": "12.0.7",
1111
"next-iron-session": "^4.2.0",
12-
"react": "17.0.2",
13-
"react-dom": "17.0.2",
12+
"react": "18.2.0",
13+
"react-dom": "18.2.0",
1414
"stytch": "^3.6.1"
1515
},
1616
"devDependencies": {

examples/cms-drupal/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"date-fns": "2.28.0",
1111
"next": "latest",
1212
"next-drupal": "latest",
13-
"react": "17.0.2",
14-
"react-dom": "17.0.2"
13+
"react": "18.2.0",
14+
"react-dom": "18.2.0"
1515
},
1616
"devDependencies": {
1717
"autoprefixer": "10.4.2",

examples/cms-keystonejs-embedded/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"@keystone-next/fields": "^9.0.0",
1111
"@keystone-next/keystone": "^18.0.0",
1212
"next": "10.2.2",
13-
"react": "17.0.2",
14-
"react-dom": "17.0.2"
13+
"react": "18.2.0",
14+
"react-dom": "18.2.0"
1515
},
1616
"devDependencies": {
1717
"@types/react": "^17.0.6",

examples/with-eslint/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
},
99
"dependencies": {
1010
"next": "latest",
11-
"react": "^17.0.2",
12-
"react-dom": "^17.0.2"
11+
"react": "^18.2.0",
12+
"react-dom": "^18.2.0"
1313
},
1414
"devDependencies": {
1515
"eslint": "^7.24.0",

examples/with-formspree/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"dependencies": {
99
"@formspree/react": "latest",
1010
"next": "latest",
11-
"react": "17.0.2",
12-
"react-dom": "17.0.2"
11+
"react": "18.2.0",
12+
"react-dom": "18.2.0"
1313
}
1414
}

examples/with-jotai/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"dependencies": {
99
"jotai": "1.7.3",
1010
"next": "latest",
11-
"react": "17.0.2",
12-
"react-dom": "17.0.2"
11+
"react": "18.2.0",
12+
"react-dom": "18.2.0"
1313
},
1414
"devDependencies": {
1515
"@types/react": "17.0.16",

0 commit comments

Comments
 (0)