Flow upgrade to 0.155
This version banned use of this in object functions. ghstack-source-id: f49fd5e1b7732cea1ec75e71f2611f0ffa19e80d Pull Request resolved: https://github.com/facebook/react/pull/25414
Jan Kassens committed
Oct 4, 2022 at 11:39 UTC
338e6a967ccbdde156559b00e17ffcc7319533fc
6 files changed
+33
-6
package.json
+1
-1
@@ -63,7 +63,7 @@
63
"eslint-plugin-react-internal": "link:./scripts/eslint-rules",
64
"fbjs-scripts": "1.2.0",
65
"filesize": "^6.0.1",
66
- "flow-bin": "^0.154.0",
66
+ "flow-bin": "^0.155.0",
67
"glob": "^7.1.6",
68
"glob-stream": "^6.1.0",
69
"google-closure-compiler": "^20200517.0.0",
packages/react-devtools-shared/src/backend/legacy/renderer.js
+9
@@ -218,10 +218,12 @@ export function attach(
218
const internalInstance = args[0];
219
const hostContainerInfo = args[3];
220
if (getElementType(internalInstance) === ElementTypeOtherOrUnknown) {
221
+ // $FlowFixMe[object-this-reference] found when upgrading Flow
222
return fn.apply(this, args);
223
}
224
if (hostContainerInfo._topLevelWrapper === undefined) {
225
// SSR
226
+ // $FlowFixMe[object-this-reference] found when upgrading Flow
227
return fn.apply(this, args);
228
}
229
@@ -241,6 +243,7 @@ export function attach(
243
);
244
245
try {
246
+ // $FlowFixMe[object-this-reference] found when upgrading Flow
247
const result = fn.apply(this, args);
248
parentIDStack.pop();
249
return result;
@@ -260,6 +263,7 @@ export function attach(
263
performUpdateIfNecessary(fn, args) {
264
const internalInstance = args[0];
265
if (getElementType(internalInstance) === ElementTypeOtherOrUnknown) {
266
+ // $FlowFixMe[object-this-reference] found when upgrading Flow
267
return fn.apply(this, args);
268
}
269
@@ -268,6 +272,7 @@ export function attach(
272
273
const prevChildren = getChildren(internalInstance);
274
try {
275
+ // $FlowFixMe[object-this-reference] found when upgrading Flow
276
const result = fn.apply(this, args);
277
278
const nextChildren = getChildren(internalInstance);
@@ -294,6 +299,7 @@ export function attach(
299
receiveComponent(fn, args) {
300
const internalInstance = args[0];
301
if (getElementType(internalInstance) === ElementTypeOtherOrUnknown) {
302
+ // $FlowFixMe[object-this-reference] found when upgrading Flow
303
return fn.apply(this, args);
304
}
305
@@ -302,6 +308,7 @@ export function attach(
308
309
const prevChildren = getChildren(internalInstance);
310
try {
311
+ // $FlowFixMe[object-this-reference] found when upgrading Flow
312
const result = fn.apply(this, args);
313
314
const nextChildren = getChildren(internalInstance);
@@ -328,12 +335,14 @@ export function attach(
335
unmountComponent(fn, args) {
336
const internalInstance = args[0];
337
if (getElementType(internalInstance) === ElementTypeOtherOrUnknown) {
338
+ // $FlowFixMe[object-this-reference] found when upgrading Flow
339
return fn.apply(this, args);
340
}
341
342
const id = getID(internalInstance);
343
parentIDStack.push(id);
344
try {
345
+ // $FlowFixMe[object-this-reference] found when upgrading Flow
346
const result = fn.apply(this, args);
347
parentIDStack.pop();
348
packages/react-fetch/src/ReactFetchBrowser.js
+9
@@ -98,27 +98,36 @@ Response.prototype = {
98
constructor: Response,
99
arrayBuffer() {
100
return readRecordValue(
101
+ // $FlowFixMe[object-this-reference] found when upgrading Flow
102
this._arrayBuffer ||
103
+ // $FlowFixMe[object-this-reference] found when upgrading Flow
104
(this._arrayBuffer = createRecordFromThenable(
105
+ // $FlowFixMe[object-this-reference] found when upgrading Flow
106
this._response.arrayBuffer(),
107
)),
108
);
109
},
110
blob() {
111
return readRecordValue(
112
+ // $FlowFixMe[object-this-reference] found when upgrading Flow
113
this._blob ||
114
+ // $FlowFixMe[object-this-reference] found when upgrading Flow
115
(this._blob = createRecordFromThenable(this._response.blob())),
116
);
117
},
118
json() {
119
return readRecordValue(
120
+ // $FlowFixMe[object-this-reference] found when upgrading Flow
121
this._json ||
122
+ // $FlowFixMe[object-this-reference] found when upgrading Flow
123
(this._json = createRecordFromThenable(this._response.json())),
124
);
125
},
126
text() {
127
return readRecordValue(
128
+ // $FlowFixMe[object-this-reference] found when upgrading Flow
129
this._text ||
130
+ // $FlowFixMe[object-this-reference] found when upgrading Flow
131
(this._text = createRecordFromThenable(this._response.text())),
132
);
133
},
packages/react-fetch/src/ReactFetchNode.js
+9
@@ -143,6 +143,7 @@ function Response(nativeResponse) {
143
Response.prototype = {
144
constructor: Response,
145
arrayBuffer() {
146
+ // $FlowFixMe[object-this-reference] found when upgrading Flow
147
const buffer = readRecordValue(this._bufferRecord);
148
return buffer;
149
},
@@ -151,20 +152,28 @@ Response.prototype = {
152
throw new Error('Not implemented.');
153
},
154
json() {
155
+ // $FlowFixMe[object-this-reference] found when upgrading Flow
156
if (this._json !== null) {
157
+ // $FlowFixMe[object-this-reference] found when upgrading Flow
158
return this._json;
159
}
160
+ // $FlowFixMe[object-this-reference] found when upgrading Flow
161
const buffer = readRecordValue(this._bufferRecord);
162
const json = JSON.parse(buffer.toString());
163
+ // $FlowFixMe[object-this-reference] found when upgrading Flow
164
this._json = json;
165
return json;
166
},
167
text() {
168
+ // $FlowFixMe[object-this-reference] found when upgrading Flow
169
if (this._text !== null) {
170
+ // $FlowFixMe[object-this-reference] found when upgrading Flow
171
return this._text;
172
}
173
+ // $FlowFixMe[object-this-reference] found when upgrading Flow
174
const buffer = readRecordValue(this._bufferRecord);
175
const text = buffer.toString();
176
+ // $FlowFixMe[object-this-reference] found when upgrading Flow
177
this._text = text;
178
return text;
179
},
scripts/flow/config/flowconfig
+1
-1
@@ -47,4 +47,4 @@ munge_underscores=false
47
%REACT_RENDERER_FLOW_OPTIONS%
48
49
[version]
50
-^0.154.0
50
+^0.155.0
yarn.lock
+4
-4
@@ -7912,10 +7912,10 @@ flatted@^2.0.0:
7912
resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138"
7913
integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==
7914
7915
-flow-bin@^0.154.0:
7916
- version "0.154.0"
7917
- resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.154.0.tgz#e086964398e671daa8f56ed8663d7876337f77e5"
7918
- integrity sha512-I6u2ETdkAyard+8C5na6bfZp4EM0zIMB7O5zH4GKzBLv9/y8/NYRTxEXQe5T0hvj9R9DxFBUoPsFK76ziweUFw==
7915
+flow-bin@^0.155.0:
7916
+ version "0.155.1"
7917
+ resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.155.1.tgz#1263ee3e0f42d11cb13ba56c3851a096213ce5f7"
7918
+ integrity sha512-qy2eXkgngR6u+MYA1ydzPnclhos21BZlpkJ50Y9YOZ4eTMq6txswB3X+gUsg8XUyCteLoMeo7n30k7aY2no2Yw==
7919
7920
fluent-syntax@0.13.0:
7921
version "0.13.0"