-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[v5] breaking: make React 18 as minimal requirement #2236
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
Changes from 3 commits
781df93
4f17d4e
0a83fab
394b7a6
b4742b7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -12,8 +12,8 @@ jobs: | |||||
| strategy: | ||||||
| fail-fast: false | ||||||
| matrix: | ||||||
| build: [cjs, umd] # [cjs, esm, umd, system] | ||||||
| env: [development, production] | ||||||
| build: [cjs, esm, umd] # [cjs, esm, umd, system] | ||||||
| env: [development] # [development, production] | ||||||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dai-shi, I copied this change from https://github.com/pmndrs/valtio/pull/819/files, but looking at this, could it be a mistake? I'd like to test both
Suggested change
|
||||||
| devtools-skip: | ||||||
| - CI-MATRIX-NOSKIP | ||||||
| include: | ||||||
|
|
@@ -39,10 +39,6 @@ jobs: | |||||
| - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* | ||||||
| - run: yarn install --frozen-lockfile --check-files | ||||||
| - run: yarn build | ||||||
| - name: Use React 17 for production test | ||||||
| if: ${{ matrix.env == 'production' }} | ||||||
| run: | | ||||||
| yarn add -D [email protected] [email protected] @testing-library/[email protected] | ||||||
| - name: Patch for DEV-ONLY | ||||||
| if: ${{ matrix.env == 'development' }} | ||||||
| run: | | ||||||
|
|
@@ -60,7 +56,7 @@ jobs: | |||||
| - name: Patch for ESM | ||||||
| if: ${{ matrix.build == 'esm' }} | ||||||
| run: | | ||||||
| sed -i~ "s/<rootDir>\/src\(.*\)\.ts/<rootDir>\/dist\/esm\1.js" package.json | ||||||
| sed -i~ "s/<rootDir>\/src\(.*\)\.ts/<rootDir>\/dist\/esm\1.js/" package.json | ||||||
charkour marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| sed -i~ "1s/^/import.meta.env=import.meta.env||{};import.meta.env.MODE='${NODE_ENV}';/" tests/*.tsx | ||||||
| env: | ||||||
| NODE_ENV: ${{ matrix.env }} | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,8 +28,6 @@ jobs: | |
| fail-fast: false | ||
| matrix: | ||
| react: | ||
| - 16.8.0 | ||
| - 17.0.0 | ||
| - 18.0.0 | ||
| - 18.1.0 | ||
| - 18.2.0 | ||
|
|
@@ -39,18 +37,18 @@ jobs: | |
| - CI-MATRIX-NOSKIP | ||
| include: | ||
| - devtools-skip: CI-MATRIX-[2345] | ||
| react: 16.8.0 | ||
| react: 18.0.0 | ||
charkour marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - devtools-skip: CI-MATRIX-[1345] | ||
| react: 16.8.0 | ||
| react: 18.0.0 | ||
| - devtools-skip: CI-MATRIX-[1245] | ||
| react: 16.8.0 | ||
| react: 18.0.0 | ||
| - devtools-skip: CI-MATRIX-[1235] | ||
| react: 16.8.0 | ||
| react: 18.0.0 | ||
| - devtools-skip: CI-MATRIX-[1234] | ||
| react: 16.8.0 | ||
| react: 18.0.0 | ||
| exclude: | ||
| - devtools-skip: CI-MATRIX-NOSKIP | ||
| react: 16.8.0 | ||
| react: 18.0.0 | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - uses: actions/setup-node@v2 | ||
|
|
@@ -59,18 +57,6 @@ jobs: | |
| cache: yarn | ||
| - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* | ||
| - run: yarn install --frozen-lockfile --check-files | ||
| - name: Install legacy testing-library | ||
| if: ${{ startsWith(matrix.react, '16.') || startsWith(matrix.react, '17.') }} | ||
| run: yarn add -D @testing-library/[email protected] | ||
| - name: Patch for React 16 | ||
| if: ${{ startsWith(matrix.react, '16.') }} | ||
| run: | | ||
| sed -i~ '1s/^/import React from "react";/' tests/*.tsx | ||
| sed -i~ 's/"jsx": "react-jsx"/"jsx": "react"/' tsconfig.json | ||
| sed -i~ 's/import\.meta\.env[?]\.MODE/"DEVELOPMENT".toLowerCase()/' src/*.ts src/*/*.ts | ||
| sed -i~ "s/it('\[${DEVTOOLS_SKIP}\]/it.skip('/" tests/devtools.test.tsx | ||
| env: | ||
| DEVTOOLS_SKIP: ${{ matrix.devtools-skip }} | ||
|
Comment on lines
-72
to
-73
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we are removing this, we can remove Find also
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I made that change to the best of my ability. I would appreciate a review of these changes because I'm not very familiar with the previous hacks in the CI although I understand why they were needed. |
||
| - name: Test ${{ matrix.react }} ${{ matrix.devtools-skip }} | ||
| run: | | ||
| yarn add -D react@${{ matrix.react }} react-dom@${{ matrix.react }} | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.