Skip to content

Commit

Permalink
Add support for React 19 (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
carbonrobot authored Nov 5, 2024
1 parent 0991197 commit b7cf762
Show file tree
Hide file tree
Showing 7 changed files with 668 additions and 8 deletions.
7 changes: 7 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"access": "restricted",
"baseBranch": "master",
"updateInternalDependencies": "patch"
}
5 changes: 5 additions & 0 deletions .changeset/fifty-items-breathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'react-ssr-prepass': minor
---

Support for React 19
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CI

on:
pull_request:
branches:
- master

jobs:
check_and_build:
name: Check and build codebase
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: 'yarn'
node-version: 18

- name: Installation
run: yarn --frozen-lockfile

- name: Build
run: yarn build

- name: Unit Tests
run: yarn test
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release
on:
push:
branches:
- main
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
issues: write
repository-projects: write
deployments: write
packages: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.CHANGESETS_TOKEN }}

- uses: actions/setup-node@v4
with:
cache: 'yarn'
node-version: 18

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build
run: yarn build

- name: Unit Tests
run: yarn test

- name: PR or Publish
id: changesets
uses: changesets/action@v1
with:
version: yarn changeset version
publish: yarn changeset publish
env:
GITHUB_TOKEN: ${{ secrets.CHANGESETS_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
}
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc"
},
"devDependencies": {
"@babel/core": "^7.16.7",
Expand All @@ -58,6 +58,7 @@
"@babel/preset-env": "^7.16.7",
"@babel/preset-flow": "^7.16.7",
"@babel/preset-react": "^7.16.7",
"@changesets/cli": "^2.27.9",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-buble": "^0.21.3",
"@rollup/plugin-commonjs": "^21.0.1",
Expand Down
6 changes: 3 additions & 3 deletions src/visitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ import {
REACT_LAZY_TYPE
} from './symbols'

const {
ReactCurrentDispatcher
} = (React: any).__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
const { ReactCurrentDispatcher } =
(React: any).__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED ||
(React: any).__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE

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

0 comments on commit b7cf762

Please sign in to comment.