Skip to content

Commit d73b6f1

Browse files
authored
Update Flow to 0.261 (facebook#34255)
- 0.261 required to pull out a constant to preserve refinement - 0.259 needed some updated suppressions for hacky stuff
1 parent d5586e2 commit d73b6f1

File tree

10 files changed

+19
-18
lines changed

10 files changed

+19
-18
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@
7373
"eslint-plugin-react-internal": "link:./scripts/eslint-rules",
7474
"fbjs-scripts": "^3.0.1",
7575
"filesize": "^6.0.1",
76-
"flow-bin": "^0.258",
77-
"flow-remove-types": "^2.258",
76+
"flow-bin": "^0.261",
77+
"flow-remove-types": "^2.261",
7878
"glob": "^7.1.6",
7979
"glob-stream": "^6.1.0",
8080
"google-closure-compiler": "^20230206.0.0",

packages/react-client/src/ReactFlightReplyClient.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1183,7 +1183,7 @@ function bind(this: Function): Function {
11831183
const referenceClosure = knownServerReferences.get(this);
11841184

11851185
if (!referenceClosure) {
1186-
// $FlowFixMe[prop-missing]
1186+
// $FlowFixMe[incompatible-call]
11871187
return FunctionBind.apply(this, arguments);
11881188
}
11891189

packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2991,15 +2991,16 @@ FragmentInstance.prototype.unobserveUsing = function (
29912991
this: FragmentInstanceType,
29922992
observer: IntersectionObserver | ResizeObserver,
29932993
): void {
2994-
if (this._observers === null || !this._observers.has(observer)) {
2994+
const observers = this._observers;
2995+
if (observers === null || !observers.has(observer)) {
29952996
if (__DEV__) {
29962997
console.error(
29972998
'You are calling unobserveUsing() with an observer that is not being observed with this fragment ' +
29982999
'instance. First attach the observer with observeUsing()',
29993000
);
30003001
}
30013002
} else {
3002-
this._observers.delete(observer);
3003+
observers.delete(observer);
30033004
traverseFragmentInstance(this._fragmentFiber, unobserveChild, observer);
30043005
}
30053006
};

packages/react-native-renderer/src/ReactFiberConfigFabric.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -651,15 +651,16 @@ FragmentInstance.prototype.unobserveUsing = function (
651651
this: FragmentInstanceType,
652652
observer: IntersectionObserver,
653653
): void {
654-
if (this._observers === null || !this._observers.has(observer)) {
654+
const observers = this._observers;
655+
if (observers === null || !observers.has(observer)) {
655656
if (__DEV__) {
656657
console.error(
657658
'You are calling unobserveUsing() with an observer that is not being observed with this fragment ' +
658659
'instance. First attach the observer with observeUsing()',
659660
);
660661
}
661662
} else {
662-
this._observers.delete(observer);
663+
observers.delete(observer);
663664
traverseFragmentInstance(this._fragmentFiber, unobserveChild, observer);
664665
}
665666
};

packages/react-server-dom-esm/src/ReactFlightESMReferences.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const FunctionBind = Function.prototype.bind;
4949
// $FlowFixMe[method-unbinding]
5050
const ArraySlice = Array.prototype.slice;
5151
function bind(this: ServerReference<any>): any {
52-
// $FlowFixMe[prop-missing]
52+
// $FlowFixMe[incompatible-call]
5353
const newFn = FunctionBind.apply(this, arguments);
5454
if (this.$$typeof === SERVER_REFERENCE_TAG) {
5555
if (__DEV__) {

packages/react-server-dom-parcel/src/ReactFlightParcelReferences.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const FunctionBind = Function.prototype.bind;
5656
// $FlowFixMe[method-unbinding]
5757
const ArraySlice = Array.prototype.slice;
5858
function bind(this: ServerReference<any>): any {
59-
// $FlowFixMe[prop-missing]
59+
// $FlowFixMe[incompatible-call]
6060
const newFn = FunctionBind.apply(this, arguments);
6161
if (this.$$typeof === SERVER_REFERENCE_TAG) {
6262
if (__DEV__) {

packages/react-server-dom-turbopack/src/ReactFlightTurbopackReferences.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const FunctionBind = Function.prototype.bind;
6363
// $FlowFixMe[method-unbinding]
6464
const ArraySlice = Array.prototype.slice;
6565
function bind(this: ServerReference<any>): any {
66-
// $FlowFixMe[prop-missing]
66+
// $FlowFixMe[incompatible-call]
6767
const newFn = FunctionBind.apply(this, arguments);
6868
if (this.$$typeof === SERVER_REFERENCE_TAG) {
6969
if (__DEV__) {

packages/react-server-dom-webpack/src/ReactFlightWebpackReferences.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ const FunctionBind = Function.prototype.bind;
6363
// $FlowFixMe[method-unbinding]
6464
const ArraySlice = Array.prototype.slice;
6565
function bind(this: ServerReference<any>): any {
66-
// $FlowFixMe[unsupported-syntax]
67-
// $FlowFixMe[prop-missing]
66+
// $FlowFixMe[incompatible-call]
6867
const newFn = FunctionBind.apply(this, arguments);
6968
if (this.$$typeof === SERVER_REFERENCE_TAG) {
7069
if (__DEV__) {

packages/react-server/src/ReactFlightServer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ function patchConsole(consoleInst: typeof console, methodName: string) {
408408

409409
emitConsoleChunk(request, methodName, owner, env, stack, args);
410410
}
411-
// $FlowFixMe[prop-missing]
411+
// $FlowFixMe[incompatible-call]
412412
return originalMethod.apply(this, arguments);
413413
};
414414
if (originalName) {

yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9108,12 +9108,12 @@ flatted@^3.2.9:
91089108
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.3.1.tgz#21db470729a6734d4997002f439cb308987f567a"
91099109
integrity sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==
91109110

9111-
flow-bin@^0.258:
9112-
version "0.258.1"
9113-
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.258.1.tgz#5580e6085196800487dae67a71777b572d0c9552"
9114-
integrity sha512-v08KZw8jiwhA01V59kuCLd628kDJ0ZTX4jguh0P2rboF9rMlGmV8Rd+io1f1U9nWGoORTP2ZUI27X42jFA6eDQ==
9111+
flow-bin@^0.261:
9112+
version "0.261.2"
9113+
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.261.2.tgz#8558c965950f8e38872ea21f66bf04932da2380b"
9114+
integrity sha512-lTYA05K4obAjyrrX4in3sLZyAECSFCDwQiGpZHJLm8ldCk+qcW11Wcxq/CdvyQAOPR7Kpb5BPRSaj4hwEXIAUw==
91159115

9116-
flow-remove-types@^2.258:
9116+
flow-remove-types@^2.261:
91179117
version "2.279.0"
91189118
resolved "https://registry.yarnpkg.com/flow-remove-types/-/flow-remove-types-2.279.0.tgz#3a3388d9158eba0f82c40d80d31d9640b883a3f5"
91199119
integrity sha512-bPFloMR/A2b/r/sIsf7Ix0LaMicCJNjwhXc4xEEQVzJCIz5u7C7XDaEOXOiqveKlCYK7DcBNn6R01Cbbc9gsYA==

0 commit comments

Comments
 (0)