Skip to content

Commit 7b76862

Browse files
committed
Update Rollup and related plugins to their most recent versions (#24916)
Update Rollup and related plugins to their most recent versions + resolve any breaking changes/deprecations/etc along the way. I made each change piece by piece, so the commit history tells a pretty good story of what was changed where/how/why. fixes #24894 For the full deepdive/context, see: - #24894 The inspiration for this came from @jasonwilliams 's PR for attempting to add sourcemap output support to React's builds: - #20186 - #21946 But I figured that it would be useful to minimise the scope of changes in that PR, and to modernise the build tooling along the way. If any of these updates rely on a node version later than `10.x`, then the following PR may have to land first, otherwise things might break on AppVeyor: - #24891 - #24892 Co-authored-by: Sebastian Markbage <[email protected]> DiffTrain build for [6b6d061](6b6d061) [View git log for this commit](https://github.com/facebook/react/commits/6b6d0617eff48860c5b4e3e79c74cbd3312cf45a)
1 parent fe55d7c commit 7b76862

File tree

54 files changed

+7942
-40215
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+7942
-40215
lines changed

compiled/babel-plugin-react-refresh/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ function ReactFreshBabelPlugin (babel) {
169169
} // Neither require nor import. Might be a HOC.
170170
// Pass through.
171171

172-
}
172+
} else ;
173173

174174
break;
175175
}

compiled/facebook-www/JSXDEVRuntime-dev.classic.js

