Skip to content

Commit

Permalink
Merge pull request #1516 from p3ol/feature/react-19-compat
Browse files Browse the repository at this point in the history
✨ feat: build with react 19 jsx runtime
  • Loading branch information
dackmin authored Dec 13, 2024
2 parents 79f49b5 + 2d84333 commit 0e49809
Show file tree
Hide file tree
Showing 40 changed files with 2,018 additions and 2,127 deletions.
614 changes: 307 additions & 307 deletions .yarn/releases/yarn-4.5.1.cjs → .yarn/releases/yarn-4.5.3.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ enableGlobalCache: true

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.5.1.cjs
yarnPath: .yarn/releases/yarn-4.5.3.cjs
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
"conventionalCommits": true
}
}
}
}
106 changes: 53 additions & 53 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,33 +24,33 @@
},
"devDependencies": {
"@babel/eslint-plugin": "7.25.9",
"@ckeditor/ckeditor5-alignment": "43.2.0",
"@ckeditor/ckeditor5-basic-styles": "43.2.0",
"@ckeditor/ckeditor5-block-quote": "43.2.0",
"@ckeditor/ckeditor5-core": "43.2.0",
"@ckeditor/ckeditor5-dev-translations": "43.0.0",
"@ckeditor/ckeditor5-dev-utils": "43.0.0",
"@ckeditor/ckeditor5-editor-classic": "43.2.0",
"@ckeditor/ckeditor5-editor-multi-root": "43.2.0",
"@ckeditor/ckeditor5-engine": "43.2.0",
"@ckeditor/ckeditor5-essentials": "43.2.0",
"@ckeditor/ckeditor5-font": "43.2.0",
"@ckeditor/ckeditor5-horizontal-line": "43.2.0",
"@ckeditor/ckeditor5-indent": "43.2.0",
"@ckeditor/ckeditor5-link": "43.2.0",
"@ckeditor/ckeditor5-list": "43.2.0",
"@ckeditor/ckeditor5-paragraph": "43.2.0",
"@ckeditor/ckeditor5-react": "9.3.1",
"@ckeditor/ckeditor5-remove-format": "43.2.0",
"@ckeditor/ckeditor5-table": "43.2.0",
"@ckeditor/ckeditor5-theme-lark": "43.2.0",
"@ckeditor/ckeditor5-typing": "43.2.0",
"@ckeditor/ckeditor5-ui": "43.2.0",
"@ckeditor/ckeditor5-utils": "43.2.0",
"@ckeditor/ckeditor5-watchdog": "43.2.0",
"@junipero/core": "3.7.1",
"@junipero/tailwind-plugin": "3.7.1",
"@percy/storybook": "6.0.2",
"@ckeditor/ckeditor5-alignment": "44.0.0",
"@ckeditor/ckeditor5-basic-styles": "44.0.0",
"@ckeditor/ckeditor5-block-quote": "44.0.0",
"@ckeditor/ckeditor5-core": "44.0.0",
"@ckeditor/ckeditor5-dev-translations": "43.0.1",
"@ckeditor/ckeditor5-dev-utils": "43.0.1",
"@ckeditor/ckeditor5-editor-classic": "44.0.0",
"@ckeditor/ckeditor5-editor-multi-root": "44.0.0",
"@ckeditor/ckeditor5-engine": "44.0.0",
"@ckeditor/ckeditor5-essentials": "44.0.0",
"@ckeditor/ckeditor5-font": "44.0.0",
"@ckeditor/ckeditor5-horizontal-line": "44.0.0",
"@ckeditor/ckeditor5-indent": "44.0.0",
"@ckeditor/ckeditor5-link": "44.0.0",
"@ckeditor/ckeditor5-list": "44.0.0",
"@ckeditor/ckeditor5-paragraph": "44.0.0",
"@ckeditor/ckeditor5-react": "9.4.0",
"@ckeditor/ckeditor5-remove-format": "44.0.0",
"@ckeditor/ckeditor5-table": "44.0.0",
"@ckeditor/ckeditor5-theme-lark": "44.0.0",
"@ckeditor/ckeditor5-typing": "44.0.0",
"@ckeditor/ckeditor5-ui": "44.0.0",
"@ckeditor/ckeditor5-utils": "44.0.0",
"@ckeditor/ckeditor5-watchdog": "44.0.0",
"@junipero/core": "3.10.0",
"@junipero/tailwind-plugin": "3.10.0",
"@percy/storybook": "6.0.3",
"@poool/eslint-config": "3.0.1",
"@poool/eslint-config-react": "3.0.1",
"@poool/eslint-plugin": "3.0.0",
Expand All @@ -61,57 +61,57 @@
"@rollup/plugin-node-resolve": "15.3.0",
"@rollup/plugin-swc": "0.4.0",
"@rollup/plugin-terser": "0.4.4",
"@storybook/addon-actions": "8.4.2",
"@storybook/addon-storysource": "8.4.2",
"@storybook/addon-actions": "8.4.7",
"@storybook/addon-storysource": "8.4.7",
"@storybook/addon-styling-webpack": "1.0.1",
"@storybook/addon-themes": "8.4.2",
"@storybook/addon-themes": "8.4.7",
"@storybook/addon-webpack5-compiler-swc": "1.0.5",
"@storybook/react": "8.4.2",
"@storybook/react-webpack5": "8.4.2",
"@storybook/theming": "8.4.2",
"@swc/core": "1.9.1",
"@storybook/react": "8.4.7",
"@storybook/react-webpack5": "8.4.7",
"@storybook/theming": "8.4.7",
"@swc/core": "1.10.1",
"@swc/jest": "0.2.37",
"@testing-library/dom": "10.4.0",
"@testing-library/jest-dom": "6.6.3",
"@testing-library/react": "16.0.1",
"@testing-library/react": "16.1.0",
"@types/jest": "29.5.14",
"@types/node": "22.9.0",
"@types/react": "18.3.12",
"@types/react-dom": "18.3.1",
"@typescript-eslint/parser": "8.13.0",
"@types/node": "22.10.2",
"@types/react": "19.0.1",
"@types/react-dom": "19.0.2",
"@typescript-eslint/parser": "8.18.0",
"autoprefixer": "10.4.20",
"ckeditor5": "43.2.0",
"ckeditor5": "44.0.0",
"css-loader": "7.1.2",
"eslint": "8.57.1",
"eslint-config-standard": "17.1.0",
"eslint-plugin-import": "2.31.0",
"eslint-plugin-n": "17.13.0",
"eslint-plugin-promise": "7.1.0",
"eslint-plugin-n": "17.15.0",
"eslint-plugin-promise": "7.2.1",
"eslint-plugin-react": "7.37.2",
"jest": "29.7.0",
"jest-css-modules-transform": "4.4.2",
"jest-environment-jsdom": "29.7.0",
"jest-transform-stub": "2.0.0",
"lerna": "8.1.9",
"lerna-changelog": "2.2.0",
"postcss": "8.4.47",
"postcss": "8.4.49",
"postcss-loader": "8.1.1",
"react": "18.3.1",
"react-dom": "18.3.1",
"react": "19.0.0",
"react-dom": "19.0.0",
"remirror": "3.0.1",
"rollup": "4.24.4",
"rollup": "4.28.1",
"rollup-plugin-postcss": "4.0.2",
"sass": "1.80.6",
"sass-loader": "16.0.3",
"storybook": "8.4.2",
"sass": "1.82.0",
"sass-loader": "16.0.4",
"storybook": "8.4.7",
"storybook-dark-mode": "4.0.2",
"style-loader": "4.0.0",
"swc-loader": "0.2.6",
"tailwindcss": "3.4.14",
"tailwindcss": "3.4.16",
"terser-webpack-plugin": "5.3.10",
"typescript": "5.6.3",
"webpack": "5.96.1",
"typescript": "5.7.2",
"webpack": "5.97.1",
"webpack-cli": "5.1.4"
},
"packageManager": "yarn@4.5.1"
"packageManager": "yarn@4.5.3"
}
8 changes: 6 additions & 2 deletions packages/addon-ckeditor5-react/lib/index.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ckeditorFieldAddon } from './addons';

