Skip to content

Commit 1382a3d

Browse files
authored
chore: bump React Native to 0.60 (#204)
1 parent b8fb6b5 commit 1382a3d

File tree

9 files changed

+1227
-924
lines changed

9 files changed

+1227
-924
lines changed

.flowconfig

Lines changed: 51 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,36 @@
22
; We fork some components by platform
33
.*/*[.]android.js
44

5+
; Ignore "BUCK" generated dirs
6+
<PROJECT_ROOT>/\.buckd/
7+
8+
; Ignore unexpected extra "@providesModule"
9+
.*/node_modules/.*/node_modules/fbjs/.*
10+
511
; Ignore duplicate module providers
612
; For RN Apps installed via npm, "Libraries" folder is inside
713
; "node_modules/react-native" but in the source repo it is in the root
8-
.*/Libraries/react-native/React.js
14+
node_modules/react-native/Libraries/react-native/React.js
15+
16+
; Ignore polyfills
17+
node_modules/react-native/Libraries/polyfills/.*
18+
19+
; These should not be required directly
20+
; require from fbjs/lib instead: require('fbjs/lib/warning')
21+
node_modules/warning/.*
22+
23+
; Flow doesn't support platforms
24+
.*/Libraries/Utilities/HMRLoadingView.js
25+
26+
[untyped]
27+
.*/node_modules/@react-native-community/cli/.*/.*
28+
.*/node_modules/react-native/Libraries/Lists/SectionList.js
929

1030
[include]
1131

1232
[libs]
1333
node_modules/react-native/Libraries/react-native/react-native-interface.js
1434
node_modules/react-native/flow/
15-
node_modules/react-native/flow-github/
1635
flow-typed
1736

1837
[options]
@@ -21,6 +40,10 @@ emoji=true
2140
esproposal.optional_chaining=enable
2241
esproposal.nullish_coalescing=enable
2342

43+
module.file_ext=.js
44+
module.file_ext=.json
45+
module.file_ext=.ios.js
46+
2447
module.system=haste
2548
module.system.haste.use_name_reducers=true
2649
# get basename
@@ -33,45 +56,43 @@ module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
3356
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
3457
module.system.haste.paths.blacklist=.*/__tests__/.*
3558
module.system.haste.paths.blacklist=.*/__mocks__/.*
36-
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
3759
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
60+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/RNTester/.*
61+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/IntegrationTests/.*
62+
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/react-native/react-native-implementation.js
63+
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
3864

3965
munge_underscores=true
4066

4167
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
4268

43-
module.file_ext=.js
44-
module.file_ext=.jsx
45-
module.file_ext=.json
46-
module.file_ext=.native.js
47-
4869
suppress_type=$FlowIssue
4970
suppress_type=$FlowFixMe
5071
suppress_type=$FlowFixMeProps
5172
suppress_type=$FlowFixMeState
5273

53-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
54-
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
55-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
74+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
75+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
5676
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
5777

58-
include_warnings=true
78+
[lints]
79+
sketchy-null-number=warn
80+
sketchy-null-mixed=warn
81+
sketchy-number=warn
82+
untyped-type-import=warn
83+
nonstrict-import=warn
84+
deprecated-type=warn
85+
unsafe-getters-setters=warn
86+
inexact-spread=warn
87+
unnecessary-invariant=warn
88+
signature-verification-failure=warn
89+
deprecated-utility=error
5990

60-
[untyped]
61-
; bugs in react-native typings
62-
.*/Libraries/Components/Navigation/NavigatorIOS.ios.js
63-
.*/Libraries/Components/View/ViewPropTypes.js
64-
.*/Libraries/Components/ActivityIndicator/ActivityIndicator.js
65-
.*/Libraries/Components/Slider/Slider.js
66-
.*/Libraries/Components/Touchable/TouchableHighlight.js
67-
.*/Libraries/Components/Touchable/TouchableOpacity.js
68-
.*/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js
69-
.*/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js
70-
.*/Libraries/Image/Image.ios.js
71-
.*/Libraries/Text/Text.js
72-
.*/Libraries/LayoutAnimation/LayoutAnimation.js
73-
.*/Libraries/Lists/VirtualizedSectionList.js
74-
.*/Libraries/StyleSheet/processTransform.js
75-
.*/Libraries/StyleSheet/StyleSheetValidation.js
76-
.*/Libraries/Text/TextAncestor.js
77-
.*/Libraries/YellowBox/UI/YellowBoxList.js
91+
[strict]
92+
deprecated-type
93+
nonstrict-import
94+
sketchy-null
95+
unclear-type
96+
unsafe-getters-setters
97+
untyped-import
98+
untyped-type-import

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,16 @@
2727
"conventional-changelog-cli": "^2.0.11",
2828
"dedent": "^0.7.0",
2929
"eslint": "^5.15.2",
30-
"flow-bin": "^0.102.0",
30+
"flow-bin": "^0.98.0",
3131
"flow-copy-source": "^2.0.6",
3232
"jest": "^24.7.1",
3333
"metro-react-native-babel-preset": "^0.52.0",
34-
"react": "^16.8.3",
35-
"react-native": "^0.59.8",
36-
"react-test-renderer": "^16.8.3",
37-
"release-it": "^12.1.0",
38-
"strip-ansi": "^5.0.0",
39-
"typescript": "^3.1.1"
34+
"react": "16.8.6",
35+
"react-native": "0.60.3",
36+
"react-test-renderer": "16.8.6",
37+
"release-it": "^12.3.3",
38+
"strip-ansi": "^5.2.0",
39+
"typescript": "^3.5.3"
4040
},
4141
"dependencies": {
4242
"pretty-format": "^24.0.0"

src/__tests__/__snapshots__/debug.test.js.snap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ exports[`debug 1`] = `
1414
exports[`debug.deep 1`] = `
1515
"<View
1616
accessible={true}
17+
clickable={true}
1718
isTVSelectable={true}
19+
onClick={[Function bound touchableHandlePress]}
1820
onResponderGrant={[Function bound touchableHandleResponderGrant]}
1921
onResponderMove={[Function bound touchableHandleResponderMove]}
2022
onResponderRelease={[Function bound touchableHandleResponderRelease]}
@@ -36,7 +38,9 @@ exports[`debug.deep 1`] = `
3638
exports[`debug.deep async test 1`] = `
3739
"<View
3840
accessible={true}
41+
clickable={true}
3942
isTVSelectable={true}
43+
onClick={[Function bound touchableHandlePress]}
4044
onResponderGrant={[Function bound touchableHandleResponderGrant]}
4145
onResponderMove={[Function bound touchableHandleResponderMove]}
4246
onResponderRelease={[Function bound touchableHandleResponderRelease]}

src/__tests__/__snapshots__/render.test.js.snap

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ exports[`debug 1`] = `
2828
/>
2929
<View
3030
accessible={true}
31+
clickable={true}
3132
isTVSelectable={true}
33+
onClick={[Function bound touchableHandlePress]}
3234
onResponderGrant={[Function bound touchableHandleResponderGrant]}
3335
onResponderMove={[Function bound touchableHandleResponderMove]}
3436
onResponderRelease={[Function bound touchableHandleResponderRelease]}
@@ -86,7 +88,9 @@ exports[`debug changing component: bananaFresh button message should now be "fre
8688
/>
8789
<View
8890
accessible={true}
91+
clickable={true}
8992
isTVSelectable={true}
93+
onClick={[Function bound touchableHandlePress]}
9094
onResponderGrant={[Function bound touchableHandleResponderGrant]}
9195
onResponderMove={[Function bound touchableHandleResponderMove]}
9296
onResponderRelease={[Function bound touchableHandleResponderRelease]}
@@ -238,7 +242,9 @@ exports[`debug: with message 1`] = `
238242
/>
239243
<View
240244
accessible={true}
245+
clickable={true}
241246
isTVSelectable={true}
247+
onClick={[Function bound touchableHandlePress]}
242248
onResponderGrant={[Function bound touchableHandleResponderGrant]}
243249
onResponderMove={[Function bound touchableHandleResponderMove]}
244250
onResponderRelease={[Function bound touchableHandleResponderRelease]}
@@ -271,7 +277,9 @@ exports[`debug: with message 1`] = `
271277
exports[`toJSON 1`] = `
272278
<View
273279
accessible={true}
280+
clickable={false}
274281
isTVSelectable={true}
282+
onClick={[Function]}
275283
onResponderGrant={[Function]}
276284
onResponderMove={[Function]}
277285
onResponderRelease={[Function]}

src/__tests__/__snapshots__/shallow.test.js.snap

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

33
exports[`shallow rendering React Test Instance 1`] = `
4-
<TouchableText
5-
accessible={true}
6-
allowFontScaling={true}
7-
ellipsizeMode="tail"
8-
forwardedRef={null}
4+
<Text
95
testID="text-button"
106
>
117
Press me
12-
</TouchableText>
8+
</Text>
139
`;
1410

1511
exports[`shallow rendering React elements 1`] = `

src/__tests__/debug.test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ test('debug', () => {
3636
const component = <Button onPress={jest.fn} text="Press me" />;
3737
debug(component);
3838

39-
const output = (console.log: ConsoleLogMock).mock.calls[0][0];
39+
const output = ((console.log: any): ConsoleLogMock).mock.calls[0][0];
4040

4141
expect(stripAnsi(output)).not.toEqual(output);
4242
expect(stripAnsi(output)).toMatchSnapshot();
4343

44-
(console.log: ConsoleLogMock).mockReset();
44+
((console.log: any): ConsoleLogMock).mockReset();
4545

4646
debug(component, 'test message');
4747

@@ -58,12 +58,12 @@ test('debug.deep', () => {
5858
const component = <Button onPress={jest.fn} text="Press me" />;
5959
debug.deep(component);
6060

61-
const output = (console.log: ConsoleLogMock).mock.calls[0][0];
61+
const output = ((console.log: any): ConsoleLogMock).mock.calls[0][0];
6262

6363
expect(stripAnsi(output)).not.toEqual(output);
6464
expect(stripAnsi(output)).toMatchSnapshot();
6565

66-
(console.log: ConsoleLogMock).mockReset();
66+
((console.log: any): ConsoleLogMock).mockReset();
6767

6868
debug.deep(component, 'test message');
6969

@@ -82,7 +82,7 @@ test('debug.deep async test', async () => {
8282

8383
debug.deep(toJSON());
8484

85-
const output = (console.log: ConsoleLogMock).mock.calls[0][0];
85+
const output = ((console.log: any): ConsoleLogMock).mock.calls[0][0];
8686

8787
expect(stripAnsi(output)).toMatchSnapshot();
8888
});

src/__tests__/render.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ test('debug', () => {
326326
debug.shallow('my other custom message');
327327

328328
// eslint-disable-next-line no-console
329-
const mockCalls = (console.log: ConsoleLogMock).mock.calls;
329+
const mockCalls = ((console.log: any): ConsoleLogMock).mock.calls;
330330

331331
expect(stripAnsi(mockCalls[0][0])).toMatchSnapshot();
332332
expect(stripAnsi(mockCalls[1][0] + mockCalls[1][1])).toMatchSnapshot(
@@ -348,7 +348,7 @@ test('debug changing component', () => {
348348
debug();
349349

350350
// eslint-disable-next-line no-console
351-
const mockCalls = (console.log: ConsoleLogMock).mock.calls;
351+
const mockCalls = ((console.log: any): ConsoleLogMock).mock.calls;
352352

353353
expect(stripAnsi(mockCalls[4][0])).toMatchSnapshot(
354354
'bananaFresh button message should now be "fresh"'

src/helpers/errors.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ export class ErrorWithStack extends Error {
1010

1111
export const createLibraryNotSupportedError = (error: Error) =>
1212
new Error(
13-
`Currently the only supported library to search by text is "react-native".\n\n${
14-
error.message
15-
}`
13+
`Currently the only supported library to search by text is "react-native".\n\n${error.message}`
1614
);
1715

1816
const warned = {

0 commit comments

Comments
 (0)