Skip to content

Flow upgrade to 0.185 #25420

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"eslint-plugin-react-internal": "link:./scripts/eslint-rules",
"fbjs-scripts": "1.2.0",
"filesize": "^6.0.1",
"flow-bin": "^0.182.0",
"flow-bin": "^0.185.0",
"glob": "^7.1.6",
"glob-stream": "^6.1.0",
"google-closure-compiler": "^20200517.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/react-client/src/ReactFlightClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ function initializeModelChunk<T>(chunk: ResolvedModelChunk<T>): void {
initializingChunkBlockedModel !== null &&
initializingChunkBlockedModel.deps > 0
) {
// $FlowFixMe[incompatible-type]: found when upgrading Flow
initializingChunkBlockedModel.value = value;
// We discovered new dependencies on modules that are not yet resolved.
// We have to go the BLOCKED state until they're resolved.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ const objectWithModifiedHasOwnProperty = {
};

const objectWithNullProto = Object.create(null);
// $FlowFixMe[prop-missing] found when upgrading Flow
objectWithNullProto.foo = 'abc';
// $FlowFixMe[prop-missing] found when upgrading Flow
objectWithNullProto.bar = 123;

export default function EdgeCaseObjects(): React.Node {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,7 @@ function createStyleResource(
} else {
const hint = preloadResources.get(href);
if (hint) {
// $FlowFixMe[incompatible-type]: found when upgrading Flow
resource.hint = hint;
// If a preload for this style Resource already exists there are certain props we want to adopt
// on the style Resource, primarily focussed on making sure the style network pathways utilize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ export function dispatchEvent(
const event = {eventName: topLevelType, nativeEvent};
// $FlowFixMe[class-object-subtyping] found when upgrading Flow
RawEventEmitter.emit(topLevelType, event);
// $FlowFixMe[class-object-subtyping] found when upgrading Flow
RawEventEmitter.emit('*', event);

// Heritage plugin event system
Expand Down
10 changes: 7 additions & 3 deletions packages/react-reconciler/src/ReactFiberWorkLoop.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,18 +404,19 @@ export function addMarkerProgressCallbackToPendingTransition(
) {
if (enableTransitionTracing) {
if (currentPendingTransitionCallbacks === null) {
currentPendingTransitionCallbacks = {
currentPendingTransitionCallbacks = ({
transitionStart: null,
transitionProgress: null,
transitionComplete: null,
markerProgress: new Map(),
markerIncomplete: null,
markerComplete: null,
};
}: PendingTransitionCallbacks);
}

if (currentPendingTransitionCallbacks.markerProgress === null) {
// $FlowFixMe[incompatible-use] found when upgrading Flow
// $FlowFixMe[incompatible-use]
// $FlowFixMe[incompatible-type]
currentPendingTransitionCallbacks.markerProgress = new Map();
}

Expand Down Expand Up @@ -445,6 +446,7 @@ export function addMarkerIncompleteCallbackToPendingTransition(

if (currentPendingTransitionCallbacks.markerIncomplete === null) {
// $FlowFixMe[incompatible-use] found when upgrading Flow
// $FlowFixMe[incompatible-type] found when upgrading Flow
currentPendingTransitionCallbacks.markerIncomplete = new Map();
}

Expand Down Expand Up @@ -473,6 +475,7 @@ export function addMarkerCompleteCallbackToPendingTransition(

if (currentPendingTransitionCallbacks.markerComplete === null) {
// $FlowFixMe[incompatible-use] found when upgrading Flow
// $FlowFixMe[incompatible-type] found when upgrading Flow
currentPendingTransitionCallbacks.markerComplete = new Map();
}

Expand Down Expand Up @@ -501,6 +504,7 @@ export function addTransitionProgressCallbackToPendingTransition(

if (currentPendingTransitionCallbacks.transitionProgress === null) {
// $FlowFixMe[incompatible-use] found when upgrading Flow
// $FlowFixMe[incompatible-type] found when upgrading Flow
currentPendingTransitionCallbacks.transitionProgress = new Map();
}

Expand Down
10 changes: 7 additions & 3 deletions packages/react-reconciler/src/ReactFiberWorkLoop.old.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,18 +404,19 @@ export function addMarkerProgressCallbackToPendingTransition(
) {
if (enableTransitionTracing) {
if (currentPendingTransitionCallbacks === null) {
currentPendingTransitionCallbacks = {
currentPendingTransitionCallbacks = ({
transitionStart: null,
transitionProgress: null,
transitionComplete: null,
markerProgress: new Map(),
markerIncomplete: null,
markerComplete: null,
};
}: PendingTransitionCallbacks);
}

if (currentPendingTransitionCallbacks.markerProgress === null) {
// $FlowFixMe[incompatible-use] found when upgrading Flow
// $FlowFixMe[incompatible-use]
// $FlowFixMe[incompatible-type]
currentPendingTransitionCallbacks.markerProgress = new Map();
}

Expand Down Expand Up @@ -445,6 +446,7 @@ export function addMarkerIncompleteCallbackToPendingTransition(

if (currentPendingTransitionCallbacks.markerIncomplete === null) {
// $FlowFixMe[incompatible-use] found when upgrading Flow
// $FlowFixMe[incompatible-type] found when upgrading Flow
currentPendingTransitionCallbacks.markerIncomplete = new Map();
}

Expand Down Expand Up @@ -473,6 +475,7 @@ export function addMarkerCompleteCallbackToPendingTransition(

if (currentPendingTransitionCallbacks.markerComplete === null) {
// $FlowFixMe[incompatible-use] found when upgrading Flow
// $FlowFixMe[incompatible-type] found when upgrading Flow
currentPendingTransitionCallbacks.markerComplete = new Map();
}

Expand Down Expand Up @@ -501,6 +504,7 @@ export function addTransitionProgressCallbackToPendingTransition(

if (currentPendingTransitionCallbacks.transitionProgress === null) {
// $FlowFixMe[incompatible-use] found when upgrading Flow
// $FlowFixMe[incompatible-type] found when upgrading Flow
currentPendingTransitionCallbacks.transitionProgress = new Map();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ module.exports = function register() {
name: '*', // Represents the whole object instead of a particular import.
async: false,
};
// $FlowFixMe[incompatible-call] found when upgrading Flow
module.exports = new Proxy(moduleReference, proxyHandlers);
};

Expand Down
3 changes: 2 additions & 1 deletion scripts/flow/config/flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ untyped-type-import=error
%CI_MAX_WORKERS%
exact_by_default=true
munge_underscores=false
inference_mode=classic

# Substituted by createFlowConfig.js:
%REACT_RENDERER_FLOW_OPTIONS%

[version]
^0.182.0
^0.185.0
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7912,10 +7912,10 @@ flatted@^2.0.0:
resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138"
integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==

flow-bin@^0.182.0:
version "0.182.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.182.0.tgz#1dacbd72465743670412ada015d3182deda6f966"
integrity sha512-Ux90c2sMfoV/VVjOEFT2OHFJFnyfoIbTK/5AKAMnU4Skfru1G+FyS5YLu3XxQl0R6mpA9+rrFlPfYZq/5B+J3w==
flow-bin@^0.185.0:
version "0.185.2"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.185.2.tgz#b45a07d45cf641198e86e47848e35f64b0688c4c"
integrity sha512-Vphs8Z4Qo17dzlPKe/l8M85JvGn1Tf5NV6xESZLg8p9ktdIbNUYaxnq/WBQPoESiLrGdrC2v+rfezfh3tvxkvQ==

fluent-syntax@0.13.0:
version "0.13.0"
Expand Down