+40-68
Original file line numberDiff line numberDiff line change
@@ -105,41 +105,13 @@ function printWarning(level, format, args) {
105105
// Re-export dynamic flags from the www version.
106106
var dynamicFeatureFlags = require("ReactFeatureFlags");
107107

108-
var disableInputAttributeSyncing =
109-
dynamicFeatureFlags.disableInputAttributeSyncing,
110-
enableTrustedTypesIntegration =
111-
dynamicFeatureFlags.enableTrustedTypesIntegration,
112-
disableSchedulerTimeoutBasedOnReactExpirationTime =
113-
dynamicFeatureFlags.disableSchedulerTimeoutBasedOnReactExpirationTime,
114-
replayFailedUnitOfWorkWithInvokeGuardedCallback =
115-
dynamicFeatureFlags.replayFailedUnitOfWorkWithInvokeGuardedCallback,
116-
enableFilterEmptyStringAttributesDOM =
117-
dynamicFeatureFlags.enableFilterEmptyStringAttributesDOM,
118-
enableLegacyFBSupport = dynamicFeatureFlags.enableLegacyFBSupport,
119-
deferRenderPhaseUpdateToNextBatch =
120-
dynamicFeatureFlags.deferRenderPhaseUpdateToNextBatch,
121-
enableDebugTracing = dynamicFeatureFlags.enableDebugTracing,
122-
skipUnmountedBoundaries = dynamicFeatureFlags.skipUnmountedBoundaries,
123-
enableUseRefAccessWarning = dynamicFeatureFlags.enableUseRefAccessWarning,
108+
var enableDebugTracing = dynamicFeatureFlags.enableDebugTracing,
124109
disableNativeComponentFrames =
125110
dynamicFeatureFlags.disableNativeComponentFrames,
126-
disableSchedulerTimeoutInWorkLoop =
127-
dynamicFeatureFlags.disableSchedulerTimeoutInWorkLoop,
128-
enableLazyContextPropagation =
129-
dynamicFeatureFlags.enableLazyContextPropagation,
130-
enableSyncDefaultUpdates = dynamicFeatureFlags.enableSyncDefaultUpdates,
131-
enableUnifiedSyncLane = dynamicFeatureFlags.enableUnifiedSyncLane,
132-
enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay =
133-
dynamicFeatureFlags.enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay,
134-
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing,
135-
enableCustomElementPropertySupport =
136-
dynamicFeatureFlags.enableCustomElementPropertySupport; // On WWW, false is used for a new modern build.
137-
var enableProfilerNestedUpdateScheduledHook =
138-
dynamicFeatureFlags.enableProfilerNestedUpdateScheduledHook;
139-
140-
var enableSchedulingProfiler = dynamicFeatureFlags.enableSchedulingProfiler; // Note: we'll want to remove this when we to userland implementation.
111+
enableTransitionTracing = dynamicFeatureFlags.enableTransitionTracing;
112+
// On WWW, false is used for a new modern build.
141113

142-
var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
114+
var REACT_CLIENT_REFERENCE$1 = Symbol.for("react.client.reference");
143115
function isValidElementType(type) {
144116
if (typeof type === "string" || typeof type === "function") {
145117
return true;
@@ -171,7 +143,7 @@ function isValidElementType(type) {
171143
// types supported by any Flight configuration anywhere since
172144
// we don't know which Flight build this will end up being used
173145
// with.
174-
type.$$typeof === REACT_CLIENT_REFERENCE ||
146+
type.$$typeof === REACT_CLIENT_REFERENCE$1 ||
175147
type.getModuleId !== undefined
176148
) {
177149
return true;
@@ -649,9 +621,9 @@ function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
649621
var hasOwnProperty = Object.prototype.hasOwnProperty;
650622

651623
var loggedTypeFailures = {};
652-
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
624+
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
653625

654-
function setCurrentlyValidatingElement(element) {
626+
function setCurrentlyValidatingElement$1(element) {
655627
{
656628
if (element) {
657629
var owner = element._owner;
@@ -660,9 +632,9 @@ function setCurrentlyValidatingElement(element) {
660632
element._source,
661633
owner ? owner.type : null
662634
);
663-
ReactDebugCurrentFrame.setExtraStackFrame(stack);
635+
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
664636
} else {
665-
ReactDebugCurrentFrame.setExtraStackFrame(null);
637+
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
666638
}
667639
}
668640
}
@@ -712,7 +684,7 @@ function checkPropTypes(typeSpecs, values, location, componentName, element) {
712684
}
713685

714686
if (error$1 && !(error$1 instanceof Error)) {
715-
setCurrentlyValidatingElement(element);
687+
setCurrentlyValidatingElement$1(element);
716688

717689
error(
718690
"%s: type specification of %s" +
@@ -727,7 +699,7 @@ function checkPropTypes(typeSpecs, values, location, componentName, element) {
727699
typeof error$1
728700
);
729701

730-
setCurrentlyValidatingElement(null);
702+
setCurrentlyValidatingElement$1(null);
731703
}
732704

733705
if (
@@ -737,11 +709,11 @@ function checkPropTypes(typeSpecs, values, location, componentName, element) {
737709
// Only monitor this failure once because there tends to be a lot of the
738710
// same error.
739711
loggedTypeFailures[error$1.message] = true;
740-
setCurrentlyValidatingElement(element);
712+
setCurrentlyValidatingElement$1(element);
741713

742714
error("Failed %s type: %s", location, error$1.message);
743715

744-
setCurrentlyValidatingElement(null);
716+
setCurrentlyValidatingElement$1(null);
745717
}
746718
}
747719
}
@@ -828,7 +800,7 @@ function checkKeyStringCoercion(value) {
828800
}
829801
}
830802

831-
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
803+
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
832804
var RESERVED_PROPS = {
833805
key: true,
834806
ref: true,
@@ -875,12 +847,12 @@ function warnIfStringRefCannotBeAutoConverted(config, self) {
875847
{
876848
if (
877849
typeof config.ref === "string" &&
878-
ReactCurrentOwner.current &&
850+
ReactCurrentOwner$1.current &&
879851
self &&
880-
ReactCurrentOwner.current.stateNode !== self
852+
ReactCurrentOwner$1.current.stateNode !== self
881853
) {
882854
var componentName = getComponentNameFromType(
883-
ReactCurrentOwner.current.type
855+
ReactCurrentOwner$1.current.type
884856
);
885857

886858
if (!didWarnAboutStringRefs[componentName]) {
@@ -891,7 +863,7 @@ function warnIfStringRefCannotBeAutoConverted(config, self) {
891863
"We ask you to manually fix this case by using useRef() or createRef() instead. " +
892864
"Learn more about using refs safely here: " +
893865
"https://reactjs.org/link/strict-mode-string-ref",
894-
getComponentNameFromType(ReactCurrentOwner.current.type),
866+
getComponentNameFromType(ReactCurrentOwner$1.current.type),
895867
config.ref
896868
);
897869

@@ -1029,7 +1001,7 @@ var ReactElement = function (type, key, ref, self, source, owner, props) {
10291001
* @param {string} key
10301002
*/
10311003

1032-
function jsxDEV(type, config, maybeKey, source, self) {
1004+
function jsxDEV$1(type, config, maybeKey, source, self) {
10331005
{
10341006
var propName; // Reserved names are extracted
10351007

@@ -1103,17 +1075,17 @@ function jsxDEV(type, config, maybeKey, source, self) {
11031075
ref,
11041076
self,
11051077
source,
1106-
ReactCurrentOwner.current,
1078+
ReactCurrentOwner$1.current,
11071079
props
11081080
);
11091081
}
11101082
}
11111083

1112-
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
1113-
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
1114-
var REACT_CLIENT_REFERENCE$1 = Symbol.for("react.client.reference");
1084+
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
1085+
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
1086+
var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
11151087

1116-
function setCurrentlyValidatingElement$1(element) {
1088+
function setCurrentlyValidatingElement(element) {
11171089
{
11181090
if (element) {
11191091
var owner = element._owner;
@@ -1122,9 +1094,9 @@ function setCurrentlyValidatingElement$1(element) {
11221094
element._source,
11231095
owner ? owner.type : null
11241096
);
1125-
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
1097+
ReactDebugCurrentFrame.setExtraStackFrame(stack);
11261098
} else {
1127-
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
1099+
ReactDebugCurrentFrame.setExtraStackFrame(null);
11281100
}
11291101
}
11301102
}
@@ -1154,8 +1126,8 @@ function isValidElement(object) {
11541126

11551127
function getDeclarationErrorAddendum() {
11561128
{
1157-
if (ReactCurrentOwner$1.current) {
1158-
var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
1129+
if (ReactCurrentOwner.current) {
1130+
var name = getComponentNameFromType(ReactCurrentOwner.current.type);
11591131

11601132
if (name) {
11611133
return "\n\nCheck the render method of `" + name + "`.";
@@ -1238,7 +1210,7 @@ function validateExplicitKey(element, parentType) {
12381210
if (
12391211
element &&
12401212
element._owner &&
1241-
element._owner !== ReactCurrentOwner$1.current
1213+
element._owner !== ReactCurrentOwner.current
12421214
) {
12431215
// Give the component that originally created this child.
12441216
childOwner =
@@ -1247,7 +1219,7 @@ function validateExplicitKey(element, parentType) {
12471219
".";
12481220
}
12491221

1250-
setCurrentlyValidatingElement$1(element);
1222+
setCurrentlyValidatingElement(element);
12511223

12521224
error(
12531225
'Each child in a list should have a unique "key" prop.' +
@@ -1256,7 +1228,7 @@ function validateExplicitKey(element, parentType) {
12561228
childOwner
12571229
);
12581230

1259-
setCurrentlyValidatingElement$1(null);
1231+
setCurrentlyValidatingElement(null);
12601232
}
12611233
}
12621234
/**
@@ -1275,7 +1247,7 @@ function validateChildKeys(node, parentType) {
12751247
return;
12761248
}
12771249

1278-
if (node.$$typeof === REACT_CLIENT_REFERENCE$1);
1250+
if (node.$$typeof === REACT_CLIENT_REFERENCE);
12791251
else if (isArray(node)) {
12801252
for (var i = 0; i < node.length; i++) {
12811253
var child = node[i];
@@ -1324,7 +1296,7 @@ function validatePropTypes(element) {
13241296
return;
13251297
}
13261298

1327-
if (type.$$typeof === REACT_CLIENT_REFERENCE$1) {
1299+
if (type.$$typeof === REACT_CLIENT_REFERENCE) {
13281300
return;
13291301
}
13301302

@@ -1382,25 +1354,25 @@ function validateFragmentProps(fragment) {
13821354
var key = keys[i];
13831355

13841356
if (key !== "children" && key !== "key") {
1385-
setCurrentlyValidatingElement$1(fragment);
1357+
setCurrentlyValidatingElement(fragment);
13861358

13871359
error(
13881360
"Invalid prop `%s` supplied to `React.Fragment`. " +
13891361
"React.Fragment can only have `key` and `children` props.",
13901362
key
13911363
);
13921364

1393-
setCurrentlyValidatingElement$1(null);
1365+
setCurrentlyValidatingElement(null);
13941366
break;
13951367
}
13961368
}
13971369

13981370
if (fragment.ref !== null) {
1399-
setCurrentlyValidatingElement$1(fragment);
1371+
setCurrentlyValidatingElement(fragment);
14001372

14011373
error("Invalid attribute `ref` supplied to `React.Fragment`.");
14021374

1403-
setCurrentlyValidatingElement$1(null);
1375+
setCurrentlyValidatingElement(null);
14041376
}
14051377
}
14061378
}
@@ -1457,7 +1429,7 @@ function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
14571429
);
14581430
}
14591431

1460-
var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
1432+
var element = jsxDEV$1(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.
14611433
// TODO: Drop this when these are no longer allowed as the type argument.
14621434

14631435
if (element == null) {
@@ -1535,10 +1507,10 @@ function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
15351507
}
15361508
} // These two functions exist to still get child warnings in dev
15371509

1538-
var jsxDEV$1 = jsxWithValidation;
1510+
var jsxDEV = jsxWithValidation;
15391511

15401512
exports.Fragment = REACT_FRAGMENT_TYPE;
1541-
exports.jsxDEV = jsxDEV$1;
1513+
exports.jsxDEV = jsxDEV;
15421514

15431515
})();
15441516
}

0 commit comments

Comments
 (0)