Skip to content

Commit ecda1c0

Browse files
authored
chore: bump react-native to 0.66 (#757)
1 parent 36505ae commit ecda1c0

File tree

3 files changed

+692
-652
lines changed

3 files changed

+692
-652
lines changed

package.json

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"format:js": "prettier --write $(git ls-files '*.js' '*.json' '*.md' '*.ts' '*.tsx' '*.yml')",
4444
"prepare": "bob build",
4545
"start": "react-native start",
46-
"start:android": "react-native run-android --root example/",
46+
"start:android": "react-native run-android",
4747
"start:ios": "react-native run-ios --project-path example/ios",
4848
"start:macos": "react-native run-macos --project-path example/macos --scheme AsyncStorageExample",
4949
"start:web": "expo start:web",
@@ -80,17 +80,18 @@
8080
"detox": "^19.4.5",
8181
"eslint": "^7.0.0",
8282
"expo": "^43.0.0",
83-
"jest": "^26.5.3",
83+
"jest": "^26.6.3",
8484
"jest-circus": "^26.6.1",
85-
"react": "17.0.1",
86-
"react-dom": "17.0.1",
87-
"react-native": "^0.64.0",
85+
"prettier": "^2.5.1",
86+
"react": "17.0.2",
87+
"react-dom": "17.0.2",
88+
"react-native": "^0.66.0-0",
8889
"react-native-builder-bob": "^0.18.0",
89-
"react-native-macos": "^0.64.0",
90-
"react-native-test-app": "^1.1.4",
90+
"react-native-macos": "^0.66.0-0",
91+
"react-native-test-app": "^1.2.0",
9192
"react-native-web": "^0.17.0",
92-
"react-native-windows": "^0.64.0",
93-
"react-test-renderer": "17.0.1",
93+
"react-native-windows": "^0.66.0-0",
94+
"react-test-renderer": "17.0.2",
9495
"semantic-release": "^19.0.0",
9596
"typescript": "^4.5.0"
9697
},

react-native.config.js

Lines changed: 46 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,54 @@
1-
/**
2-
* This cli config is needed for the coexistance of react-native and other
3-
* out-of-tree implementations such react-native-macos.
4-
* The following issue is tracked by
5-
* https://github.com/react-native-community/discussions-and-proposals/issues/182
6-
*
7-
* The work-around involves having a metro.config.js for each out-of-tree
8-
* platform, i.e. metro.config.js for react-native and
9-
* metro.config.macos.js for react-native-macos.
10-
* This react-native.config.js looks for a --use-react-native-macos
11-
* switch and when present pushes --config=metro.config.macos.js
12-
* and specifies reactNativePath: 'node_modules/react-native-macos'.
13-
* The metro.config.js has to blacklist 'node_modules/react-native-macos',
14-
* and conversely metro.config.macos.js has to blacklist 'node_modules/react-native'.
15-
*/
16-
'use strict';
17-
1+
const fs = require('fs');
182
const path = require('path');
3+
const {
4+
androidManifestPath,
5+
iosProjectPath,
6+
windowsProjectPath,
7+
} = require('react-native-test-app');
198

20-
const dependencies = {
21-
'@react-native-async-storage/async-storage': {
22-
root: __dirname,
23-
// rn-cli incorrectly resolves node_modules path for the following platforms
24-
platforms: {
25-
ios: null,
26-
macos: null,
9+
module.exports = {
10+
dependencies: {
11+
'@react-native-async-storage/async-storage': {
12+
root: __dirname,
13+
// rn-cli incorrectly resolves node_modules path for the following platforms
14+
platforms: {
15+
ios: null,
16+
macos: null,
17+
},
2718
},
28-
},
29-
// Suppress warnings about bob not being a proper native module
30-
'@react-native-community/bob': {
31-
platforms: {
32-
android: null,
33-
ios: null,
34-
macos: null,
35-
windows: null,
19+
// Suppress warnings about bob not being a proper native module
20+
'@react-native-community/bob': {
21+
platforms: {
22+
android: null,
23+
ios: null,
24+
macos: null,
25+
windows: null,
26+
},
27+
},
28+
// We don't use Expo in our test apps
29+
expo: {
30+
platforms: {
31+
android: null,
32+
ios: null,
33+
macos: null,
34+
windows: null,
35+
},
3636
},
3737
},
38-
// We don't use Expo in our test apps
39-
expo: {
40-
platforms: {
41-
android: null,
42-
ios: null,
43-
macos: null,
44-
windows: null,
38+
project: {
39+
android: {
40+
sourceDir: path.join('example', 'android'),
41+
manifestPath: androidManifestPath(
42+
path.join(__dirname, 'example', 'android')
43+
),
44+
},
45+
ios: {
46+
project: iosProjectPath('example/ios'),
47+
},
48+
windows: fs.existsSync('example/windows/AsyncStorageExample.sln') && {
49+
sourceDir: path.join('example', 'windows'),
50+
solutionFile: 'AsyncStorageExample.sln',
51+
project: windowsProjectPath(path.join(__dirname, 'example', 'windows')),
4552
},
4653
},
4754
};
48-
49-
if (
50-
process.argv.includes('--use-react-native-windows') ||
51-
process.argv.includes('autolink-windows') ||
52-
process.argv.includes('run-windows')
53-
) {
54-
const sourceDir = path.join('example', 'windows');
55-
module.exports = {
56-
dependencies,
57-
project: {
58-
// `@react-native-community/cli` mistakes
59-
// `windows/ReactNativeAsyncStorage.sln` and
60-
// `windows/ReactNativeAsyncStorage/ReactNativeAsyncStorage.vcxproj` for
61-
// being the main project files. We need to help it find the solution file
62-
// under `example/windows/` and the generated project files in
63-
// `node_modules/.generated/windows`.
64-
windows: {
65-
sourceDir,
66-
solutionFile: 'AsyncStorageExample.sln',
67-
project: {
68-
projectFile: path.relative(
69-
sourceDir,
70-
path.join(
71-
'node_modules',
72-
'.generated',
73-
'windows',
74-
'ReactTestApp',
75-
'ReactTestApp.vcxproj'
76-
)
77-
),
78-
},
79-
},
80-
},
81-
reactNativePath: path.join('node_modules', 'react-native-windows'),
82-
};
83-
} else {
84-
module.exports = { dependencies };
85-
}

0 commit comments

Comments
 (0)