Skip to content

Commit

Permalink
Upgrade Flow to 0.201 (#26326)
Browse files Browse the repository at this point in the history
Small Flow upgrade to keep us current.
  • Loading branch information
kassens committed Mar 6, 2023
1 parent eb616a1 commit 4bbac04
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 26 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@
"eslint-plugin-react-internal": "link:./scripts/eslint-rules",
"fbjs-scripts": "^3.0.1",
"filesize": "^6.0.1",
"flow-bin": "^0.199.1",
"flow-remove-types": "^2.198.2",
"flow-bin": "^0.201.0",
"flow-remove-types": "^2.201.0",
"glob": "^7.1.6",
"glob-stream": "^6.1.0",
"google-closure-compiler": "^20230206.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-devtools-extensions/src/backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function setup(hook: any) {
const setupNativeStyleEditor =
require('react-devtools-shared/src/backend/NativeStyleEditor/setupNativeStyleEditor').default;

const bridge = new Bridge({
const bridge = new Bridge<$FlowFixMe, $FlowFixMe>({
listen(fn) {
const listener = (event: $FlowFixMe) => {
if (
Expand Down
2 changes: 1 addition & 1 deletion packages/react-devtools-shell/src/app/console.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function ignoreStrings(
stringsToIgnore: Array<string>,
): void {
// $FlowFixMe[prop-missing] index access only allowed for objects with index keys
console[methodName] = (...args) => {
console[methodName] = (...args: $ReadOnlyArray<mixed>) => {
const maybeString = args[0];
if (typeof maybeString === 'string') {
for (let i = 0; i < stringsToIgnore.length; i++) {
Expand Down
3 changes: 1 addition & 2 deletions packages/react-reconciler/src/ReactFiberClassUpdateQueue.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ export const CaptureUpdate = 3;
let hasForceUpdate = false;

let didWarnUpdateInsideUpdate;
let currentlyProcessingQueue;
let currentlyProcessingQueue: ?SharedQueue<$FlowFixMe>;
export let resetCurrentlyProcessingQueue: () => void;
if (__DEV__) {
didWarnUpdateInsideUpdate = false;
Expand Down Expand Up @@ -475,7 +475,6 @@ export function processUpdateQueue<State>(
hasForceUpdate = false;

if (__DEV__) {
// $FlowFixMe[escaped-generic] discovered when updating Flow
currentlyProcessingQueue = queue.shared;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/react-reconciler/src/ReactFiberHooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export type UpdateQueue<S, A> = {
};

let didWarnAboutMismatchedHooksForComponent;
let didWarnUncachedGetSnapshot;
let didWarnUncachedGetSnapshot: void | true;
let didWarnAboutUseWrappedInTryCatch;
if (__DEV__) {
didWarnAboutMismatchedHooksForComponent = new Set<string | null>();
Expand Down
4 changes: 2 additions & 2 deletions packages/react-refresh/src/ReactFreshRuntime.js
Original file line number Diff line number Diff line change
Expand Up @@ -642,8 +642,8 @@ export function createSignatureFunctionForTransform(): <T>(
getCustomHooks?: () => Array<Function>,
) => T | void {
if (__DEV__) {
let savedType;
let hasCustomHooks;
let savedType: mixed;
let hasCustomHooks: boolean;
let didCollectHooks = false;
return function <T>(
type: T,
Expand Down
2 changes: 2 additions & 0 deletions packages/react-server/src/ReactFlightServerConfigStream.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ export function processModelChunk(
id: number,
model: ReactModel,
): Chunk {
// $FlowFixMe[incompatible-type] stringify can return null
const json: string = stringify(model, request.toJSON);
const row = id.toString(16) + ':' + json + '\n';
return stringToChunk(row);
Expand All @@ -146,6 +147,7 @@ export function processImportChunk(
id: number,
clientReferenceMetadata: ReactModel,
): Chunk {
// $FlowFixMe[incompatible-type] stringify can return null
const json: string = stringify(clientReferenceMetadata);
const row = serializeRowHeader('I', id) + json + '\n';
return stringToChunk(row);
Expand Down
2 changes: 1 addition & 1 deletion scripts/flow/config/flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ inference_mode=experimental.lti
%REACT_RENDERER_FLOW_OPTIONS%

[version]
^0.199.1
^0.201.0
32 changes: 16 additions & 16 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8180,22 +8180,22 @@ flatted@^3.1.0:
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787"
integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==

flow-bin@^0.199.1:
version "0.199.1"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.199.1.tgz#678eac2303fa898227f4d103264b6ce49f4430c1"
integrity sha512-Ic0Mp9iZ2exbH0mNj/XhzUWPZa9JylHb6uQARZnnYCTRwumOpjNOP0qwyRTltWrbCpfHjnWngNO9VLaVKHz2aQ==

flow-parser@^0.198.2:
version "0.198.2"
resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.198.2.tgz#4c225995896b6be75943e9358e606a4fd86c87d9"
integrity sha512-tCQzqXbRAz0ZadIhAXGwdp/xsusADo8IK9idgc/2qCK5RmazbKDGedyykfRtzWgy7Klt4f4NZxq0o/wFUg6plQ==

flow-remove-types@^2.198.2:
version "2.198.2"
resolved "https://registry.yarnpkg.com/flow-remove-types/-/flow-remove-types-2.198.2.tgz#1b9e0e32eead4554f0d325391bbeb0c7a2a2993f"
integrity sha512-l7ua9FnZwI0HUUUu2Khj3pYnGSlkY5vOE60bgG1ajPJ9P+KzRgXIjpCaS4iTbUEpu6olzRrAVJtJ5N8kxmvpiQ==
dependencies:
flow-parser "^0.198.2"
flow-bin@^0.201.0:
version "0.201.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.201.0.tgz#bc8d7c3687526313d7a24dd920873a0273148d81"
integrity sha512-fqx6CMOhX9Xm4mN+tq/c7sqcm8aHFV1ipbLz2ZCzoNcPuUNZPoSVYm4p0qZqH0HyzMMEP1OWlU7dIkuSJ02cpg==

flow-parser@^0.201.0:
version "0.201.0"
resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.201.0.tgz#d2005d4dae6fddf60d30f9ae0fb49a13c9c51cfe"
integrity sha512-G4oeDNpNGyIrweF9EnoHatncAihMT0tQgV6NMdyM5I7fhrz9Pr13PJ2KLQ673O4wj9KooTdBpeeYHdDNAQoyyw==

flow-remove-types@^2.201.0:
version "2.201.0"
resolved "https://registry.yarnpkg.com/flow-remove-types/-/flow-remove-types-2.201.0.tgz#d02d8a3ff3cb17d23da35c9786b02cdccc0ef9b8"
integrity sha512-EaS6Q0ApEjFdwD/JtBC1Hm+0j6mMsHeV5FR6MP+UI1RdTeNMdadMITt0Vb3XPBANLXZufaNzs6EMwpGNPzwwoA==
dependencies:
flow-parser "^0.201.0"
pirates "^3.0.2"
vlq "^0.2.1"

Expand Down

0 comments on commit 4bbac04

Please sign in to comment.