fix(mobile) generate both ios and android bare bundles before starting metro
Send files directly between devices over the internet with no limits
Brought to you by:
denisdev
Originally created by: ktej721
When starting the Metro bundler, it statically analyzes all imports in the project before evaluating runtime conditions like Platform.select. Conditionally importing the bare bundles in Platform.select requires both app-android.bundle.js and app-ios.bundle.js to exist. Currently, the preios and preandroid scripts only build the specific platform's bundle, which causes Metro to fail on the missing one. They should use bundle-bare instead.
Originally posted by: coderabbitai[bot]
π Walkthrough
## Walkthrough The `preandroid` and `preios` scripts in `apps/mobile/package.json` are updated to call the shared `bundle-bare` step instead of the previously separate `bundle:android` and `bundle:ios` commands. The `android` and `ios` run commands themselves are unchanged. ## Changes **Pre-run bundle script unification** | Layer / File(s) | Summary | |---|---| | **Unify preandroid and preios to bundle-bare**`apps/mobile/package.json` | Both `preandroid` and `preios` now run `npm run build:packages && npm run bundle-bare` instead of platform-specific `bundle:android` and `bundle:ios` commands. | ## Estimated code review effort π― 1 (Trivial) | β±οΈ ~2 minutes ## Poem > A rabbit hopped left, then hopped right, > Two scripts that once differed took flight. > `bundle-bare` for all, > No platform-specific call, > One shared path β now everything's tight! πβ¨
π₯ Pre-merge checks | β 5
β Passed checks (5 passed)
| Check name | Status | Explanation | | :------------------------: | :------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | Description Check | β Passed | Check skipped - CodeRabbitβs high-level summary is enabled. | | Docstring Coverage | β Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. | | Linked Issues check | β Passed | Check skipped because no linked issues were found for this pull request. | | Out of Scope Changes check | β Passed | Check skipped because no linked issues were found for this pull request. | | Title check | β Passed | The title accurately summarizes the main change: updating scripts to generate both iOS and Android bundles before Metro starts, which directly addresses the bundling configuration issue described in the PR objectives. |β¨ Finishing Touches
π§ͺ Generate unit tests (beta)
- [ ] Create PR with unit testsThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
β€οΈ Share
- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)Comment
@coderabbitai helpto get the list of available commands and usage tips.