Skip to content

chore: bump react-native to 0.66 #757

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

q: does this allow us to remove root option from run-android script?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it does.

manifestPath: androidManifestPath(
path.join(__dirname, 'example', 'android')
),
},
ios: {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we specify options in start:macos script, we don't have to add this target here, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

react-native-macos doesn't use this field, I think. They look for the project independent of the cli config.

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