-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
feat(cli)!: use Expo CLI to bundle production apps #21396
Conversation
Hi there! 👋 I'm a bot whose goal is to ensure your contributions meet our guidelines. I've found some issues in your pull request that should be addressed (click on them for more details) 👇
|
Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
Hi there! 👋 I'm a bot whose goal is to ensure your contributions meet our guidelines. I've found some issues in your pull request that should be addressed (click on them for more details) 👇
|
Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
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.
appreciated if you could also update fabric-test's project.pbxproj.
templates/expo-template-bare-minimum/ios/HelloWorld.xcodeproj/project.pbxproj
Outdated
Show resolved
Hide resolved
since in #21397 you've introduced |
added to fabric tester
Hi there! 👋 I'm a bot whose goal is to ensure your contributions meet our guidelines. I've found some issues in your pull request that should be addressed (click on them for more details) 👇
|
Hi there! 👋 I'm a bot whose goal is to ensure your contributions meet our guidelines. I've found some issues in your pull request that should be addressed (click on them for more details) 👇
|
Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
Hey @EvanBacon, I'm getting |
) # Why - Related #21396 - Use `npx expo start --dev-client` instead of `npx react-native start` when building a project from Xcode. This ensures we use the correct version of Metro regardless of where the project is started. - It's unclear if building from Android Studio is supposed to trigger the bundler in development but I couldn't get it to do so, so this PR is iOS-only. <!-- Please describe the motivation for this PR, and link to relevant GitHub issues, forums posts, or feature requests. --> # How - Copy over a bunch of the default scripts from `react-native/scripts` into the same locations in `expo/scripts` to make it easy to maintain this change and simple to migrate. I decided to omit the following as it appeared to be unused (sets RCT_METRO_PORT): ``` source "$THIS_DIR/.packager.env" ``` I also dropped: - Support for `$RCT_PACKAGER_LOGS_DIR`. - The `Process terminated. Press <enter> to close the window` log that is presented after closing the dev server. - Support for a custom React Native CLI config (this is not supported in Expo CLI). <!-- How did you build this feature or fix this bug and why? --> # Test Plan - TBD - Building for development from Xcode causes a terminal window running `npx expo start` will open instead of the community version. <!-- Please describe how you tested this change and how a reviewer could reproduce your test, especially if this PR does not include automated tests! If possible, please also provide terminal output and/or screenshots demonstrating your test/reproduction. --> # Checklist <!-- Please check the appropriate items below if they apply to your diff. This is required for changes to Expo modules. --> - [ ] Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) - [ ] This diff will work correctly for `expo prebuild` & EAS Build (eg: updated a module plugin). --------- Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com> Co-authored-by: Kudo Chien <kudo@expo.dev>
# Why - Possible since #21396 - If the `metro.config.js` is missing, then the default, `@expo/metro-config`, will be used. - Drop `metro.config.js` copy step in `expo prebuild` in favor of `expo export:embed` and the new Xcode start script using Expo CLI--this only works when using Expo CLI for all bundling (SDK +49). - Maybe we could add a metro linting step to `npx expo-doctor` in the future. # Test Plan - tbd # Checklist <!-- Please check the appropriate items below if they apply to your diff. This is required for changes to Expo modules. --> - [ ] Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) - [ ] This diff will work correctly for `expo prebuild` & EAS Build (eg: updated a module plugin). --------- Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com> Co-authored-by: Aman Mittal <amandeepmittal@live.com>
Why
Most of our new Metro bundler features won't work unless we use Expo CLI for every bundler operation (ex: aliases). Right now this is the case when building for production on both platforms or building for development on iOS.
How
This PR introduces a new "export:embed" command which is hidden from the
--help
prompt.npx expo export:embed
accepts the same arguments asnpx react-native bundle
and passes them to the same internal function, but it ensures we use the correct variation of Metro before doing such.This change (and
start
PR) will add more steps for migrating to "Expo CLI" but it will also remove the need for us to generate themetro.config.js
file in the project onnpx expo prebuild
since we can now reliably default to@expo/metro-config
.The change should only apply to Metro bundler features (all application code could be affected), but it won't obstruct Expo Modules Core or using Expo CLI.
Test Plan
@expo/cli
into a new project's node_modules, added template changes:Checklist
expo prebuild
& EAS Build (eg: updated a module plugin).