Skip to content

Commit

Permalink
chore: bump react-native to 0.66 (#757)
Browse files Browse the repository at this point in the history
  • Loading branch information
tido64 authored Mar 15, 2022
1 parent 36505ae commit ecda1c0
Show file tree
Hide file tree
Showing 3 changed files with 692 additions and 652 deletions.
19 changes: 10 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"format:js": "prettier --write $(git ls-files '*.js' '*.json' '*.md' '*.ts' '*.tsx' '*.yml')",
"prepare": "bob build",
"start": "react-native start",
"start:android": "react-native run-android --root example/",
"start:android": "react-native run-android",
"start:ios": "react-native run-ios --project-path example/ios",
"start:macos": "react-native run-macos --project-path example/macos --scheme AsyncStorageExample",
"start:web": "expo start:web",
Expand Down Expand Up @@ -80,17 +80,18 @@
"detox": "^19.4.5",
"eslint": "^7.0.0",
"expo": "^43.0.0",
"jest": "^26.5.3",
"jest": "^26.6.3",
"jest-circus": "^26.6.1",
"react": "17.0.1",
"react-dom": "17.0.1",
"react-native": "^0.64.0",
"prettier": "^2.5.1",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-native": "^0.66.0-0",
"react-native-builder-bob": "^0.18.0",
"react-native-macos": "^0.64.0",
"react-native-test-app": "^1.1.4",
"react-native-macos": "^0.66.0-0",
"react-native-test-app": "^1.2.0",
"react-native-web": "^0.17.0",
"react-native-windows": "^0.64.0",
"react-test-renderer": "17.0.1",
"react-native-windows": "^0.66.0-0",
"react-test-renderer": "17.0.2",
"semantic-release": "^19.0.0",
"typescript": "^4.5.0"
},
Expand Down
123 changes: 46 additions & 77 deletions react-native.config.js
Original file line number Diff line number Diff line change
@@ -1,85 +1,54 @@
/**
* This cli config is needed for the coexistance of react-native and other
* out-of-tree implementations such react-native-macos.
* The following issue is tracked by
* https://github.com/react-native-community/discussions-and-proposals/issues/182
*
* The work-around involves having a metro.config.js for each out-of-tree
* platform, i.e. metro.config.js for react-native and
* metro.config.macos.js for react-native-macos.
* This react-native.config.js looks for a --use-react-native-macos
* switch and when present pushes --config=metro.config.macos.js
* and specifies reactNativePath: 'node_modules/react-native-macos'.
* The metro.config.js has to blacklist 'node_modules/react-native-macos',
* and conversely metro.config.macos.js has to blacklist 'node_modules/react-native'.
*/
'use strict';

const fs = require('fs');
const path = require('path');
const {
androidManifestPath,
iosProjectPath,
windowsProjectPath,
} = require('react-native-test-app');

const dependencies = {
'@react-native-async-storage/async-storage': {
root: __dirname,
// rn-cli incorrectly resolves node_modules path for the following platforms
platforms: {
ios: null,
macos: null,
module.exports = {
dependencies: {
'@react-native-async-storage/async-storage': {
root: __dirname,
// rn-cli incorrectly resolves node_modules path for the following platforms
platforms: {
ios: null,
macos: null,
},
},
},
// Suppress warnings about bob not being a proper native module
'@react-native-community/bob': {
platforms: {
android: null,
ios: null,
macos: null,
windows: null,
// Suppress warnings about bob not being a proper native module
'@react-native-community/bob': {
platforms: {
android: null,
ios: null,
macos: null,
windows: null,
},
},
// We don't use Expo in our test apps
expo: {
platforms: {
android: null,
ios: null,
macos: null,
windows: null,
},
},
},
// We don't use Expo in our test apps
expo: {
platforms: {
android: null,
ios: null,
macos: null,
windows: null,
project: {
android: {
sourceDir: path.join('example', 'android'),
manifestPath: androidManifestPath(
path.join(__dirname, 'example', 'android')
),
},
ios: {
project: iosProjectPath('example/ios'),
},
windows: fs.existsSync('example/windows/AsyncStorageExample.sln') && {
sourceDir: path.join('example', 'windows'),
solutionFile: 'AsyncStorageExample.sln',
project: windowsProjectPath(path.join(__dirname, 'example', 'windows')),
},
},
};

if (
process.argv.includes('--use-react-native-windows') ||
process.argv.includes('autolink-windows') ||
process.argv.includes('run-windows')
) {
const sourceDir = path.join('example', 'windows');
module.exports = {
dependencies,
project: {
// `@react-native-community/cli` mistakes
// `windows/ReactNativeAsyncStorage.sln` and
// `windows/ReactNativeAsyncStorage/ReactNativeAsyncStorage.vcxproj` for
// being the main project files. We need to help it find the solution file
// under `example/windows/` and the generated project files in
// `node_modules/.generated/windows`.
windows: {
sourceDir,
solutionFile: 'AsyncStorageExample.sln',
project: {
projectFile: path.relative(
sourceDir,
path.join(
'node_modules',
'.generated',
'windows',
'ReactTestApp',
'ReactTestApp.vcxproj'
)
),
},
},
},
reactNativePath: path.join('node_modules', 'react-native-windows'),
};
} else {
module.exports = { dependencies };
}
Loading

0 comments on commit ecda1c0

Please sign in to comment.