repack
repack copied to clipboard
[RFC] Override `start` command in `react-native.config.js`
Describe the feature
In React Native Community CLI recently we allowed to override existing commands from react-native.config.js: https://github.com/react-native-community/cli/pull/2229.
Motivation
When running run-ios and run-android we're executing node /path/to/cli start, so automatically it starts Metro bundler instead of Re.Pack, which may be confusing for non-advanced users.
This also will unblock https://github.com/nrwl/nx/issues/20847
cc @jbroma @tom-sherman @thymikee
This issue has been marked as stale because it has been inactive for 30 days. Please update this issue or it will be automatically closed in 14 days.
@szymonrybczak
I gave it some thought and I think this will be a good way going forward, this will reduce the overhead when migrating from metro and avoid some silly mistakes on users part. It's also worth noting that we the commands used in Re.Pack are aligned to that of metro so the change so it should be relatively smooth to add. If somebody uses metro fro development and Re.Pack for production, it can still manually adjusted in react-native.config.js.
This is quite a big change and definitely breaking so I'm adding an RFC to the title, and hope to gain more opinion on this matter.
@RafikiTiki @thymikee @tom-sherman some insights from you would be great
As long as we document how to fall back to previous behavior, or expose metro's start command, I'm good with moving forward with this 👍🏼
Massively in favour of this default.
I think 90% of developers onboarded hit an issue where they somehow manage to trigger metro.
Let's do this! If someone uses a sophisticated setup (i.e. Metro for dev, webpack for prod) I'd say they'll know how to set it up properly with Repack switch to being the default. For the rest of the users, it would save them time spent on figuring out why Metro was started instead of webpack.
Easing the new tool friction is always good 🚀
We should proceeded with this feature when RN 0.74 with CLI 13 lands. I did some brief testing and it seems to work nicely by just changing the name of the commands.
Actionable items:
- [ ] - Change command names in
packages/repack/commands.js - [ ] - Add
legacyCommandsfor compatibility with older versions of RN - [ ] - Align
@callstack/repack-initto be able to choose whether to use overriden or separate commands - [ ] - Update
Getting Startedsection in docs to reflect these changes and mention how to uselegacyCommands
This issue has been marked as stale because it has been inactive for 30 days. Please update this issue or it will be automatically closed in 14 days.
Closed by #537