export default { title: 'React/With addon: CKEditor' };

const baseContent: ElementObject = [
const baseContent: ElementObject[] = [
{ type: 'text', content: 'This is a title' },
];

Expand All @@ -27,7 +27,11 @@ const addon: AddonObject = {

export const basic = () => (
<Builder
addons={[baseAddon(), ckeditorFieldAddon(), addon]}
addons={[baseAddon(), ckeditorFieldAddon({
config: {
licenseKey: 'GPL',
},
}), addon]}
value={baseContent}
rootBoundary={document.documentElement}
options={{ debug: true }}
Expand Down
6 changes: 3 additions & 3 deletions packages/addon-ckeditor5-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
"peerDependencies": {
"@ckeditor/ckeditor5-react": "^6.0.0 || ^7.0.0",
"@oakjs/react": "^3.0.0",
"react": "^18.0.0",
"react-dom": "^18.0.0"
"react": "^18.0.0 || ^19.0.0",
"react-dom": "^18.0.0 || ^19.0.0"
},
"dependencies": {
"@oakjs/ckeditor5-build-custom": "^3.10.9"
},
"devDependencies": {
"@oakjs/ckeditor5-build-custom": "workspace:*",
"@oakjs/react": "^3.10.9"
"@oakjs/react": "workspace:*"
},
"scripts": {
"clean": "rm -rf ./dist || true",
Expand Down
2 changes: 1 addition & 1 deletion packages/addon-remirror/lib/Field/ColorButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type { Extensions } from '../types';
import MenuButton, { type MenuButtonProps } from './MenuButton';

const ColorButton = (props: MenuButtonProps) => {
const fieldRef = useRef<ColorFieldRef>();
const fieldRef = useRef<ColorFieldRef>(null);
const { setTextColor } = useCommands();
const { textColor } = useActive<Extensions>();
const chain = useChainedCommands();
Expand Down
6 changes: 3 additions & 3 deletions packages/addon-remirror/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
"@oakjs/react": "^3.0.0",
"@remirror/pm": "^2.0.0",
"@remirror/react": "^2.0.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react": "^18.0.0 || ^19.0.0",
"react-dom": "^18.0.0 || ^19.0.0",
"remirror": "^2.0.0"
},
"devDependencies": {
"@oakjs/react": "^3.10.9"
"@oakjs/react": "workspace:*"
},
"scripts": {
"clean": "rm -rf ./dist || true",
Expand Down
3 changes: 2 additions & 1 deletion packages/ckeditor5-build-custom/lib/ColorPlugin/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export default class ColorPlugin extends Plugin {

async createReactRoot (element: HTMLElement) {
try {
if (version.startsWith('18')) {
if (Number(version.split('.')[0]) >= 18) {
const { createRoot } = await import('react-dom/client');

return createRoot(element);
Expand All @@ -108,6 +108,7 @@ export default class ColorPlugin extends Plugin {
);
}

// @ts-expect-error react <= 17 fallback
const { render } = await import('react-dom');

return {
Expand Down
6 changes: 3 additions & 3 deletions packages/ckeditor5-build-custom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
},
"peerDependencies": {
"@oakjs/react": "^3.0.0",
"react": "^18.0.0",
"react-dom": "^18.0.0"
"react": "^18.0.0 || ^19.0.0",
"react-dom": "^18.0.0 || ^19.0.0"
},
"devDependencies": {
"@oakjs/react": "^3.10.9"
"@oakjs/react": "workspace:*"
},
"scripts": {
"build": "yarn build:code && yarn build:dts",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export declare interface FieldOverrideObject {
targets?: string[];
props?: Record<string, any>;
id?: string;
render?(): any;
render?(props?: any): any;
priority?: number;
onChange?<T = any>(
name: string,
Expand Down
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"node": ">= 18"
},
"dependencies": {
"@junipero/core": "3.7.1",
"uuid": "11.0.2"
"@junipero/core": "3.10.0",
"uuid": "11.0.3"
},
"scripts": {
"clean": "rm -rf ./dist || true",
Expand Down
11 changes: 7 additions & 4 deletions packages/react/lib/Builder/HistoryButtons.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { MutableRefObject } from 'react';
import type { RefObject } from 'react';
import { Tooltip, Button } from '@junipero/react';

import { useBuilder } from '../hooks';
Expand All @@ -10,7 +10,10 @@ export declare interface HistoryButtonsProps {
canRedo: boolean;
}

const HistoryButtons = ({ canUndo, canRedo }: HistoryButtonsProps) => {
const HistoryButtons = ({
canUndo,
canRedo,
}: HistoryButtonsProps) => {
const { builder, rootRef, floatingsRef, rootBoundary } = useBuilder();

return (
Expand All @@ -19,7 +22,7 @@ const HistoryButtons = ({ canUndo, canRedo }: HistoryButtonsProps) => {
disabled={!canUndo}
container={floatingsRef.current}
floatingOptions={{
boundary: (rootBoundary as MutableRefObject<any>)?.current ||
boundary: (rootBoundary as RefObject<any>)?.current ||
rootRef?.current,
}}
text={<Text name="core.tooltips.undo">Undo</Text>}
Expand All @@ -36,7 +39,7 @@ const HistoryButtons = ({ canUndo, canRedo }: HistoryButtonsProps) => {
disabled={!canRedo}
container={floatingsRef.current}
floatingOptions={{
boundary: (rootBoundary as MutableRefObject<any>)?.current ||
boundary: (rootBoundary as RefObject<any>)?.current ||
rootRef?.current,
}}
text={<Text name="core.tooltips.redo">Redo</Text>}
Expand Down
Loading

0 comments on commit 0e49809

Please sign in to comment.