-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[v5] breaking: make React 18 as minimal requirement (#2236)
* fix: update package.json to require react 18+ * chore: update github actions to test on react 18+ * chore: remove devtools-skip hack from actions * chore(test): remove CI-SKIP from devtools tests
- Loading branch information
Showing
5 changed files
with
391 additions
and
450 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -12,24 +12,8 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
build: [cjs, umd] # [cjs, esm, umd, system] | ||
env: [development, production] | ||
devtools-skip: | ||
- CI-MATRIX-NOSKIP | ||
include: | ||
- devtools-skip: CI-MATRIX-[2345] | ||
build: umd | ||
- devtools-skip: CI-MATRIX-[1345] | ||
build: umd | ||
- devtools-skip: CI-MATRIX-[1245] | ||
build: umd | ||
- devtools-skip: CI-MATRIX-[1235] | ||
build: umd | ||
- devtools-skip: CI-MATRIX-[1234] | ||
build: umd | ||
exclude: | ||
- devtools-skip: CI-MATRIX-NOSKIP | ||
build: umd | ||
build: [cjs, esm, umd] # [cjs, esm, umd, system] | ||
env: [development] # [development, production] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
|
@@ -39,10 +23,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,24 +40,18 @@ 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 | ||
sed -i~ "1s/^/import.meta.env=import.meta.env||{};import.meta.env.MODE='${NODE_ENV}';/" tests/*.tsx | ||
env: | ||
NODE_ENV: ${{ matrix.env }} | ||
- name: Patch for UMD (DEV) | ||
if: ${{ matrix.build == 'umd' && matrix.env == 'development' }} | ||
run: | | ||
sed -i~ "s/<rootDir>\/src\(.*\)\.ts/<rootDir>\/dist\/umd\1.development.js/" package.json | ||
sed -i~ "s/it('\[${DEVTOOLS_SKIP}\]/it.skip('/" tests/devtools.test.tsx | ||
env: | ||
DEVTOOLS_SKIP: ${{ matrix.devtools-skip }} | ||
- name: Patch for UMD (PRD) | ||
if: ${{ matrix.build == 'umd' && matrix.env == 'production' }} | ||
run: | | ||
sed -i~ "s/<rootDir>\/src\(.*\)\.ts/<rootDir>\/dist\/umd\1.production.js/" package.json | ||
sed -i~ "s/it('\[${DEVTOOLS_SKIP}\]/it.skip('/" tests/devtools.test.tsx | ||
env: | ||
DEVTOOLS_SKIP: ${{ matrix.devtools-skip }} | ||
- name: Patch for SystemJS | ||
if: ${{ matrix.build == 'system' }} | ||
run: | | ||
|
This file contains 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 |
---|---|---|
|
@@ -28,29 +28,11 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
react: | ||
- 16.8.0 | ||
- 17.0.0 | ||
- 18.0.0 | ||
- 18.1.0 | ||
- 18.2.0 | ||
- 18.3.0-canary-6c7b41da3-20231123 | ||
- 0.0.0-experimental-6c7b41da3-20231123 | ||
devtools-skip: | ||
- CI-MATRIX-NOSKIP | ||
include: | ||
- devtools-skip: CI-MATRIX-[2345] | ||
react: 16.8.0 | ||
- devtools-skip: CI-MATRIX-[1345] | ||
react: 16.8.0 | ||
- devtools-skip: CI-MATRIX-[1245] | ||
react: 16.8.0 | ||
- devtools-skip: CI-MATRIX-[1235] | ||
react: 16.8.0 | ||
- devtools-skip: CI-MATRIX-[1234] | ||
react: 16.8.0 | ||
exclude: | ||
- devtools-skip: CI-MATRIX-NOSKIP | ||
react: 16.8.0 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
|
@@ -59,19 +41,7 @@ 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 }} | ||
- name: Test ${{ matrix.react }} ${{ matrix.devtools-skip }} | ||
- name: Test ${{ matrix.react }} | ||
run: | | ||
yarn add -D react@${{ matrix.react }} react-dom@${{ matrix.react }} | ||
yarn test:ci |
This file contains 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 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.