Skip to content

Commit

Permalink
enhance: Use React 19 rc1
Browse files Browse the repository at this point in the history
  • Loading branch information
ntucker committed Nov 24, 2024
1 parent 99cd041 commit 1caf44a
Show file tree
Hide file tree
Showing 32 changed files with 623 additions and 1,128 deletions.
8 changes: 8 additions & 0 deletions .changeset/great-bats-warn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@data-client/use-enhanced-reducer': patch
'@data-client/react': patch
'@data-client/test': patch
'@data-client/ssr': patch
---

Improve compatibility with React 19
28 changes: 18 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,26 +85,30 @@ jobs:
at: ~/
- run:
command: |
if [ "<< parameters.react-version >>" != "^18" ]; then
if [ "<< parameters.react-version >>" == "^17.0.0" ]; then
YARN_ENABLE_GLOBAL_CACHE=false yarn remove @react-navigation/native @react-navigation/native-stack react-native-screens
YARN_ENABLE_GLOBAL_CACHE=false yarn workspace @data-client/react remove @react-navigation/native
YARN_ENABLE_GLOBAL_CACHE=false yarn add --dev react@<< parameters.react-version >> react-dom@<< parameters.react-version >> react-test-renderer@<< parameters.react-version >> @testing-library/react@^12.0.0 @testing-library/react-hooks @react-navigation/native@^6.0.0 @react-navigation/native-stack@^6.0.0 react-native-screens@^3.0.0
YARN_ENABLE_GLOBAL_CACHE=false yarn workspace @data-client/react add @react-navigation/native@^6.0.0
YARN_ENABLE_GLOBAL_CACHE=false yarn workspace @data-client/test add @testing-library/react@^12.0.0
elif [ "<< parameters.react-version >>" == "^18" ]; then
YARN_ENABLE_GLOBAL_CACHE=false yarn add --dev react@<< parameters.react-version >> react-dom@<< parameters.react-version >> react-test-renderer@<< parameters.react-version >>
fi
- run:
command: |
if [ "<< parameters.react-version >>" == "^17.0.0" ]; then
yarn test:ci --maxWorkers=3 --selectProjects ReactDOM ReactNative --testPathPattern packages/react packages/use-enhanced-reducer packages/img
elif [ "<< parameters.react-version >>" == "^18" ]; then
curl -Os https://uploader.codecov.io/latest/linux/codecov;
chmod +x codecov;
yarn run test:coverage --ci --maxWorkers=4 --coverageReporters=text-lcov > ./lcov.info;
yarn run test:coverage --ci --maxWorkers=3 --coverageReporters=text-lcov > ./lcov.info;
if [ "$CODECOV_TOKEN" != "" ]; then
./codecov -t ${CODECOV_TOKEN} < ./lcov.info || true;
else
./codecov < ./lcov.info || true;
fi
else
yarn test:ci --maxWorkers=3 --selectProjects ReactDOM ReactNative
yarn test:ci --maxWorkers=4 --selectProjects Node ReactDOM --testPathPattern packages/react packages/use-enhanced-reducer packages/img
fi
node_matrix:
Expand Down Expand Up @@ -146,21 +150,25 @@ jobs:
- run:
command: |
if [ "<< parameters.typescript-version >>" != "latest" ]; then
YARN_ENABLE_GLOBAL_CACHE=false yarn add --dev typescript@<< parameters.typescript-version >>
YARN_ENABLE_GLOBAL_CACHE=false yarn add --dev typescript@~<< parameters.typescript-version >>
fi
if [ "<< parameters.typescript-version >>" == "~4.0" ]; then
YARN_ENABLE_GLOBAL_CACHE=false yarn workspaces foreach -Rt --from github-app --from todo-app add -DE @types/[email protected]
if [[ "<< parameters.typescript-version >>" == "4.0" || \
"<< parameters.typescript-version >>" == "4.1" || \
"<< parameters.typescript-version >>" == "4.3" ]]; then
sed -i '/"@types\/react":/d' package.json
sed -i '/"@types\/react-dom":/d' package.json
YARN_ENABLE_GLOBAL_CACHE=false yarn workspaces foreach -Rt --from github-app --from todo-app add -DE @types/react@ts<< parameters.typescript-version >>
fi
- run:
name: typecheck
command: |
if [ "<< parameters.typescript-version >>" == "latest" ] || [ "<< parameters.typescript-version >>" == "~5.3" ] || [ "<< parameters.typescript-version >>" == "~4.8" ]; then
if [ "<< parameters.typescript-version >>" == "latest" ] || [ "<< parameters.typescript-version >>" == "5.3" ] || [ "<< parameters.typescript-version >>" == "4.8" ]; then
yarn run tsc --project examples/todo-app/tsconfig.json
yarn run tsc --project examples/github-app/tsconfig.json
fi
yarn run tsc --project examples/todo-app/tsconfig.typetest.json
yarn run tsc --project examples/github-app/tsconfig.typetest.json
if [ "<< parameters.typescript-version >>" != "~4.0" ]; then
if [ "<< parameters.typescript-version >>" != "4.0" ]; then
yarn run tsc --project examples/todo-app/tsconfig.typetest41.json
fi
Expand Down Expand Up @@ -208,7 +216,7 @@ workflows:
- unit_tests:
matrix:
parameters:
react-version: ["^17.0.0", "^18"]
react-version: ["^17.0.0", "^18", "latest"]
requires:
- setup
- node_matrix:
Expand Down Expand Up @@ -237,7 +245,7 @@ workflows:
# 4.1 is min version for rest package working well
# 4.3
# 4.7 (but its broken so we do 4.8) lets you apply a generic type to a function type to see its return value
typescript-version: ["~4.0", "~4.1", "~4.3", "~4.8", "~5.3", "latest"]
typescript-version: ["4.0", "4.1", "4.3", "4.8", "5.3", "latest"]
requires:
- setup
- esmodule-loosenulltypes:
Expand Down
4 changes: 2 additions & 2 deletions examples/benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
"@data-client/normalizr": "workspace:^",
"benchmark": "^2.1.4",
"normalizr": "^3.6.2",
"react": "^18.2.0"
"react": "^19.0.0-rc.1"
},
"devDependencies": {
"@anansi/webpack-config": "^20.0.0",
"@babel/core": "7.26.0",
"@babel/node": "7.26.0",
"@types/babel__core": "^7",
"@types/benchmark": "2.1.5",
"@types/react": "18.3.12",
"@types/react": "npm:[email protected]",
"webpack": "^5.76.2",
"webpack-cli": "^5.1.4"
}
Expand Down
4 changes: 2 additions & 2 deletions examples/coin-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
"@data-client/rest": "^0.14.0",
"d3": "^7.9.0",
"history": "*",
"react": "^18.3.0",
"react-dom": "^18.3.0"
"react": "^19.0.0-rc.1",
"react-dom": "^19.0.0-rc.1"
},
"main": "src/index.ts",
"types": "src/index.ts",
Expand Down
140 changes: 25 additions & 115 deletions examples/github-app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions examples/github-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"@linaria/shaker": "5.0.3",
"@types/lodash": "4.14.192",
"@types/parse-link-header": "^2.0.0",
"@types/react": "18.3.12",
"@types/react-dom": "18.3.1",
"@types/react": "npm:[email protected]",
"@types/react-dom": "npm:[email protected]",
"@types/uuid": "^10.0.0",
"react-refresh": "0.14.2",
"serve": "14.2.4",
Expand All @@ -53,8 +53,8 @@
"@js-temporal/polyfill": "^0.4.4",
"antd": "5.22.1",
"parse-link-header": "^2.0.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react": "^19.0.0-rc.1",
"react-dom": "^19.0.0-rc.1",
"react-error-boundary": "^4.0.0",
"react-markdown": "9.0.1",
"rehype-highlight": "7.0.1",
Expand Down
Loading

0 comments on commit 1caf44a

Please sign in to comment.