Skip to content

Commit

Permalink
[UMD] Remove umd builds (#28735)
Browse files Browse the repository at this point in the history
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.

DiffTrain build for commit da6ba53.
  • Loading branch information
gnoff committed Apr 17, 2024
1 parent bfabc95 commit 6130570
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<e3a65ca9b3e1ae4b2d3e0e53482e5985>>
* @generated SignedSource<<f80067582f8d263400103116af004cc1>>
*/

"use strict";
Expand Down Expand Up @@ -9917,31 +9917,49 @@ if (__DEV__) {

function mountDeferredValue(value, initialValue) {
var hook = mountWorkInProgressHook();
return mountDeferredValueImpl(hook, value);
return mountDeferredValueImpl(hook, value, initialValue);
}

function updateDeferredValue(value, initialValue) {
var hook = updateWorkInProgressHook();
var resolvedCurrentHook = currentHook;
var prevValue = resolvedCurrentHook.memoizedState;
return updateDeferredValueImpl(hook, prevValue, value);
return updateDeferredValueImpl(hook, prevValue, value, initialValue);
}

function rerenderDeferredValue(value, initialValue) {
var hook = updateWorkInProgressHook();

if (currentHook === null) {
// This is a rerender during a mount.
return mountDeferredValueImpl(hook, value);
return mountDeferredValueImpl(hook, value, initialValue);
} else {
// This is a rerender during an update.
var prevValue = currentHook.memoizedState;
return updateDeferredValueImpl(hook, prevValue, value);
return updateDeferredValueImpl(hook, prevValue, value, initialValue);
}
}

function mountDeferredValueImpl(hook, value, initialValue) {
{
if (
// When `initialValue` is provided, we defer the initial render even if the
// current render is not synchronous.
initialValue !== undefined && // However, to avoid waterfalls, we do not defer if this render
// was itself spawned by an earlier useDeferredValue. Check if DeferredLane
// is part of the render lanes.
!includesSomeLane(renderLanes, DeferredLane)
) {
// Render with the initial value
hook.memoizedState = initialValue; // Schedule a deferred render to switch to the final value.

var deferredLane = requestDeferredLane();
currentlyRenderingFiber$1.lanes = mergeLanes(
currentlyRenderingFiber$1.lanes,
deferredLane
);
markSkippedUpdateLanes(deferredLane);
return initialValue;
} else {
hook.memoizedState = value;
return value;
}
Expand All @@ -9958,7 +9976,7 @@ if (__DEV__) {
if (isCurrentTreeHidden()) {
// Revealing a prerendered tree is considered the same as mounting new
// one, so we reuse the "mount" path in this case.
var resultValue = mountDeferredValueImpl(hook, value); // Unlike during an actual mount, we need to mark this as an update if
var resultValue = mountDeferredValueImpl(hook, value, initialValue); // Unlike during an actual mount, we need to mark this as an update if
// the value changed.

if (!objectIs(resultValue, prevValue)) {
Expand Down Expand Up @@ -10635,7 +10653,7 @@ if (__DEV__) {
useDeferredValue: function (value, initialValue) {
currentHookNameInDev = "useDeferredValue";
mountHookTypesDev();
return mountDeferredValue(value);
return mountDeferredValue(value, initialValue);
},
useTransition: function () {
currentHookNameInDev = "useTransition";
Expand Down Expand Up @@ -10791,7 +10809,7 @@ if (__DEV__) {
useDeferredValue: function (value, initialValue) {
currentHookNameInDev = "useDeferredValue";
updateHookTypesDev();
return mountDeferredValue(value);
return mountDeferredValue(value, initialValue);
},
useTransition: function () {
currentHookNameInDev = "useTransition";
Expand Down Expand Up @@ -10940,7 +10958,7 @@ if (__DEV__) {
useDeferredValue: function (value, initialValue) {
currentHookNameInDev = "useDeferredValue";
updateHookTypesDev();
return updateDeferredValue(value);
return updateDeferredValue(value, initialValue);
},
useTransition: function () {
currentHookNameInDev = "useTransition";
Expand Down Expand Up @@ -11097,7 +11115,7 @@ if (__DEV__) {
useDeferredValue: function (value, initialValue) {
currentHookNameInDev = "useDeferredValue";
updateHookTypesDev();
return rerenderDeferredValue(value);
return rerenderDeferredValue(value, initialValue);
},
useTransition: function () {
currentHookNameInDev = "useTransition";
Expand Down Expand Up @@ -11270,7 +11288,7 @@ if (__DEV__) {
currentHookNameInDev = "useDeferredValue";
warnInvalidHookAccess();
mountHookTypesDev();
return mountDeferredValue(value);
return mountDeferredValue(value, initialValue);
},
useTransition: function () {
currentHookNameInDev = "useTransition";
Expand Down Expand Up @@ -11445,7 +11463,7 @@ if (__DEV__) {
currentHookNameInDev = "useDeferredValue";
warnInvalidHookAccess();
updateHookTypesDev();
return updateDeferredValue(value);
return updateDeferredValue(value, initialValue);
},
useTransition: function () {
currentHookNameInDev = "useTransition";
Expand Down Expand Up @@ -11620,7 +11638,7 @@ if (__DEV__) {
currentHookNameInDev = "useDeferredValue";
warnInvalidHookAccess();
updateHookTypesDev();
return rerenderDeferredValue(value);
return rerenderDeferredValue(value, initialValue);
},
useTransition: function () {
currentHookNameInDev = "useTransition";
Expand Down Expand Up @@ -26655,7 +26673,7 @@ if (__DEV__) {
return root;
}

var ReactVersion = "19.0.0-canary-d96f3fda";
var ReactVersion = "19.0.0-canary-a47ffde4";

/*
* The `'' + value` pattern (used in perf-sensitive code) throws for Symbol
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<e78bdc7ec8a02adb480e7e113e250ca7>>
* @generated SignedSource<<9206ca0f6781a4c840d6d393f26b3429>>
*/

"use strict";
Expand Down Expand Up @@ -2946,26 +2946,24 @@ function updateMemo(nextCreate, deps) {
hook.memoizedState = [prevState, deps];
return prevState;
}
function mountDeferredValueImpl(hook, value, initialValue) {
if (void 0 === initialValue || 0 !== (renderLanes & 1073741824))
return (hook.memoizedState = value);
hook.memoizedState = initialValue;
hook = requestDeferredLane();
currentlyRenderingFiber$1.lanes |= hook;
workInProgressRootSkippedLanes |= hook;
return initialValue;
}
function updateDeferredValueImpl(hook, prevValue, value, initialValue) {
function updateDeferredValueImpl(hook, prevValue, value) {
if (objectIs(value, prevValue)) return value;
if (null !== currentTreeHiddenStackCursor.current)
return (
(hook = mountDeferredValueImpl(hook, value, initialValue)),
objectIs(hook, prevValue) || (didReceiveUpdate = !0),
hook
(hook.memoizedState = value),
objectIs(value, prevValue) || (didReceiveUpdate = !0),
value
);
if (0 === (renderLanes & 42))
return (didReceiveUpdate = !0), (hook.memoizedState = value);
hook = requestDeferredLane();
0 === workInProgressDeferredLane &&
(workInProgressDeferredLane =
0 !== (workInProgressRootRenderLanes & 536870912)
? 536870912
: claimNextTransitionLane());
hook = suspenseHandlerStackCursor.current;
null !== hook && (hook.flags |= 32);
hook = workInProgressDeferredLane;
currentlyRenderingFiber$1.lanes |= hook;
workInProgressRootSkippedLanes |= hook;
return prevValue;
Expand Down Expand Up @@ -3231,9 +3229,9 @@ var HooksDispatcherOnMount = {
return [initialState.memoizedState, dispatch];
},
useDebugValue: mountDebugValue,
useDeferredValue: function (value, initialValue) {
var hook = mountWorkInProgressHook();
return mountDeferredValueImpl(hook, value, initialValue);
useDeferredValue: function (value) {
mountWorkInProgressHook().memoizedState = value;
return value;
},
useTransition: function () {
var stateHook = mountStateImpl(!1);
Expand Down Expand Up @@ -3328,14 +3326,9 @@ var HooksDispatcherOnUpdate = {
return updateReducer(basicStateReducer);
},
useDebugValue: mountDebugValue,
useDeferredValue: function (value, initialValue) {
useDeferredValue: function (value) {
var hook = updateWorkInProgressHook();
return updateDeferredValueImpl(
hook,
currentHook.memoizedState,
value,
initialValue
);
return updateDeferredValueImpl(hook, currentHook.memoizedState, value);
},
useTransition: function () {
var booleanOrThenable = updateReducer(basicStateReducer)[0],
Expand Down Expand Up @@ -3375,16 +3368,11 @@ var HooksDispatcherOnRerender = {
return rerenderReducer(basicStateReducer);
},
useDebugValue: mountDebugValue,
useDeferredValue: function (value, initialValue) {
useDeferredValue: function (value) {
var hook = updateWorkInProgressHook();
return null === currentHook
? mountDeferredValueImpl(hook, value, initialValue)
: updateDeferredValueImpl(
hook,
currentHook.memoizedState,
value,
initialValue
);
? ((hook.memoizedState = value), value)
: updateDeferredValueImpl(hook, currentHook.memoizedState, value);
},
useTransition: function () {
var booleanOrThenable = rerenderReducer(basicStateReducer)[0],
Expand Down Expand Up @@ -7909,16 +7897,6 @@ function requestUpdateLane(fiber) {
fiber = 0 !== currentUpdatePriority ? currentUpdatePriority : 32;
return fiber;
}
function requestDeferredLane() {
0 === workInProgressDeferredLane &&
(workInProgressDeferredLane =
0 !== (workInProgressRootRenderLanes & 536870912)
? 536870912
: claimNextTransitionLane());
var suspenseHandler = suspenseHandlerStackCursor.current;
null !== suspenseHandler && (suspenseHandler.flags |= 32);
return workInProgressDeferredLane;
}
function scheduleUpdateOnFiber(root, fiber, lane) {
if (
(root === workInProgressRoot && 2 === workInProgressSuspendedReason) ||
Expand Down Expand Up @@ -9777,12 +9755,12 @@ function wrapFiber(fiber) {
fiberToWrapper.set(fiber, wrapper));
return wrapper;
}
var devToolsConfig$jscomp$inline_1082 = {
var devToolsConfig$jscomp$inline_1101 = {
findFiberByHostInstance: function () {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "19.0.0-canary-7fb14041",
version: "19.0.0-canary-39a6938a",
rendererPackageName: "react-test-renderer"
};
(function (internals) {
Expand All @@ -9799,10 +9777,10 @@ var devToolsConfig$jscomp$inline_1082 = {
} catch (err) {}
return hook.checkDCE ? !0 : !1;
})({
bundleType: devToolsConfig$jscomp$inline_1082.bundleType,
version: devToolsConfig$jscomp$inline_1082.version,
rendererPackageName: devToolsConfig$jscomp$inline_1082.rendererPackageName,
rendererConfig: devToolsConfig$jscomp$inline_1082.rendererConfig,
bundleType: devToolsConfig$jscomp$inline_1101.bundleType,
version: devToolsConfig$jscomp$inline_1101.version,
rendererPackageName: devToolsConfig$jscomp$inline_1101.rendererPackageName,
rendererConfig: devToolsConfig$jscomp$inline_1101.rendererConfig,
overrideHookState: null,
overrideHookStateDeletePath: null,
overrideHookStateRenamePath: null,
Expand All @@ -9819,14 +9797,14 @@ var devToolsConfig$jscomp$inline_1082 = {
return null === fiber ? null : fiber.stateNode;
},
findFiberByHostInstance:
devToolsConfig$jscomp$inline_1082.findFiberByHostInstance ||
devToolsConfig$jscomp$inline_1101.findFiberByHostInstance ||
emptyFindFiberByHostInstance,
findHostInstancesForRefresh: null,
scheduleRefresh: null,
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "19.0.0-canary-7fb14041"
reconcilerVersion: "19.0.0-canary-39a6938a"
});
exports._Scheduler = Scheduler;
exports.act = act;
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4ca20fd36b2444a74279e7022f89894710b1daab
da6ba53b10d8240fc251ba14a3e5878604d3dc7d

0 comments on commit 6130570

Please sign in to comment.