Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace React 18 with version 19 #370

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"workspaces": [
"packages/bridge",
"packages/braze",
"packages/react-18",
"packages/react-dom-18",
"packages/react",
"packages/react-dom",
"packages/trackjs",
"packages/vue-3",
"packages/lit",
Expand Down
14 changes: 0 additions & 14 deletions packages/react-dom-18/react-dom.server.browser.js

This file was deleted.

13 changes: 0 additions & 13 deletions packages/react-dom-18/react-dom.server.node.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"eik:publish": "eik publish",
"eik:alias": "eik npm-alias",
"postinstall": "npm run build",
"eik:publish:ci": "../../scripts/publish.js react-dom-18 react-dom"
"eik:publish:ci": "../../scripts/publish.js react-dom react-dom"
},
"dependencies": {
"react-dom": "18.3.1"
"react-dom": "19.0.0"
},
"devDependencies": {
"@eik/rollup-plugin": "4.0.64",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ReactDOM from "react-dom/client";

export default ReactDOM;
export const { createRoot, hydrateRoot } = ReactDOM;
export const { createRoot, hydrateRoot, version } = ReactDOM;
// This file exists simply to apply __esModule: true to the module
export const __esModule = true;
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@ import ReactDOM from "react-dom";

export default ReactDOM;
export const {
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
createPortal,
createRoot,
findDOMNode,
flushSync,
hydrate,
hydrateRoot,
render,
unmountComponentAtNode,
unstable_renderSubtreeIntoContainer,
preconnect,
prefetchDNS,
preinit,
preinitModule,
preload,
preloadModule,
requestFormReset,
unstable_batchedUpdates,
useFormState,
useFormStatus,
version,
} = ReactDOM;
// This file exists simply to apply __esModule: true to the module
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import swc from "@rollup/plugin-swc";

const env = process.env.NODE_ENV;

const reactPkg = new URL("../react-18/package.json", import.meta.url);
const reactPkg = new URL("../react/package.json", import.meta.url);
const reactDomPkg = new URL("./package.json", import.meta.url);

const {
Expand Down Expand Up @@ -58,14 +58,4 @@ export default [
output: { format: "esm", sourcemap: true, file: `./dist/react-dom.client.${env}.js` },
plugins,
},
{
input: "./react-dom.server.browser.js",
output: { format: "esm", sourcemap: true, file: `./dist/react-dom.server.browser.${env}.js` },
plugins,
},
{
input: "./react-dom.server.node.js",
output: { format: "esm", sourcemap: true, file: `./dist/react-dom.server.node.${env}.js` },
plugins,
},
];
22 changes: 13 additions & 9 deletions packages/react-18/development.js → packages/react/development.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,36 @@ export const {
Children,
Component,
PureComponent,
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
act,
cache,
cloneElement,
createContext,
createElement,
createFactory,
createRef,
forwardRef,
isValidElement,
lazy,
memo,
startTransition,
unstable_useCacheRefresh,
use,
useActionState,
useCallback,
useContext,
useDebugValue,
useDeferredValue,
useEffect,
useId,
useImperativeHandle,
useInsertionEffect,
useLayoutEffect,
useMemo,
useOptimistic,
useReducer,
useRef,
useState,
version,
startTransition,
unstable_act,
useDeferredValue,
useId,
useInsertionEffect,
useSyncExternalStore,
useTransition,
} = React;
version,
} = React;
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
"eik:login": "eik login",
"eik:publish": "eik publish",
"eik:alias": "eik npm-alias",
"eik:publish:ci": "../../scripts/publish.js react-18 react",
"eik:publish:ci": "../../scripts/publish.js react react",
"postinstall": "npm run build"
},
"dependencies": {
"react": "18.3.1"
"react": "19.0.0"
},
"devDependencies": {
"@eik/rollup-plugin": "4.0.64",
Expand Down
24 changes: 14 additions & 10 deletions packages/react-18/production.js → packages/react/production.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react/cjs/react.production.min.js";
import React from "react/cjs/react.production.js";

export default React;
export const __esmModule = true;
Expand All @@ -10,32 +10,36 @@ export const {
Children,
Component,
PureComponent,
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,
__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
act,
cache,
cloneElement,
createContext,
createElement,
createFactory,
createRef,
forwardRef,
isValidElement,
lazy,
memo,
startTransition,
unstable_useCacheRefresh,
use,
useActionState,
useCallback,
useContext,
useDebugValue,
useDeferredValue,
useEffect,
useId,
useImperativeHandle,
useInsertionEffect,
useLayoutEffect,
useMemo,
useOptimistic,
useReducer,
useRef,
useState,
version,
startTransition,
unstable_act,
useDeferredValue,
useId,
useInsertionEffect,
useSyncExternalStore,
useTransition,
} = React;
version,
} = React;
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ const { resolve } = createRequire(import.meta.url);
const reactPath = resolve("react");
const reactPackageJSONPath = join(dirname(reactPath), "package.json");
const reactPackageJSON = JSON.parse(readFileSync(reactPackageJSONPath, { encoding: "utf8" }));

reactPackageJSON.exports["./cjs/react.development.js"] = "./cjs/react.development.js";
reactPackageJSON.exports["./cjs/react.production.min.js"] = "./cjs/react.production.min.js";
reactPackageJSON.exports["./cjs/react.production.js"] = "./cjs/react.production.js";

writeFileSync(reactPackageJSONPath, JSON.stringify(reactPackageJSON, null, 2));

const browserslistrc = new URL("../../.browserslistrc", import.meta.url);
Expand Down