mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 00:20:04 +01:00
In React 19 React will finally stop publishing UMD builds. This is motivated primarily by the lack of use of UMD format and the added complexity of maintaining build infra for these releases. Additionally with ESM becoming more prevalent in browsers and services like esm.sh which can host React as an ESM module there are other options for doing script tag based react loading. This PR removes all the UMD build configs and forks. There are some fixtures that still have references to UMD builds however many of them already do not work (for instance they are using legacy features like ReactDOM.render) and rather than block the removal on these fixtures being brought up to date we'll just move forward and fix or removes fixtures as necessary in the future.
57 lines
1.2 KiB
JavaScript
57 lines
1.2 KiB
JavaScript
/**
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @flow
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
import type {ReactNodeList} from 'shared/ReactTypes';
|
|
import type {
|
|
RootType,
|
|
HydrateRootOptions,
|
|
CreateRootOptions,
|
|
} from './src/client/ReactDOMRoot';
|
|
|
|
import {
|
|
createRoot as createRootImpl,
|
|
hydrateRoot as hydrateRootImpl,
|
|
__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE as Internals,
|
|
} from './';
|
|
|
|
export function createRoot(
|
|
container: Element | Document | DocumentFragment,
|
|
options?: CreateRootOptions,
|
|
): RootType {
|
|
if (__DEV__) {
|
|
Internals.usingClientEntryPoint = true;
|
|
}
|
|
try {
|
|
return createRootImpl(container, options);
|
|
} finally {
|
|
if (__DEV__) {
|
|
Internals.usingClientEntryPoint = false;
|
|
}
|
|
}
|
|
}
|
|
|
|
export function hydrateRoot(
|
|
container: Document | Element,
|
|
children: ReactNodeList,
|
|
options?: HydrateRootOptions,
|
|
): RootType {
|
|
if (__DEV__) {
|
|
Internals.usingClientEntryPoint = true;
|
|
}
|
|
try {
|
|
return hydrateRootImpl(container, children, options);
|
|
} finally {
|
|
if (__DEV__) {
|
|
Internals.usingClientEntryPoint = false;
|
|
}
|
|
}
|
|
}
|