Skip to content

Commit

Permalink
chore: update for React 19 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
jikkai committed Dec 19, 2024
1 parent 769e636 commit 287f12e
Show file tree
Hide file tree
Showing 30 changed files with 753 additions and 289 deletions.
10 changes: 0 additions & 10 deletions common/shared/vite/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,6 @@
*/

export const peerDepsMap = {
react: {
global: 'React',
name: 'react',
version: '^16.9.0 || ^17.0.0 || ^18.0.0',
},
'react-dom': {
global: 'ReactDOM',
name: 'react-dom',
version: '^16.9.0 || ^17.0.0 || ^18.0.0',
},
rxjs: {
global: 'rxjs',
name: 'rxjs',
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"url": "https://github.com/dream-num/univer/issues"
},
"engines": {
"node": ">=18.0.0",
"pnpm": ">=8.5.0 || >=9.0.0"
"node": ">=18 || <=22",
"pnpm": ">=9"
},
"scripts": {
"prepare": "husky install",
Expand Down
4 changes: 2 additions & 2 deletions packages/design/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@
"@univerjs/core": "workspace:*",
"less": "^4.2.1",
"postcss": "^8.4.49",
"react": "18.3.1",
"react-dom": "18.3.1",
"react": "workspace:./tools/src/react",
"react-dom": "workspace:./tools/src/react-dom",
"tailwindcss": "^3.4.16",
"typescript": "^5.7.2",
"vite": "^6.0.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/docs-drawing-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"@univerjs-infra/shared": "workspace:*",
"less": "^4.2.1",
"postcss": "^8.4.49",
"react": "18.3.1",
"react": "workspace:./tools/src/react",
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.16",
"typescript": "^5.7.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/docs-hyper-link-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"devDependencies": {
"@univerjs-infra/shared": "workspace:*",
"postcss": "^8.4.49",
"react": "18.3.1",
"react": "workspace:./tools/src/react",
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.16",
"typescript": "^5.7.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/docs-mention-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"@univerjs-infra/shared": "workspace:*",
"less": "^4.2.1",
"postcss": "^8.4.49",
"react": "18.3.1",
"react": "workspace:./tools/src/react",
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.16",
"typescript": "^5.7.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/docs-thread-comment-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"devDependencies": {
"@univerjs-infra/shared": "workspace:*",
"postcss": "^8.4.49",
"react": "18.3.1",
"react": "workspace:./tools/src/react",
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.16",
"typescript": "^5.7.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/docs-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"@univerjs/docs-drawing": "workspace:*",
"less": "^4.2.1",
"postcss": "^8.4.49",
"react": "18.3.1",
"react": "workspace:./tools/src/react",
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.16",
"typescript": "^5.7.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/drawing-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"@univerjs-infra/shared": "workspace:*",
"less": "^4.2.1",
"postcss": "^8.4.49",
"react": "18.3.1",
"react": "workspace:./tools/src/react",
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.16",
"typescript": "^5.7.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/find-replace/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"@univerjs-infra/shared": "workspace:*",
"less": "^4.2.1",
"postcss": "^8.4.49",
"react": "18.3.1",
"react": "workspace:./tools/src/react",
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.16",
"typescript": "^5.7.2",
Expand Down
4 changes: 1 addition & 3 deletions packages/sheets-conditional-formatting-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@
"build": "univer-cli build"
},
"peerDependencies": {
"react": "^16.9.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.9.0 || ^17.0.0 || ^18.0.0",
"rxjs": ">=7.0.0"
},
"dependencies": {
Expand All @@ -88,7 +86,7 @@
"@univerjs-infra/shared": "workspace:*",
"less": "^4.2.1",
"postcss": "^8.4.49",
"react": "18.3.1",
"react": "workspace:./tools/src/react",
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.16",
"typescript": "^5.7.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/sheets-crosshair-highlight/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"@univerjs-infra/shared": "workspace:*",
"less": "^4.2.1",
"postcss": "^8.4.49",
"react": "18.3.1",
"react": "workspace:./tools/src/react",
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.16",
"typescript": "^5.7.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/sheets-data-validation-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"@univerjs-infra/shared": "workspace:*",
"less": "^4.2.1",
"postcss": "^8.4.49",
"react": "18.3.1",
"react": "workspace:./tools/src/react",
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.16",
"typescript": "^5.7.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/sheets-drawing-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"@univerjs-infra/shared": "workspace:*",
"less": "^4.2.1",
"postcss": "^8.4.49",
"react": "18.3.1",
"react": "workspace:./tools/src/react",
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.16",
"typescript": "^5.7.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/sheets-filter-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"@univerjs-infra/shared": "workspace:*",
"less": "^4.2.1",
"postcss": "^8.4.49",
"react": "18.3.1",
"react": "workspace:./tools/src/react",
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.16",
"typescript": "^5.7.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/sheets-formula-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"@univerjs-infra/shared": "workspace:*",
"less": "^4.2.1",
"postcss": "^8.4.49",
"react": "18.3.1",
"react": "workspace:./tools/src/react",
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.16",
"typescript": "^5.7.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/sheets-hyper-link-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
"build": "univer-cli build"
},
"peerDependencies": {
"react": "^16.9.0 || ^17.0.0 || ^18.0.0",
"rxjs": ">=7.0.0"
},
"dependencies": {
Expand All @@ -91,8 +90,9 @@
},
"devDependencies": {
"@univerjs-infra/shared": "workspace:*",
"less": "^4.2.1",
"postcss": "^8.4.49",
"react": "18.3.1",
"react": "workspace:./tools/src/react",
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.16",
"typescript": "^5.7.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/sheets-numfmt-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"@univerjs/engine-formula": "workspace:*",
"less": "^4.2.1",
"postcss": "^8.4.49",
"react": "18.3.1",
"react": "workspace:./tools/src/react",
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.16",
"typescript": "^5.7.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/sheets-sort-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"@univerjs-infra/shared": "workspace:*",
"less": "^4.2.1",
"postcss": "^8.4.49",
"react": "18.3.1",
"react": "workspace:./tools/src/react",
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.16",
"typescript": "^5.7.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/sheets-thread-comment-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"devDependencies": {
"@univerjs-infra/shared": "workspace:*",
"postcss": "^8.4.49",
"react": "18.3.1",
"react": "workspace:./tools/src/react",
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.16",
"typescript": "^5.7.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/sheets-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"@univerjs-infra/shared": "workspace:*",
"less": "^4.2.1",
"postcss": "^8.4.49",
"react": "18.3.1",
"react": "workspace:./tools/src/react",
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.16",
"typescript": "^5.7.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/sheets-zen-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"@univerjs-infra/shared": "workspace:*",
"less": "^4.2.1",
"postcss": "^8.4.49",
"react": "18.3.1",
"react": "workspace:./tools/src/react",
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.16",
"typescript": "^5.7.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/slides-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"@univerjs-infra/shared": "workspace:*",
"less": "^4.2.1",
"postcss": "^8.4.49",
"react": "18.3.1",
"react": "workspace:./tools/src/react",
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.16",
"typescript": "^5.7.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/thread-comment-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"@univerjs-infra/shared": "workspace:*",
"less": "^4.2.1",
"postcss": "^8.4.49",
"react": "18.3.1",
"react": "workspace:./tools/src/react",
"rxjs": "^7.8.1",
"tailwindcss": "^3.4.16",
"typescript": "^5.7.2",
Expand Down
91 changes: 91 additions & 0 deletions packages/tools/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{
"name": "@univerjs/tools",
"version": "0.5.1",
"private": false,
"description": "UI component library for building exceptional Univer.",
"author": "DreamNum <[email protected]>",
"license": "Apache-2.0",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/univer"
},
"homepage": "https://univer.ai",
"repository": {
"type": "git",
"url": "https://github.com/dream-num/univer"
},
"bugs": {
"url": "https://github.com/dream-num/univer/issues"
},
"keywords": [
"univer"
],
"exports": {
"./*": "./src/*",
"./react": "./src/react/index.ts",
"./react-dom": "./src/react-dom/index.ts",
"./react-dom/client": "./src/react-dom/client.ts"
},
"main": "./src/index.ts",
"types": "./lib/types/index.d.ts",
"publishConfig": {
"access": "public",
"main": "./lib/es/index.js",
"module": "./lib/es/index.js",
"exports": {
".": {
"import": "./lib/es/index.js",
"require": "./lib/cjs/index.js",
"types": "./lib/types/index.d.ts"
},
"./*": {
"import": "./lib/es/*",
"require": "./lib/cjs/*",
"types": "./lib/types/index.d.ts"
},
"./locale/*": {
"import": "./lib/es/locale/*.js",
"require": "./lib/cjs/locale/*.js",
"types": "./lib/types/locale/*.d.ts"
},
"./lib/*": "./lib/*"
}
},
"directories": {
"lib": "lib"
},
"files": [
"lib"
],
"scripts": {
"lint:types": "tsc --noEmit",
"build": "univer-cli build"
},
"dependencies": {
"react": "18.3.1",
"react-dom": "18.3.1"
},
"devDependencies": {
"@univerjs-infra/shared": "workspace:*",
"typescript": "^5.7.2",
"vite": "^6.0.3"
},
"space": {
".": {
"import": "./lib/es/index.js",
"require": "./lib/cjs/index.js",
"types": "./lib/types/index.d.ts"
},
"./*": {
"import": "./lib/es/*",
"require": "./lib/cjs/*",
"types": "./lib/types/index.d.ts"
},
"./locale/*": {
"import": "./lib/es/locale/*.js",
"require": "./lib/cjs/locale/*.js",
"types": "./lib/types/locale/*.d.ts"
},
"./lib/*": "./lib/*"
}
}
17 changes: 17 additions & 0 deletions packages/tools/src/react-dom/client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* Copyright 2023-present DreamNum Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

export * from 'react-dom/client';
17 changes: 17 additions & 0 deletions packages/tools/src/react-dom/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* Copyright 2023-present DreamNum Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

export * from 'react-dom';
18 changes: 18 additions & 0 deletions packages/tools/src/react/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* Copyright 2023-present DreamNum Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// @ts-expect-error
export * from 'react';
Loading

0 comments on commit 287f12e

Please sign in to comment.