Skip to content

Commit b7cf762

Browse files
authored
Add support for React 19 (#92)
1 parent 0991197 commit b7cf762

File tree

7 files changed

+668
-8
lines changed

7 files changed

+668
-8
lines changed

.changeset/config.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"access": "restricted",
5+
"baseBranch": "master",
6+
"updateInternalDependencies": "patch"
7+
}

.changeset/fifty-items-breathe.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'react-ssr-prepass': minor
3+
---
4+
5+
Support for React 19

.github/workflows/ci.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
8+
jobs:
9+
check_and_build:
10+
name: Check and build codebase
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-node@v4
15+
with:
16+
cache: 'yarn'
17+
node-version: 18
18+
19+
- name: Installation
20+
run: yarn --frozen-lockfile
21+
22+
- name: Build
23+
run: yarn build
24+
25+
- name: Unit Tests
26+
run: yarn test

.github/workflows/release.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- main
6+
jobs:
7+
release:
8+
name: Release
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write
12+
id-token: write
13+
issues: write
14+
repository-projects: write
15+
deployments: write
16+
packages: write
17+
pull-requests: write
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
token: ${{ secrets.CHANGESETS_TOKEN }}
22+
23+
- uses: actions/setup-node@v4
24+
with:
25+
cache: 'yarn'
26+
node-version: 18
27+
28+
- name: Install dependencies
29+
run: yarn install --frozen-lockfile
30+
31+
- name: Build
32+
run: yarn build
33+
34+
- name: Unit Tests
35+
run: yarn test
36+
37+
- name: PR or Publish
38+
id: changesets
39+
uses: changesets/action@v1
40+
with:
41+
version: yarn changeset version
42+
publish: yarn changeset publish
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.CHANGESETS_TOKEN }}
45+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
}
5050
},
5151
"peerDependencies": {
52-
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
52+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
5353
},
5454
"devDependencies": {
5555
"@babel/core": "^7.16.7",
@@ -58,6 +58,7 @@
5858
"@babel/preset-env": "^7.16.7",
5959
"@babel/preset-flow": "^7.16.7",
6060
"@babel/preset-react": "^7.16.7",
61+
"@changesets/cli": "^2.27.9",
6162
"@rollup/plugin-babel": "^5.3.0",
6263
"@rollup/plugin-buble": "^0.21.3",
6364
"@rollup/plugin-commonjs": "^21.0.1",

src/visitor.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ import {
7171
REACT_LAZY_TYPE
7272
} from './symbols'
7373

74-
const {
75-
ReactCurrentDispatcher
76-
} = (React: any).__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
74+
const { ReactCurrentDispatcher } =
75+
(React: any).__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED ||
76+
(React: any).__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE
7777

7878
// In the presence of setImmediate, i.e. on Node, we'll enable the
7979
// yielding behavior that gives the event loop a chance to continue

0 commit comments

Comments
 (0)