-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
Eject CLI command to re-create native folders #12162
Conversation
Nice! 👍 To test 'react-native init', see https://github.com/facebook/react-native/blob/master/react-native-cli/README.md |
local-cli/eject/eject.js
Outdated
const path = require('path'); | ||
const fs = require('fs'); | ||
|
||
function eject() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add some comment explaining what this does? People reading this code won't see the commit message from this pull request.
|
||
const doesIOSExist = fs.existsSync(path.resolve('ios')); | ||
const doesAndroidExist = fs.existsSync(path.resolve('android')); | ||
if (doesIOSExist && doesAndroidExist) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if just one exists?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then we don't want to show this error because maybe the user just wants to generate one
function eject() { | ||
|
||
const doesIOSExist = fs.existsSync(path.resolve('ios')); | ||
const doesAndroidExist = fs.existsSync(path.resolve('android')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: doesIOSFolderExist
, doesAndroidFolderExist
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
local-cli/eject/eject.js
Outdated
try { | ||
appConfig = require(path.resolve('app.json')); | ||
} catch(e) { | ||
console.error('Eject requires an `app.json` config file to be located in your app root, and it must at least specify a `name` and a `displayName`.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: in your app root directory.
It would also be very helpful to print the absolute path (path.resolve('app.json')
) as part of the error message to make it clear what you mean by app root directory.
local-cli/eject/eject.js
Outdated
appConfig = require(path.resolve('app.json')); | ||
} catch(e) { | ||
console.error('Eject requires an `app.json` config file to be located in your app root, and it must at least specify a `name` and a `displayName`.'); | ||
process.exit(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the error code? Should not be 0?
local-cli/eject/eject.js
Outdated
const appName = appConfig.name; | ||
const displayName = appConfig.displayName; | ||
if (!appName || !displayName) { | ||
console.error('App `name` and `displayName` must be defined in the `app.json` config file.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider explaining in this message what name and displayName are - if they are missing I get this message and want to fill them in. I understand an app needs a name but have no idea what a displayName is - is it a label displayed under the icon on my home screen? Not sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I'll explain that in the error message
local-cli/eject/eject.js
Outdated
const displayName = appConfig.displayName; | ||
if (!appName || !displayName) { | ||
console.error('App `name` and `displayName` must be defined in the `app.json` config file.'); | ||
process.exit(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exit code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, will put error code 1
local-cli/eject/eject.js
Outdated
process.exit(); | ||
} | ||
|
||
const templateOptions = { displayName }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this { displayName: displayName }
? I always get confused by this syntax.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep!
@@ -57,6 +57,7 @@ function copyProjectTemplateAndReplace(srcPath, destPath, newProjectName, option | |||
absoluteSrcFilePath, | |||
path.resolve(destPath, relativeRenamedPath), | |||
{ | |||
'Hello App Name': options.displayName || newProjectName, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok nice
@@ -0,0 +1,4 @@ | |||
{ | |||
"name": "HelloWorld", | |||
"displayName": "HelloWorld" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be "Hello World"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, because this is generated in the init step, where the name is all that exists.
@@ -1,3 +1,3 @@ | |||
<resources> | |||
<string name="app_name">HelloWorld</string> | |||
<string name="app_name">Hello App Name</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe better use "Hello World"? Is this what's displayed on the home screen? I wouldn't get what "Hello App Name" means.
@@ -4,6 +4,8 @@ | |||
<dict> | |||
<key>CFBundleDevelopmentRegion</key> | |||
<string>en</string> | |||
<key>CFBundleDisplayName</key> | |||
<string>Hello App Name</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be "Hello World"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the display name so I wanted to make the replacement string very obvious. I'll rename it to "Hello App Display Name"
What is the difference between name and displayName? Where is display name used? Is that the label on the home screen? Will docs for |
@ericvicenti Feel free to merge this yourself once you check my comments (feel free to address those you agree with, this PR looks pretty good!). You can do that using (at)facebook-github-bot shipit-ninja. |
@facebook-github-bot shipit-ninja |
Normally, ericvicenti, someone else should review and ship your pull request. However, we will trust that you know what you are doing. Shipping! |
@ericvicenti has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Summary: The iOS and Android native folders of a React Native app can be difficult to maintain. This introduces a new workflow for creating and maintaining the native code of your app. Now it will be possible to: 1. Remove the native iOS or Android folders 2. Create an `app.json` for your app, with at least a `name` and `displayName` 3. Run `react-native eject`, and the native code for your app will be generated Then, as usual, you can run `react-native run-ios` and `react-native run-android`, to build and launch your app For apps that don't have any native code, it will be possible to ignore the `ios` and `android` folders from version control. Eject step tested in RN app by deleting native folders. mkonicek, what is the best way to test `react-native init`? As follow-up items, we can enable the following: - Configuring app icon and launch screen from the `app.json` - Automatically run `react-native link` for native libraries - A Closes #12162 Differential Revision: D4509138 Pulled By: ericvicenti fbshipit-source-id: 0ee213e68f0a3d44bfce337e3ec43e5024bacc66
Summary: The iOS and Android native folders of a React Native app can be difficult to maintain. This introduces a new workflow for creating and maintaining the native code of your app. Now it will be possible to: 1. Remove the native iOS or Android folders 2. Create an `app.json` for your app, with at least a `name` and `displayName` 3. Run `react-native eject`, and the native code for your app will be generated Then, as usual, you can run `react-native run-ios` and `react-native run-android`, to build and launch your app For apps that don't have any native code, it will be possible to ignore the `ios` and `android` folders from version control. Eject step tested in RN app by deleting native folders. mkonicek, what is the best way to test `react-native init`? As follow-up items, we can enable the following: - Configuring app icon and launch screen from the `app.json` - Automatically run `react-native link` for native libraries - A Closes facebook#12162 Differential Revision: D4509138 Pulled By: ericvicenti fbshipit-source-id: 0ee213e68f0a3d44bfce337e3ec43e5024bacc66
Summary: The iOS and Android native folders of a React Native app can be difficult to maintain. This introduces a new workflow for creating and maintaining the native code of your app. Now it will be possible to: 1. Remove the native iOS or Android folders 2. Create an `app.json` for your app, with at least a `name` and `displayName` 3. Run `react-native eject`, and the native code for your app will be generated Then, as usual, you can run `react-native run-ios` and `react-native run-android`, to build and launch your app For apps that don't have any native code, it will be possible to ignore the `ios` and `android` folders from version control. Eject step tested in RN app by deleting native folders. mkonicek, what is the best way to test `react-native init`? As follow-up items, we can enable the following: - Configuring app icon and launch screen from the `app.json` - Automatically run `react-native link` for native libraries - A Closes facebook#12162 Differential Revision: D4509138 Pulled By: ericvicenti fbshipit-source-id: 0ee213e68f0a3d44bfce337e3ec43e5024bacc66
Summary: The iOS and Android native folders of a React Native app can be difficult to maintain. This introduces a new workflow for creating and maintaining the native code of your app. Now it will be possible to: 1. Remove the native iOS or Android folders 2. Create an `app.json` for your app, with at least a `name` and `displayName` 3. Run `react-native eject`, and the native code for your app will be generated Then, as usual, you can run `react-native run-ios` and `react-native run-android`, to build and launch your app For apps that don't have any native code, it will be possible to ignore the `ios` and `android` folders from version control. Eject step tested in RN app by deleting native folders. mkonicek, what is the best way to test `react-native init`? As follow-up items, we can enable the following: - Configuring app icon and launch screen from the `app.json` - Automatically run `react-native link` for native libraries - A Closes facebook#12162 Differential Revision: D4509138 Pulled By: ericvicenti fbshipit-source-id: 0ee213e68f0a3d44bfce337e3ec43e5024bacc66
Summary: The iOS and Android native folders of a React Native app can be difficult to maintain. This introduces a new workflow for creating and maintaining the native code of your app. Now it will be possible to: 1. Remove the native iOS or Android folders 2. Create an `app.json` for your app, with at least a `name` and `displayName` 3. Run `react-native eject`, and the native code for your app will be generated Then, as usual, you can run `react-native run-ios` and `react-native run-android`, to build and launch your app For apps that don't have any native code, it will be possible to ignore the `ios` and `android` folders from version control. Eject step tested in RN app by deleting native folders. mkonicek, what is the best way to test `react-native init`? As follow-up items, we can enable the following: - Configuring app icon and launch screen from the `app.json` - Automatically run `react-native link` for native libraries - A Closes facebook#12162 Differential Revision: D4509138 Pulled By: ericvicenti fbshipit-source-id: 0ee213e68f0a3d44bfce337e3ec43e5024bacc66
Summary: The iOS and Android native folders of a React Native app can be difficult to maintain. This introduces a new workflow for creating and maintaining the native code of your app. Now it will be possible to: 1. Remove the native iOS or Android folders 2. Create an `app.json` for your app, with at least a `name` and `displayName` 3. Run `react-native eject`, and the native code for your app will be generated Then, as usual, you can run `react-native run-ios` and `react-native run-android`, to build and launch your app For apps that don't have any native code, it will be possible to ignore the `ios` and `android` folders from version control. Eject step tested in RN app by deleting native folders. mkonicek, what is the best way to test `react-native init`? As follow-up items, we can enable the following: - Configuring app icon and launch screen from the `app.json` - Automatically run `react-native link` for native libraries - A Closes facebook#12162 Differential Revision: D4509138 Pulled By: ericvicenti fbshipit-source-id: 0ee213e68f0a3d44bfce337e3ec43e5024bacc66
Summary: The iOS and Android native folders of a React Native app can be difficult to maintain. This introduces a new workflow for creating and maintaining the native code of your app. Now it will be possible to: 1. Remove the native iOS or Android folders 2. Create an `app.json` for your app, with at least a `name` and `displayName` 3. Run `react-native eject`, and the native code for your app will be generated Then, as usual, you can run `react-native run-ios` and `react-native run-android`, to build and launch your app For apps that don't have any native code, it will be possible to ignore the `ios` and `android` folders from version control. Eject step tested in RN app by deleting native folders. mkonicek, what is the best way to test `react-native init`? As follow-up items, we can enable the following: - Configuring app icon and launch screen from the `app.json` - Automatically run `react-native link` for native libraries - A Closes facebook#12162 Differential Revision: D4509138 Pulled By: ericvicenti fbshipit-source-id: 0ee213e68f0a3d44bfce337e3ec43e5024bacc66
Summary: The iOS and Android native folders of a React Native app can be difficult to maintain. This introduces a new workflow for creating and maintaining the native code of your app. Now it will be possible to: 1. Remove the native iOS or Android folders 2. Create an `app.json` for your app, with at least a `name` and `displayName` 3. Run `react-native eject`, and the native code for your app will be generated Then, as usual, you can run `react-native run-ios` and `react-native run-android`, to build and launch your app For apps that don't have any native code, it will be possible to ignore the `ios` and `android` folders from version control. Eject step tested in RN app by deleting native folders. mkonicek, what is the best way to test `react-native init`? As follow-up items, we can enable the following: - Configuring app icon and launch screen from the `app.json` - Automatically run `react-native link` for native libraries - A Closes facebook#12162 Differential Revision: D4509138 Pulled By: ericvicenti fbshipit-source-id: 0ee213e68f0a3d44bfce337e3ec43e5024bacc66
Summary: The iOS and Android native folders of a React Native app can be difficult to maintain. This introduces a new workflow for creating and maintaining the native code of your app. Now it will be possible to: 1. Remove the native iOS or Android folders 2. Create an `app.json` for your app, with at least a `name` and `displayName` 3. Run `react-native eject`, and the native code for your app will be generated Then, as usual, you can run `react-native run-ios` and `react-native run-android`, to build and launch your app For apps that don't have any native code, it will be possible to ignore the `ios` and `android` folders from version control. Eject step tested in RN app by deleting native folders. mkonicek, what is the best way to test `react-native init`? As follow-up items, we can enable the following: - Configuring app icon and launch screen from the `app.json` - Automatically run `react-native link` for native libraries - A Closes facebook#12162 Differential Revision: D4509138 Pulled By: ericvicenti fbshipit-source-id: 0ee213e68f0a3d44bfce337e3ec43e5024bacc66
Summary: The iOS and Android native folders of a React Native app can be difficult to maintain. This introduces a new workflow for creating and maintaining the native code of your app. Now it will be possible to: 1. Remove the native iOS or Android folders 2. Create an `app.json` for your app, with at least a `name` and `displayName` 3. Run `react-native eject`, and the native code for your app will be generated Then, as usual, you can run `react-native run-ios` and `react-native run-android`, to build and launch your app For apps that don't have any native code, it will be possible to ignore the `ios` and `android` folders from version control. Eject step tested in RN app by deleting native folders. mkonicek, what is the best way to test `react-native init`? As follow-up items, we can enable the following: - Configuring app icon and launch screen from the `app.json` - Automatically run `react-native link` for native libraries - A Closes facebook#12162 Differential Revision: D4509138 Pulled By: ericvicenti fbshipit-source-id: 0ee213e68f0a3d44bfce337e3ec43e5024bacc66
Summary: The iOS and Android native folders of a React Native app can be difficult to maintain. This introduces a new workflow for creating and maintaining the native code of your app. Now it will be possible to: 1. Remove the native iOS or Android folders 2. Create an `app.json` for your app, with at least a `name` and `displayName` 3. Run `react-native eject`, and the native code for your app will be generated Then, as usual, you can run `react-native run-ios` and `react-native run-android`, to build and launch your app For apps that don't have any native code, it will be possible to ignore the `ios` and `android` folders from version control. Eject step tested in RN app by deleting native folders. mkonicek, what is the best way to test `react-native init`? As follow-up items, we can enable the following: - Configuring app icon and launch screen from the `app.json` - Automatically run `react-native link` for native libraries - A Closes facebook#12162 Differential Revision: D4509138 Pulled By: ericvicenti fbshipit-source-id: 0ee213e68f0a3d44bfce337e3ec43e5024bacc66
Summary: The iOS and Android native folders of a React Native app can be difficult to maintain. This introduces a new workflow for creating and maintaining the native code of your app. Now it will be possible to: 1. Remove the native iOS or Android folders 2. Create an `app.json` for your app, with at least a `name` and `displayName` 3. Run `react-native eject`, and the native code for your app will be generated Then, as usual, you can run `react-native run-ios` and `react-native run-android`, to build and launch your app For apps that don't have any native code, it will be possible to ignore the `ios` and `android` folders from version control. Eject step tested in RN app by deleting native folders. mkonicek, what is the best way to test `react-native init`? As follow-up items, we can enable the following: - Configuring app icon and launch screen from the `app.json` - Automatically run `react-native link` for native libraries - A Closes facebook#12162 Differential Revision: D4509138 Pulled By: ericvicenti fbshipit-source-id: 0ee213e68f0a3d44bfce337e3ec43e5024bacc66
Summary: The iOS and Android native folders of a React Native app can be difficult to maintain. This introduces a new workflow for creating and maintaining the native code of your app. Now it will be possible to: 1. Remove the native iOS or Android folders 2. Create an `app.json` for your app, with at least a `name` and `displayName` 3. Run `react-native eject`, and the native code for your app will be generated Then, as usual, you can run `react-native run-ios` and `react-native run-android`, to build and launch your app For apps that don't have any native code, it will be possible to ignore the `ios` and `android` folders from version control. Eject step tested in RN app by deleting native folders. mkonicek, what is the best way to test `react-native init`? As follow-up items, we can enable the following: - Configuring app icon and launch screen from the `app.json` - Automatically run `react-native link` for native libraries - A Closes facebook#12162 Differential Revision: D4509138 Pulled By: ericvicenti fbshipit-source-id: 0ee213e68f0a3d44bfce337e3ec43e5024bacc66
I'm a bit late to share my thoughts about this feature, I hope it could help for the future work on this. If I understand well, it's an alternative way to upgrade the host apps of a RN project (i.e. the The This process ( My point is: we already could do the same by running Is the |
@ncuillery it is similar to Also, it's not related to my prior work with upgrade tools, haven't finished that yet, but might start once again soon :) |
Summary: **Motivation** This PR fixes #12420. For the first time, the version 0.41.2 includes a change in the generator (see #12162). The [require cache busting](https://github.com/facebook/react-native/blob/master/react-native-git-upgrade/cliEntry.js#L157-L163) of `react-native-git-upgrade`, designed to face this situation , was ineffective. The entry in `require.cache` is the file path including the `.js` extension. We have to delete this entry with the same key. **Test plan** - Publish `react-native-git-upgrade` to Sinopia, - Follow the reproduction steps of #12420 - 👉 The name of the app shouldn't be changed Closes #12422 Differential Revision: D4585549 Pulled By: mkonicek fbshipit-source-id: 508ac925c17d02b7739d47f9351a5aa336589f2e
Summary: The iOS and Android native folders of a React Native app can be difficult to maintain. This introduces a new workflow for creating and maintaining the native code of your app. Now it will be possible to: 1. Remove the native iOS or Android folders 2. Create an `app.json` for your app, with at least a `name` and `displayName` 3. Run `react-native eject`, and the native code for your app will be generated Then, as usual, you can run `react-native run-ios` and `react-native run-android`, to build and launch your app For apps that don't have any native code, it will be possible to ignore the `ios` and `android` folders from version control. Eject step tested in RN app by deleting native folders. mkonicek, what is the best way to test `react-native init`? As follow-up items, we can enable the following: - Configuring app icon and launch screen from the `app.json` - Automatically run `react-native link` for native libraries - A Closes facebook#12162 Differential Revision: D4509138 Pulled By: ericvicenti fbshipit-source-id: 0ee213e68f0a3d44bfce337e3ec43e5024bacc66
Summary: **Motivation** This PR fixes facebook#12420. For the first time, the version 0.41.2 includes a change in the generator (see facebook#12162). The [require cache busting](https://github.com/facebook/react-native/blob/master/react-native-git-upgrade/cliEntry.js#L157-L163) of `react-native-git-upgrade`, designed to face this situation , was ineffective. The entry in `require.cache` is the file path including the `.js` extension. We have to delete this entry with the same key. **Test plan** - Publish `react-native-git-upgrade` to Sinopia, - Follow the reproduction steps of facebook#12420 - 👉 The name of the app shouldn't be changed Closes facebook#12422 Differential Revision: D4585549 Pulled By: mkonicek fbshipit-source-id: 508ac925c17d02b7739d47f9351a5aa336589f2e
Summary: **Motivation** This PR fixes facebook#12420. For the first time, the version 0.41.2 includes a change in the generator (see facebook#12162). The [require cache busting](https://github.com/facebook/react-native/blob/master/react-native-git-upgrade/cliEntry.js#L157-L163) of `react-native-git-upgrade`, designed to face this situation , was ineffective. The entry in `require.cache` is the file path including the `.js` extension. We have to delete this entry with the same key. **Test plan** - Publish `react-native-git-upgrade` to Sinopia, - Follow the reproduction steps of facebook#12420 - 👉 The name of the app shouldn't be changed Closes facebook#12422 Differential Revision: D4585549 Pulled By: mkonicek fbshipit-source-id: 508ac925c17d02b7739d47f9351a5aa336589f2e
Summary: **Motivation** This PR fixes facebook#12420. For the first time, the version 0.41.2 includes a change in the generator (see facebook#12162). The [require cache busting](https://github.com/facebook/react-native/blob/master/react-native-git-upgrade/cliEntry.js#L157-L163) of `react-native-git-upgrade`, designed to face this situation , was ineffective. The entry in `require.cache` is the file path including the `.js` extension. We have to delete this entry with the same key. **Test plan** - Publish `react-native-git-upgrade` to Sinopia, - Follow the reproduction steps of facebook#12420 - 👉 The name of the app shouldn't be changed Closes facebook#12422 Differential Revision: D4585549 Pulled By: mkonicek fbshipit-source-id: 508ac925c17d02b7739d47f9351a5aa336589f2e
Summary: The iOS and Android native folders of a React Native app can be difficult to maintain. This introduces a new workflow for creating and maintaining the native code of your app. Now it will be possible to: 1. Remove the native iOS or Android folders 2. Create an `app.json` for your app, with at least a `name` and `displayName` 3. Run `react-native eject`, and the native code for your app will be generated Then, as usual, you can run `react-native run-ios` and `react-native run-android`, to build and launch your app For apps that don't have any native code, it will be possible to ignore the `ios` and `android` folders from version control. Eject step tested in RN app by deleting native folders. mkonicek, what is the best way to test `react-native init`? As follow-up items, we can enable the following: - Configuring app icon and launch screen from the `app.json` - Automatically run `react-native link` for native libraries - A Closes facebook#12162 Differential Revision: D4509138 Pulled By: ericvicenti fbshipit-source-id: 0ee213e68f0a3d44bfce337e3ec43e5024bacc66
Summary: The iOS and Android native folders of a React Native app can be difficult to maintain. This introduces a new workflow for creating and maintaining the native code of your app. Now it will be possible to: 1. Remove the native iOS or Android folders 2. Create an `app.json` for your app, with at least a `name` and `displayName` 3. Run `react-native eject`, and the native code for your app will be generated Then, as usual, you can run `react-native run-ios` and `react-native run-android`, to build and launch your app For apps that don't have any native code, it will be possible to ignore the `ios` and `android` folders from version control. Eject step tested in RN app by deleting native folders. mkonicek, what is the best way to test `react-native init`? As follow-up items, we can enable the following: - Configuring app icon and launch screen from the `app.json` - Automatically run `react-native link` for native libraries - A Closes #12162 Differential Revision: D4509138 Pulled By: ericvicenti fbshipit-source-id: 0ee213e68f0a3d44bfce337e3ec43e5024bacc66
Summary: The iOS and Android native folders of a React Native app can be difficult to maintain. This introduces a new workflow for creating and maintaining the native code of your app. Now it will be possible to: 1. Remove the native iOS or Android folders 2. Create an `app.json` for your app, with at least a `name` and `displayName` 3. Run `react-native eject`, and the native code for your app will be generated Then, as usual, you can run `react-native run-ios` and `react-native run-android`, to build and launch your app For apps that don't have any native code, it will be possible to ignore the `ios` and `android` folders from version control. Eject step tested in RN app by deleting native folders. mkonicek, what is the best way to test `react-native init`? As follow-up items, we can enable the following: - Configuring app icon and launch screen from the `app.json` - Automatically run `react-native link` for native libraries - A Closes facebook/react-native#12162 Differential Revision: D4509138 Pulled By: ericvicenti fbshipit-source-id: 0ee213e68f0a3d44bfce337e3ec43e5024bacc66
The iOS and Android native folders of a React Native app can be difficult to maintain. This introduces a new workflow for creating and maintaining the native code of your app.
New Functionality
Now it will be possible to:
app.json
for your app, with at least aname
anddisplayName
react-native eject
, and the native code for your app will be generatedThen, as usual, you can run
react-native run-ios
andreact-native run-android
, to build and launch your appFor apps that don't have any native code, it will be possible to ignore the
ios
andandroid
folders from version control.Test Plan
Eject step tested in RN app by deleting native folders.
@mkonicek, what is the best way to test
react-native init
?Followup
As follow-up items, we can enable the following:
app.json
react-native link
for native librariesapp.json
to configure app linkingreact-native run-[android/ios]
to work without any ios or android folder at all