Commit Graph

3 Commits

Author SHA1 Message Date
Sean Hagstrom 89828ba7fd
chore: allow for overriding metro server port (#20202)
This change will now allow for customizing the port number when running the metro server. The environment variable `RCT_METRO_PORT` can now be set when executing commands like `make run-ios`, `make run ios-device`, and `make run-android`. Though, it should be noted that `make clean` may need to be ran before attempting to set or change `RCT_METRO_PORT` since the react-native app will have statically built code that references the value of RCT_METRO_PORT from compile time and not runtime.
2024-08-05 12:48:35 +01:00
Siddarth Kumar 48789e8793
keep existing metro session alive (#19458)
The killing of metro terminal upset a few people and this PR fixes that.

## Summary
Modify build step to check if metro is running already.
If so then we do not attempt to start metro again.
If not then we start metro after building android / iOS.

## Review notes
* case 1
    - `make run-clojure`
    - `make run-metro`
    - `make run-android` or `make run-ios` should work the way it did before.
* case 2
    - `make run-clojure`
    - `make run-android` or `make run-ios` should also work.

## Platforms
- Android
- iOS
2024-04-01 16:47:48 +05:30
Siddarth Kumar 42cab08553
chore: Improve DX for building the app locally (#18784)
After upgrading `react-native` to `0.72.5` we frequently started seeing the _red screen of death_ on both `Android` and `iOS` simulators right after the app was built and installed.
This used to happen because our workflow required us to do the following :
- `make run-clojure`
- `make run-metro`
- `make run-ios` OR `make run-android`

The problem with this approach was after `metro` was started the `iOS`, `Android` build step would change the files that `metro` couldn't handle and hence metro would go out of sync.
The quick fix back then was to restart `metro` terminal and to open the app again from the simulator.
This was however not a good DX.

This commit fixes that.
We no longer rely on `react-native` cli to generate and deploy debug builds on simulators. We take control of the process via our own script. The new workflow introduced in this commit will first build the app, then install the app on the simulators and then start metro terminal. When `metro` is successfully running the script will then open the app.

The new workflow now is :
- `make run-clojure`
- `make run-ios` OR `make run-android`
2024-02-14 19:58:45 +05:30