Skip to content

Commit

Permalink
feat: support react 19 (#170)
Browse files Browse the repository at this point in the history
* feat: support react 19

* chore: fix failing tests
  • Loading branch information
stipsan authored May 28, 2024
1 parent e7b658c commit 4d3cce4
Show file tree
Hide file tree
Showing 5 changed files with 121 additions and 11 deletions.
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@portabletext/react",
"version": "3.0.18",
"version": "3.1.0-canary.0",
"description": "Render Portable Text with React",
"keywords": [
"portable-text"
Expand Down Expand Up @@ -35,14 +35,12 @@
"src"
],
"scripts": {
"build": "run-s clean pkg:build pkg:check",
"build": "pkg-utils build --strict --check --clean",
"build:demo": "vite build demo --config=./vite.config.demo.ts --base=/react-portabletext/",
"clean": "rimraf dist coverage demo/dist .nyc_output",
"dev": "vite demo",
"format": "prettier --write --cache --ignore-unknown .",
"lint": "eslint .",
"pkg:build": "pkg-utils build --strict",
"pkg:check": "pkg-utils --strict",
"prepare": "husky install",
"prepublishOnly": "run-s build lint type-check",
"start": "vite demo",
Expand Down Expand Up @@ -77,14 +75,16 @@
"ecmaVersion": 9,
"sourceType": "module"
},
"plugins": ["react-compiler"],
"extends": [
"sanity",
"sanity/react",
"sanity/typescript",
"prettier"
],
"rules": {
"react/prop-types": "off"
"react/prop-types": "off",
"react-compiler/react-compiler": "error"
},
"ignorePatterns": [
"dist/**/"
Expand Down Expand Up @@ -116,6 +116,7 @@
"eslint-config-prettier": "^9.1.0",
"eslint-config-sanity": "^7.1.2",
"eslint-plugin-react": "^7.34.2",
"eslint-plugin-react-compiler": "0.0.0-experimental-c8b3f72-20240517",
"eslint-plugin-react-hooks": "^4.6.2",
"husky": "^8.0.3",
"leaflet": "^1.9.4",
Expand All @@ -136,7 +137,7 @@
"vitest": "^1.6.0"
},
"peerDependencies": {
"react": "^17 || ^18"
"react": "^17 || ^18 || >=19.0.0-rc"
},
"packageManager": "pnpm@9.1.3",
"engines": {
Expand Down
110 changes: 110 additions & 0 deletions pnpm-lock.yaml

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

1 change: 1 addition & 0 deletions tsconfig.dist.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"rootDir": ".",
"outDir": "./dist",

"jsx": "preserve",
"lib": ["ES2016", "DOM"],
"noUncheckedIndexedAccess": true,
"forceConsistentCasingInFileNames": true
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"rootDir": ".",
"outDir": "./dist",

"jsx": "react-jsx",
"lib": ["ES2016", "DOM"],
"noUncheckedIndexedAccess": true,
"forceConsistentCasingInFileNames": true,
Expand Down
7 changes: 2 additions & 5 deletions tsconfig.settings.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"compilerOptions": {
"module": "ES2020",
"module": "Preserve",
"target": "ES2020",
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"jsx": "react-jsx",

// Strict type-checking
"strict": true,
Expand All @@ -24,8 +23,6 @@
"skipLibCheck": true,

// Module resolution
"moduleResolution": "node",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true
"allowSyntheticDefaultImports": true
}
}

0 comments on commit 4d3cce4

Please sign in to comment.