Skip to content

Commit

Permalink
[UMD] Remove UMD builds
Browse files Browse the repository at this point in the history
UMD builds will not be supported in React 19. These are no longer widely used and the use case for using React from script tags without builds can be served by ESM using something like esm.sh.
  • Loading branch information
gnoff committed Apr 11, 2024
1 parent 386ffb3 commit d276c21
Show file tree
Hide file tree
Showing 26 changed files with 28 additions and 534 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,6 @@ module.exports = {
__EXTENSION__: 'readonly',
__PROFILE__: 'readonly',
__TEST__: 'readonly',
__UMD__: 'readonly',
__VARIANT__: 'readonly',
__unmockReact: 'readonly',
gate: 'readonly',
Expand Down
1 change: 0 additions & 1 deletion packages/react-art/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"README.md",
"index.js",
"cjs/",
"umd/",
"Circle.js",
"Rectangle.js",
"Wedge.js"
Expand Down
3 changes: 1 addition & 2 deletions packages/react-cache/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
"LICENSE",
"README.md",
"index.js",
"cjs/",
"umd/"
"cjs/"
],
"peerDependencies": {
"react": "^17.0.0"
Expand Down
8 changes: 4 additions & 4 deletions packages/react-dom/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ export function createRoot(
options?: CreateRootOptions,
): RootType {
if (__DEV__) {
(Internals: any).usingClientEntryPoint = true;
Internals.usingClientEntryPoint = true;
}
try {
return createRootImpl(container, options);
} finally {
if (__DEV__) {
(Internals: any).usingClientEntryPoint = false;
Internals.usingClientEntryPoint = false;
}
}
}
Expand All @@ -44,13 +44,13 @@ export function hydrateRoot(
options?: HydrateRootOptions,
): RootType {
if (__DEV__) {
(Internals: any).usingClientEntryPoint = true;
Internals.usingClientEntryPoint = true;
}
try {
return hydrateRootImpl(container, children, options);
} finally {
if (__DEV__) {
(Internals: any).usingClientEntryPoint = false;
Internals.usingClientEntryPoint = false;
}
}
}
3 changes: 1 addition & 2 deletions packages/react-dom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@
"unstable_testing.js",
"unstable_testing.react-server.js",
"unstable_server-external-runtime.js",
"cjs/",
"umd/"
"cjs/"
],
"exports": {
".": {
Expand Down
4 changes: 2 additions & 2 deletions packages/react-dom/src/client/ReactDOM.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function createRoot(
options?: CreateRootOptions,
): RootType {
if (__DEV__) {
if (!(Internals: any).usingClientEntryPoint && !__UMD__) {
if (!Internals.usingClientEntryPoint) {
console.error(
'You are importing createRoot from "react-dom" which is not supported. ' +
'You should instead import it from "react-dom/client".',
Expand All @@ -105,7 +105,7 @@ function hydrateRoot(
options?: HydrateRootOptions,
): RootType {
if (__DEV__) {
if (!(Internals: any).usingClientEntryPoint && !__UMD__) {
if (!Internals.usingClientEntryPoint) {
console.error(
'You are importing hydrateRoot from "react-dom" which is not supported. ' +
'You should instead import it from "react-dom/client".',
Expand Down
3 changes: 1 addition & 2 deletions packages/react-is/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"LICENSE",
"README.md",
"index.js",
"cjs/",
"umd/"
"cjs/"
]
}
3 changes: 1 addition & 2 deletions packages/react-refresh/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
"README.md",
"babel.js",
"runtime.js",
"cjs/",
"umd/"
"cjs/"
],
"main": "runtime.js",
"exports": {
Expand Down
1 change: 0 additions & 1 deletion packages/react-server-dom-turbopack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"server.node.unbundled.js",
"node-register.js",
"cjs/",
"umd/",
"esm/"
],
"exports": {
Expand Down
1 change: 0 additions & 1 deletion packages/react-server-dom-webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"server.node.unbundled.js",
"node-register.js",
"cjs/",
"umd/",
"esm/"
],
"exports": {
Expand Down
3 changes: 1 addition & 2 deletions packages/react-test-renderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"README.md",
"index.js",
"shallow.js",
"cjs/",
"umd/"
"cjs/"
]
}
1 change: 0 additions & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"README.md",
"index.js",
"cjs/",
"umd/",
"jsx-runtime.js",
"jsx-runtime.react-server.js",
"jsx-dev-runtime.js",
Expand Down
101 changes: 0 additions & 101 deletions packages/react/src/forks/ReactSharedInternalsClient.umd.js

This file was deleted.

3 changes: 1 addition & 2 deletions packages/scheduler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"index.native.js",
"unstable_mock.js",
"unstable_post_task.js",
"cjs/",
"umd/"
"cjs/"
]
}

This file was deleted.

63 changes: 0 additions & 63 deletions packages/shared/forks/Scheduler.umd.js

This file was deleted.

1 change: 0 additions & 1 deletion scripts/flow/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
/* eslint-disable */

declare const __PROFILE__: boolean;
declare const __UMD__: boolean;
declare const __EXPERIMENTAL__: boolean;
declare const __VARIANT__: boolean;

Expand Down
1 change: 0 additions & 1 deletion scripts/jest/setupEnvironment.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ global.__DEV__ = NODE_ENV === 'development';
global.__EXTENSION__ = false;
global.__TEST__ = NODE_ENV === 'test';
global.__PROFILE__ = NODE_ENV === 'development';
global.__UMD__ = false;

const RELEASE_CHANNEL = process.env.RELEASE_CHANNEL;

Expand Down
Loading

0 comments on commit d276c21

Please sign in to comment.