Skip to content

Commit 338e6a9

Browse files
committed
Flow upgrade to 0.155
This version banned use of this in object functions. ghstack-source-id: f49fd5e Pull Request resolved: #25414
1 parent 8bc95bb commit 338e6a9

File tree

6 files changed

+33
-6
lines changed

6 files changed

+33
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"eslint-plugin-react-internal": "link:./scripts/eslint-rules",
6464
"fbjs-scripts": "1.2.0",
6565
"filesize": "^6.0.1",
66-
"flow-bin": "^0.154.0",
66+
"flow-bin": "^0.155.0",
6767
"glob": "^7.1.6",
6868
"glob-stream": "^6.1.0",
6969
"google-closure-compiler": "^20200517.0.0",

packages/react-devtools-shared/src/backend/legacy/renderer.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,12 @@ export function attach(
218218
const internalInstance = args[0];
219219
const hostContainerInfo = args[3];
220220
if (getElementType(internalInstance) === ElementTypeOtherOrUnknown) {
221+
// $FlowFixMe[object-this-reference] found when upgrading Flow
221222
return fn.apply(this, args);
222223
}
223224
if (hostContainerInfo._topLevelWrapper === undefined) {
224225
// SSR
226+
// $FlowFixMe[object-this-reference] found when upgrading Flow
225227
return fn.apply(this, args);
226228
}
227229

@@ -241,6 +243,7 @@ export function attach(
241243
);
242244

243245
try {
246+
// $FlowFixMe[object-this-reference] found when upgrading Flow
244247
const result = fn.apply(this, args);
245248
parentIDStack.pop();
246249
return result;
@@ -260,6 +263,7 @@ export function attach(
260263
performUpdateIfNecessary(fn, args) {
261264
const internalInstance = args[0];
262265
if (getElementType(internalInstance) === ElementTypeOtherOrUnknown) {
266+
// $FlowFixMe[object-this-reference] found when upgrading Flow
263267
return fn.apply(this, args);
264268
}
265269

@@ -268,6 +272,7 @@ export function attach(
268272

269273
const prevChildren = getChildren(internalInstance);
270274
try {
275+
// $FlowFixMe[object-this-reference] found when upgrading Flow
271276
const result = fn.apply(this, args);
272277

273278
const nextChildren = getChildren(internalInstance);
@@ -294,6 +299,7 @@ export function attach(
294299
receiveComponent(fn, args) {
295300
const internalInstance = args[0];
296301
if (getElementType(internalInstance) === ElementTypeOtherOrUnknown) {
302+
// $FlowFixMe[object-this-reference] found when upgrading Flow
297303
return fn.apply(this, args);
298304
}
299305

@@ -302,6 +308,7 @@ export function attach(
302308

303309
const prevChildren = getChildren(internalInstance);
304310
try {
311+
// $FlowFixMe[object-this-reference] found when upgrading Flow
305312
const result = fn.apply(this, args);
306313

307314
const nextChildren = getChildren(internalInstance);
@@ -328,12 +335,14 @@ export function attach(
328335
unmountComponent(fn, args) {
329336
const internalInstance = args[0];
330337
if (getElementType(internalInstance) === ElementTypeOtherOrUnknown) {
338+
// $FlowFixMe[object-this-reference] found when upgrading Flow
331339
return fn.apply(this, args);
332340
}
333341

334342
const id = getID(internalInstance);
335343
parentIDStack.push(id);
336344
try {
345+
// $FlowFixMe[object-this-reference] found when upgrading Flow
337346
const result = fn.apply(this, args);
338347
parentIDStack.pop();
339348

packages/react-fetch/src/ReactFetchBrowser.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,27 +98,36 @@ Response.prototype = {
9898
constructor: Response,
9999
arrayBuffer() {
100100
return readRecordValue(
101+
// $FlowFixMe[object-this-reference] found when upgrading Flow
101102
this._arrayBuffer ||
103+
// $FlowFixMe[object-this-reference] found when upgrading Flow
102104
(this._arrayBuffer = createRecordFromThenable(
105+
// $FlowFixMe[object-this-reference] found when upgrading Flow
103106
this._response.arrayBuffer(),
104107
)),
105108
);
106109
},
107110
blob() {
108111
return readRecordValue(
112+
// $FlowFixMe[object-this-reference] found when upgrading Flow
109113
this._blob ||
114+
// $FlowFixMe[object-this-reference] found when upgrading Flow
110115
(this._blob = createRecordFromThenable(this._response.blob())),
111116
);
112117
},
113118
json() {
114119
return readRecordValue(
120+
// $FlowFixMe[object-this-reference] found when upgrading Flow
115121
this._json ||
122+
// $FlowFixMe[object-this-reference] found when upgrading Flow
116123
(this._json = createRecordFromThenable(this._response.json())),
117124
);
118125
},
119126
text() {
120127
return readRecordValue(
128+
// $FlowFixMe[object-this-reference] found when upgrading Flow
121129
this._text ||
130+
// $FlowFixMe[object-this-reference] found when upgrading Flow
122131
(this._text = createRecordFromThenable(this._response.text())),
123132
);
124133
},

packages/react-fetch/src/ReactFetchNode.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ function Response(nativeResponse) {
143143
Response.prototype = {
144144
constructor: Response,
145145
arrayBuffer() {
146+
// $FlowFixMe[object-this-reference] found when upgrading Flow
146147
const buffer = readRecordValue(this._bufferRecord);
147148
return buffer;
148149
},
@@ -151,20 +152,28 @@ Response.prototype = {
151152
throw new Error('Not implemented.');
152153
},
153154
json() {
155+
// $FlowFixMe[object-this-reference] found when upgrading Flow
154156
if (this._json !== null) {
157+
// $FlowFixMe[object-this-reference] found when upgrading Flow
155158
return this._json;
156159
}
160+
// $FlowFixMe[object-this-reference] found when upgrading Flow
157161
const buffer = readRecordValue(this._bufferRecord);
158162
const json = JSON.parse(buffer.toString());
163+
// $FlowFixMe[object-this-reference] found when upgrading Flow
159164
this._json = json;
160165
return json;
161166
},
162167
text() {
168+
// $FlowFixMe[object-this-reference] found when upgrading Flow
163169
if (this._text !== null) {
170+
// $FlowFixMe[object-this-reference] found when upgrading Flow
164171
return this._text;
165172
}
173+
// $FlowFixMe[object-this-reference] found when upgrading Flow
166174
const buffer = readRecordValue(this._bufferRecord);
167175
const text = buffer.toString();
176+
// $FlowFixMe[object-this-reference] found when upgrading Flow
168177
this._text = text;
169178
return text;
170179
},

scripts/flow/config/flowconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ munge_underscores=false
4747
%REACT_RENDERER_FLOW_OPTIONS%
4848

4949
[version]
50-
^0.154.0
50+
^0.155.0

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7912,10 +7912,10 @@ flatted@^2.0.0:
79127912
resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.2.tgz#4575b21e2bcee7434aa9be662f4b7b5f9c2b5138"
79137913
integrity sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==
79147914

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==
79197919

79207920
79217921
version "0.13.0"

0 commit comments

Comments
 (0)