Skip to content

Commit

Permalink
[flow] enable exact_empty_objects (#25973)
Browse files Browse the repository at this point in the history
This enables the "exact_empty_objects" setting for Flow which makes
empty objects exact instead of building up the type as properties are
added in code below. This is in preparation to Flow 191 which makes this
the default and removes the config.

More about the change in the Flow blog
[here](https://medium.com/flow-type/improved-handling-of-the-empty-object-in-flow-ead91887e40c).

DiffTrain build for [e2424f3](e2424f3)
[View git log for this commit](https://github.com/facebook/react/commits/e2424f33b3ad727321fc12e75c5e94838e84c2b5)
  • Loading branch information
kassens committed Jan 9, 2023
1 parent 3075524 commit 7fdc64c
Show file tree
Hide file tree
Showing 28 changed files with 86 additions and 62 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0b4f443020af386f2b48c47c074cb504ed672dc8
e2424f33b3ad727321fc12e75c5e94838e84c2b5
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION_TRANSFORMS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0b4f443020af386f2b48c47c074cb504ed672dc8
e2424f33b3ad727321fc12e75c5e94838e84c2b5
6 changes: 3 additions & 3 deletions compiled/facebook-www/React-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (
}
"use strict";

var ReactVersion = "18.3.0-www-classic-0b4f44302-20230109";
var ReactVersion = "18.3.0-www-classic-e2424f33b-20230109";

// ATTENTION
// When adding new symbols to this file,
Expand Down Expand Up @@ -3089,15 +3089,15 @@ function startTransition(scope, options) {
if (prevTransition === null && currentTransition._updatedFibers) {
var updatedFibersCount = currentTransition._updatedFibers.size;

currentTransition._updatedFibers.clear();

if (updatedFibersCount > 10) {
warn(
"Detected a large number of updates inside startTransition. " +
"If this is due to a subscription please re-write it to use React provided hooks. " +
"Otherwise concurrent mode guarantees are off the table."
);
}

currentTransition._updatedFibers.clear();
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions compiled/facebook-www/React-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if (
}
"use strict";

var ReactVersion = "18.3.0-www-modern-0b4f44302-20230109";
var ReactVersion = "18.3.0-www-modern-e2424f33b-20230109";

// ATTENTION
// When adding new symbols to this file,
Expand Down Expand Up @@ -3055,15 +3055,15 @@ function startTransition(scope, options) {
if (prevTransition === null && currentTransition._updatedFibers) {
var updatedFibersCount = currentTransition._updatedFibers.size;

currentTransition._updatedFibers.clear();

if (updatedFibersCount > 10) {
warn(
"Detected a large number of updates inside startTransition. " +
"If this is due to a subscription please re-write it to use React provided hooks. " +
"Otherwise concurrent mode guarantees are off the table."
);
}

currentTransition._updatedFibers.clear();
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -643,4 +643,4 @@ exports.useSyncExternalStore = function(
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-www-classic-0b4f44302-20230109";
exports.version = "18.3.0-www-classic-e2424f33b-20230109";
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -635,4 +635,4 @@ exports.useSyncExternalStore = function(
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-www-modern-0b4f44302-20230109";
exports.version = "18.3.0-www-modern-e2424f33b-20230109";
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-profiling.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ exports.useSyncExternalStore = function(
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-www-classic-0b4f44302-20230109";
exports.version = "18.3.0-www-classic-e2424f33b-20230109";

/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-profiling.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ exports.useSyncExternalStore = function(
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-www-modern-0b4f44302-20230109";
exports.version = "18.3.0-www-modern-e2424f33b-20230109";

/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
Expand Down
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactART-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
return self;
}

var ReactVersion = "18.3.0-www-classic-0b4f44302-20230109";
var ReactVersion = "18.3.0-www-classic-e2424f33b-20230109";

var LegacyRoot = 0;
var ConcurrentRoot = 1;
Expand Down Expand Up @@ -9280,15 +9280,15 @@ function startTransition(setPending, callback, options) {
if (prevTransition === null && currentTransition._updatedFibers) {
var updatedFibersCount = currentTransition._updatedFibers.size;

currentTransition._updatedFibers.clear();

if (updatedFibersCount > 10) {
warn(
"Detected a large number of updates inside startTransition. " +
"If this is due to a subscription please re-write it to use React provided hooks. " +
"Otherwise concurrent mode guarantees are off the table."
);
}

currentTransition._updatedFibers.clear();
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactART-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
return self;
}

var ReactVersion = "18.3.0-www-modern-0b4f44302-20230109";
var ReactVersion = "18.3.0-www-modern-e2424f33b-20230109";

var LegacyRoot = 0;
var ConcurrentRoot = 1;
Expand Down Expand Up @@ -9042,15 +9042,15 @@ function startTransition(setPending, callback, options) {
if (prevTransition === null && currentTransition._updatedFibers) {
var updatedFibersCount = currentTransition._updatedFibers.size;

currentTransition._updatedFibers.clear();

if (updatedFibersCount > 10) {
warn(
"Detected a large number of updates inside startTransition. " +
"If this is due to a subscription please re-write it to use React provided hooks. " +
"Otherwise concurrent mode guarantees are off the table."
);
}

currentTransition._updatedFibers.clear();
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions compiled/facebook-www/ReactART-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -9804,7 +9804,7 @@ var slice = Array.prototype.slice,
return null;
},
bundleType: 0,
version: "18.3.0-www-classic-0b4f44302-20230109",
version: "18.3.0-www-classic-e2424f33b-20230109",
rendererPackageName: "react-art"
};
var internals$jscomp$inline_1319 = {
Expand Down Expand Up @@ -9835,7 +9835,7 @@ var internals$jscomp$inline_1319 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-0b4f44302-20230109"
reconcilerVersion: "18.3.0-next-e2424f33b-20230109"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1320 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
4 changes: 2 additions & 2 deletions compiled/facebook-www/ReactART-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -9471,7 +9471,7 @@ var slice = Array.prototype.slice,
return null;
},
bundleType: 0,
version: "18.3.0-www-modern-0b4f44302-20230109",
version: "18.3.0-www-modern-e2424f33b-20230109",
rendererPackageName: "react-art"
};
var internals$jscomp$inline_1310 = {
Expand Down Expand Up @@ -9502,7 +9502,7 @@ var internals$jscomp$inline_1310 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-0b4f44302-20230109"
reconcilerVersion: "18.3.0-next-e2424f33b-20230109"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1311 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down
12 changes: 9 additions & 3 deletions compiled/facebook-www/ReactDOM-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -9350,6 +9350,7 @@ function validateURLKeyedUpdatedProps(

if (missingProps !== null && typeof missingProps === "object") {
for (var _propName3 in missingProps) {
// $FlowFixMe[incompatible-type]
comparisonStatement +=
"\n " +
_propName3 +
Expand All @@ -9361,6 +9362,7 @@ function validateURLKeyedUpdatedProps(

if (extraProps !== null && typeof extraProps === "object") {
for (var _propName4 in extraProps) {
// $FlowFixMe[incompatible-type]
comparisonStatement +=
"\n " +
_propName4 +
Expand All @@ -9372,6 +9374,7 @@ function validateURLKeyedUpdatedProps(

if (differentProps !== null && typeof differentProps === "object") {
for (var _propName5 in differentProps) {
// $FlowFixMe[incompatible-type]
comparisonStatement +=
"\n " +
_propName5 +
Expand Down Expand Up @@ -10417,6 +10420,7 @@ function getResource(type, pendingProps, currentProps) {
}

function preloadPropsFromRawProps(rawBorrowedProps) {
// $FlowFixMe[prop-missing] - recommended fix is to use object spread operator
return assign({}, rawBorrowedProps);
}

Expand All @@ -10428,6 +10432,7 @@ function titlePropsFromRawProps(child, rawProps) {
}

function stylePropsFromRawProps(rawProps) {
// $FlowFixMe[prop-missing] - recommended fix is to use object spread operator
var props = assign({}, rawProps);

props["data-precedence"] = rawProps.precedence;
Expand All @@ -10436,6 +10441,7 @@ function stylePropsFromRawProps(rawProps) {
}

function scriptPropsFromRawProps(rawProps) {
// $FlowFixMe[prop-missing] - recommended fix is to use object spread operator
var props = assign({}, rawProps);

return props;
Expand Down Expand Up @@ -23584,15 +23590,15 @@ function startTransition(setPending, callback, options) {
if (prevTransition === null && currentTransition._updatedFibers) {
var updatedFibersCount = currentTransition._updatedFibers.size;

currentTransition._updatedFibers.clear();

if (updatedFibersCount > 10) {
warn(
"Detected a large number of updates inside startTransition. " +
"If this is due to a subscription please re-write it to use React provided hooks. " +
"Otherwise concurrent mode guarantees are off the table."
);
}

currentTransition._updatedFibers.clear();
}
}
}
Expand Down Expand Up @@ -42701,7 +42707,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-www-classic-0b4f44302-20230109";
var ReactVersion = "18.3.0-www-classic-e2424f33b-20230109";

function createPortal(
children,
Expand Down
12 changes: 9 additions & 3 deletions compiled/facebook-www/ReactDOM-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -13858,6 +13858,7 @@ function validateURLKeyedUpdatedProps(

if (missingProps !== null && typeof missingProps === "object") {
for (var _propName3 in missingProps) {
// $FlowFixMe[incompatible-type]
comparisonStatement +=
"\n " +
_propName3 +
Expand All @@ -13869,6 +13870,7 @@ function validateURLKeyedUpdatedProps(

if (extraProps !== null && typeof extraProps === "object") {
for (var _propName4 in extraProps) {
// $FlowFixMe[incompatible-type]
comparisonStatement +=
"\n " +
_propName4 +
Expand All @@ -13880,6 +13882,7 @@ function validateURLKeyedUpdatedProps(

if (differentProps !== null && typeof differentProps === "object") {
for (var _propName5 in differentProps) {
// $FlowFixMe[incompatible-type]
comparisonStatement +=
"\n " +
_propName5 +
Expand Down Expand Up @@ -14925,6 +14928,7 @@ function getResource(type, pendingProps, currentProps) {
}

function preloadPropsFromRawProps(rawBorrowedProps) {
// $FlowFixMe[prop-missing] - recommended fix is to use object spread operator
return assign({}, rawBorrowedProps);
}

Expand All @@ -14936,6 +14940,7 @@ function titlePropsFromRawProps(child, rawProps) {
}

function stylePropsFromRawProps(rawProps) {
// $FlowFixMe[prop-missing] - recommended fix is to use object spread operator
var props = assign({}, rawProps);

props["data-precedence"] = rawProps.precedence;
Expand All @@ -14944,6 +14949,7 @@ function stylePropsFromRawProps(rawProps) {
}

function scriptPropsFromRawProps(rawProps) {
// $FlowFixMe[prop-missing] - recommended fix is to use object spread operator
var props = assign({}, rawProps);

return props;
Expand Down Expand Up @@ -23381,15 +23387,15 @@ function startTransition(setPending, callback, options) {
if (prevTransition === null && currentTransition._updatedFibers) {
var updatedFibersCount = currentTransition._updatedFibers.size;

currentTransition._updatedFibers.clear();

if (updatedFibersCount > 10) {
warn(
"Detected a large number of updates inside startTransition. " +
"If this is due to a subscription please re-write it to use React provided hooks. " +
"Otherwise concurrent mode guarantees are off the table."
);
}

currentTransition._updatedFibers.clear();
}
}
}
Expand Down Expand Up @@ -42425,7 +42431,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-www-modern-0b4f44302-20230109";
var ReactVersion = "18.3.0-www-modern-e2424f33b-20230109";

function createPortal(
children,
Expand Down
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactDOM-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -15554,7 +15554,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1751 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-classic-0b4f44302-20230109",
version: "18.3.0-www-classic-e2424f33b-20230109",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2135 = {
Expand Down Expand Up @@ -15584,7 +15584,7 @@ var internals$jscomp$inline_2135 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-0b4f44302-20230109"
reconcilerVersion: "18.3.0-next-e2424f33b-20230109"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2136 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -15826,4 +15826,4 @@ exports.unstable_renderSubtreeIntoContainer = function(
);
};
exports.unstable_runWithPriority = runWithPriority;
exports.version = "18.3.0-next-0b4f44302-20230109";
exports.version = "18.3.0-next-e2424f33b-20230109";
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactDOM-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -15115,7 +15115,7 @@ Internals.Events = [
var devToolsConfig$jscomp$inline_1719 = {
findFiberByHostInstance: getClosestInstanceFromNode,
bundleType: 0,
version: "18.3.0-www-modern-0b4f44302-20230109",
version: "18.3.0-www-modern-e2424f33b-20230109",
rendererPackageName: "react-dom"
};
var internals$jscomp$inline_2110 = {
Expand Down Expand Up @@ -15146,7 +15146,7 @@ var internals$jscomp$inline_2110 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-0b4f44302-20230109"
reconcilerVersion: "18.3.0-next-e2424f33b-20230109"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2111 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -15334,4 +15334,4 @@ exports.unstable_flushControlled = function(fn) {
}
};
exports.unstable_runWithPriority = runWithPriority;
exports.version = "18.3.0-next-0b4f44302-20230109";
exports.version = "18.3.0-next-e2424f33b-20230109";
Loading

0 comments on commit 7fdc64c

Please sign in to comment.