- 
                Notifications
    You must be signed in to change notification settings 
- Fork 24.9k
Simplify occupied port handling in start command #39078
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
Conversation
| This pull request was exported from Phabricator. Differential Revision: D48433285 | 
| 
 Base commit: 8b62200 | 
Summary: Pull Request resolved: facebook#39078 Simplifies and hardens behaviour for detecting other processes / dev server instances when running `react-native start`. - New flow: - Exits with error message if port is taken by another process (*no longer suggests next port*). - Exits with info message if port is taken by another instance of this dev server (**unchanged**). - Continues if result unknown. - *(No longer logs dedicated message for another RN server running in a different project root.)* - This now checks if the TCP port is in use before attempting an HTTP fetch. Previous behaviour: [`handlePortUnavailable`](https://github.com/react-native-community/cli/blob/734222118707fff41c71463528e4e0c227b31cc6/packages/cli-tools/src/handlePortUnavailable.ts#L8). This decouples us from some lower-level `react-native-community/cli-tools` utils, which remain reused by the `android` and `ios` commands. Changelog: [Internal] Reviewed By: motiz88 Differential Revision: D48433285 fbshipit-source-id: 337627fe33d77f6134d91e4d6f9c90eb7e542cc8
df85cd3    to
    c3ad261      
    Compare
  
    Summary: Pull Request resolved: facebook#39078 Simplifies and hardens behaviour for detecting other processes / dev server instances when running `react-native start`. - New flow: - Exits with error message if port is taken by another process (*no longer suggests next port*). - Exits with info message if port is taken by another instance of this dev server (**unchanged**). - Continues if result unknown. - *(No longer logs dedicated message for another RN server running in a different project root.)* - This now checks if the TCP port is in use before attempting an HTTP fetch. Previous behaviour: [`handlePortUnavailable`](https://github.com/react-native-community/cli/blob/734222118707fff41c71463528e4e0c227b31cc6/packages/cli-tools/src/handlePortUnavailable.ts#L8). This decouples us from some lower-level `react-native-community/cli-tools` utils, which remain reused by the `android` and `ios` commands. Changelog: [Internal] Reviewed By: motiz88 Differential Revision: D48433285 fbshipit-source-id: 1d194ee0764e481723127610f8a06f3ab37315fb
c3ad261    to
    c961104      
    Compare
  
    Summary: Pull Request resolved: facebook#39078 Simplifies and hardens behaviour for detecting other processes / dev server instances when running `react-native start`. - New flow: - Exits with error message if port is taken by another process (*no longer suggests next port*). - Exits with info message if port is taken by another instance of this dev server (**unchanged**). - Continues if result unknown. - *(No longer logs dedicated message for another RN server running in a different project root.)* - This now checks if the TCP port is in use before attempting an HTTP fetch. Previous behaviour: [`handlePortUnavailable`](https://github.com/react-native-community/cli/blob/734222118707fff41c71463528e4e0c227b31cc6/packages/cli-tools/src/handlePortUnavailable.ts#L8). This decouples us from some lower-level `react-native-community/cli-tools` utils, which remain reused by the `android` and `ios` commands. Changelog: [Internal] Differential Revision: https://internalfb.com/D48433285 fbshipit-source-id: 7ab5028974871601a7776c33955ea1a8da5664e6
Summary: Pull Request resolved: facebook#39078 Simplifies and hardens behaviour for detecting other processes / dev server instances when running `react-native start`. - New flow: - Exits with error message if port is taken by another process (*no longer suggests next port*). - Exits with info message if port is taken by another instance of this dev server (**unchanged**). - Continues if result unknown. - *(No longer logs dedicated message for another RN server running in a different project root.)* - This now checks if the TCP port is in use before attempting an HTTP fetch. Previous behaviour: [`handlePortUnavailable`](https://github.com/react-native-community/cli/blob/734222118707fff41c71463528e4e0c227b31cc6/packages/cli-tools/src/handlePortUnavailable.ts#L8). This decouples us from some lower-level `react-native-community/cli-tools` utils, which remain reused by the `android` and `ios` commands. Changelog: [Internal] Reviewed By: motiz88 Differential Revision: D48433285 fbshipit-source-id: 2b0452c6c0b7d6e87b2ed0958a2d1e5da307dbc2
c961104    to
    24d6eb4      
    Compare
  
    Summary: Pull Request resolved: facebook#39078 Simplifies and hardens behaviour for detecting other processes / dev server instances when running `react-native start`. - New flow: - Exits with error message if port is taken by another process (*no longer suggests next port*). - Exits with info message if port is taken by another instance of this dev server (**unchanged**). - Continues if result unknown. - *(No longer logs dedicated message for another RN server running in a different project root.)* - This now checks if the TCP port is in use before attempting an HTTP fetch. Previous behaviour: [`handlePortUnavailable`](https://github.com/react-native-community/cli/blob/734222118707fff41c71463528e4e0c227b31cc6/packages/cli-tools/src/handlePortUnavailable.ts#L8). This decouples us from some lower-level `react-native-community/cli-tools` utils, which remain reused by the `android` and `ios` commands. Changelog: [Internal] Reviewed By: motiz88 Differential Revision: D48433285 fbshipit-source-id: 68e77f5195cf3818b36928fb72c1247ce5c960d3
24d6eb4    to
    ff54c7c      
    Compare
  
    Summary: Pull Request resolved: facebook#39078 Simplifies and hardens behaviour for detecting other processes / dev server instances when running `react-native start`. - New flow: - Exits with error message if port is taken by another process (*no longer suggests next port*). - Exits with info message if port is taken by another instance of this dev server (**unchanged**). - Continues if result unknown. - *(No longer logs dedicated message for another RN server running in a different project root.)* - This now checks if the TCP port is in use before attempting an HTTP fetch. Previous behaviour: [`handlePortUnavailable`](https://github.com/react-native-community/cli/blob/734222118707fff41c71463528e4e0c227b31cc6/packages/cli-tools/src/handlePortUnavailable.ts#L8). This decouples us from some lower-level `react-native-community/cli-tools` utils, which remain reused by the `android` and `ios` commands. Changelog: [Internal] Reviewed By: motiz88 Differential Revision: D48433285 fbshipit-source-id: 748a729c1733869e5f00f42c1436b4882ec60988
ff54c7c    to
    874a66e      
    Compare
  
    Summary: Pull Request resolved: facebook#39078 Simplifies and hardens behaviour for detecting other processes / dev server instances when running `react-native start`. - New flow: - Exits with error message if port is taken by another process (*no longer suggests next port*). - Exits with info message if port is taken by another instance of this dev server (**unchanged**). - Continues if result unknown. - *(No longer logs dedicated message for another RN server running in a different project root.)* - This now checks if the TCP port is in use before attempting an HTTP fetch. Previous behaviour: [`handlePortUnavailable`](https://github.com/react-native-community/cli/blob/734222118707fff41c71463528e4e0c227b31cc6/packages/cli-tools/src/handlePortUnavailable.ts#L8). This decouples us from some lower-level `react-native-community/cli-tools` utils, which remain reused by the `android` and `ios` commands. Changelog: [Internal] Differential Revision: https://internalfb.com/D48433285 fbshipit-source-id: 61a8c57710e1a6d154be810ca976265464515328
Summary: Pull Request resolved: facebook#39078 Simplifies and hardens behaviour for detecting other processes / dev server instances when running `react-native start`. - New flow: - Exits with error message if port is taken by another process (*no longer suggests next port*). - Exits with info message if port is taken by another instance of this dev server (**unchanged**). - Continues if result unknown. - *(No longer logs dedicated message for another RN server running in a different project root.)* - This now checks if the TCP port is in use before attempting an HTTP fetch. Previous behaviour: [`handlePortUnavailable`](https://github.com/react-native-community/cli/blob/734222118707fff41c71463528e4e0c227b31cc6/packages/cli-tools/src/handlePortUnavailable.ts#L8). This decouples us from some lower-level `react-native-community/cli-tools` utils, which remain reused by the `android` and `ios` commands. Changelog: [Internal] Differential Revision: https://internalfb.com/D48433285 fbshipit-source-id: e829be1c14ffa5d666f00ea93af76725e05eeab2
Summary: Pull Request resolved: facebook#39078 Simplifies and hardens behaviour for detecting other processes / dev server instances when running `react-native start`. - New flow: - Exits with error message if port is taken by another process (*no longer suggests next port*). - Exits with info message if port is taken by another instance of this dev server (**unchanged**). - Continues if result unknown. - *(No longer logs dedicated message for another RN server running in a different project root.)* - This now checks if the TCP port is in use before attempting an HTTP fetch. Previous behaviour: [`handlePortUnavailable`](https://github.com/react-native-community/cli/blob/734222118707fff41c71463528e4e0c227b31cc6/packages/cli-tools/src/handlePortUnavailable.ts#L8). This decouples us from some lower-level `react-native-community/cli-tools` utils, which remain reused by the `android` and `ios` commands. Changelog: [Internal] Reviewed By: motiz88 Differential Revision: D48433285 fbshipit-source-id: 03cf450824ebd1e1e750f087c060c2f81e0a6851
874a66e    to
    8fcb34b      
    Compare
  
    | This pull request was exported from Phabricator. Differential Revision: D48433285 | 
Summary: Pull Request resolved: facebook#39078 Simplifies and hardens behaviour for detecting other processes / dev server instances when running `react-native start`. - New flow: - Exits with error message if port is taken by another process (*no longer suggests next port*). - Exits with info message if port is taken by another instance of this dev server (**unchanged**). - Continues if result unknown. - *(No longer logs dedicated message for another RN server running in a different project root.)* - This now checks if the TCP port is in use before attempting an HTTP fetch. Previous behaviour: [`handlePortUnavailable`](https://github.com/react-native-community/cli/blob/734222118707fff41c71463528e4e0c227b31cc6/packages/cli-tools/src/handlePortUnavailable.ts#L8). This decouples us from some lower-level `react-native-community/cli-tools` utils, which remain reused by the `android` and `ios` commands. Changelog: [Internal] Reviewed By: motiz88 Differential Revision: D48433285 fbshipit-source-id: 314b4ba7784e9625550c04f4db5a59b7b6844583
8fcb34b    to
    5645f96      
    Compare
  
    Summary: Pull Request resolved: facebook#39078 Simplifies and hardens behaviour for detecting other processes / dev server instances when running `react-native start`. - New flow: - Exits with error message if port is taken by another process (*no longer suggests next port*). - Exits with info message if port is taken by another instance of this dev server (**unchanged**). - Continues if result unknown. - *(No longer logs dedicated message for another RN server running in a different project root.)* - This now checks if the TCP port is in use before attempting an HTTP fetch. Previous behaviour: [`handlePortUnavailable`](https://github.com/react-native-community/cli/blob/734222118707fff41c71463528e4e0c227b31cc6/packages/cli-tools/src/handlePortUnavailable.ts#L8). This decouples us from some lower-level `react-native-community/cli-tools` utils, which remain reused by the `android` and `ios` commands. Changelog: [Internal] Differential Revision: https://internalfb.com/D48433285 fbshipit-source-id: 22e4fdf28bf289eb6617b8e27828f7816a82e05a
| This pull request was exported from Phabricator. Differential Revision: D48433285 | 
Summary: Pull Request resolved: facebook#39078 Simplifies and hardens behaviour for detecting other processes / dev server instances when running `react-native start`. - New flow: - Exits with error message if port is taken by another process (*no longer suggests next port*). - Exits with info message if port is taken by another instance of this dev server (**unchanged**). - Continues if result unknown. - *(No longer logs dedicated message for another RN server running in a different project root.)* - This now checks if the TCP port is in use before attempting an HTTP fetch. Previous behaviour: [`handlePortUnavailable`](https://github.com/react-native-community/cli/blob/734222118707fff41c71463528e4e0c227b31cc6/packages/cli-tools/src/handlePortUnavailable.ts#L8). This decouples us from some lower-level `react-native-community/cli-tools` utils, which remain reused by the `android` and `ios` commands. Changelog: [Internal] Reviewed By: motiz88 Differential Revision: D48433285 fbshipit-source-id: c065d182f6a14a5f68e620fa73076b5c435cbeaa
5645f96    to
    8d70691      
    Compare
  
    Summary: Pull Request resolved: facebook#39078 Simplifies and hardens behaviour for detecting other processes / dev server instances when running `react-native start`. - New flow: - Exits with error message if port is taken by another process (*no longer suggests next port*). - Exits with info message if port is taken by another instance of this dev server (**unchanged**). - Continues if result unknown. - *(No longer logs dedicated message for another RN server running in a different project root.)* - This now checks if the TCP port is in use before attempting an HTTP fetch. Previous behaviour: [`handlePortUnavailable`](https://github.com/react-native-community/cli/blob/734222118707fff41c71463528e4e0c227b31cc6/packages/cli-tools/src/handlePortUnavailable.ts#L8). This decouples us from some lower-level `react-native-community/cli-tools` utils, which remain reused by the `android` and `ios` commands. Changelog: [Internal] Differential Revision: https://internalfb.com/D48433285 fbshipit-source-id: 05a67559041155607f4a869d3f870e98d5f0c0a4
| This pull request was exported from Phabricator. Differential Revision: D48433285 | 
8d70691    to
    2b53149      
    Compare
  
    Summary: Pull Request resolved: facebook#39078 Simplifies and hardens behaviour for detecting other processes / dev server instances when running `react-native start`. - New flow: - Exits with error message if port is taken by another process (*no longer suggests next port*). - Exits with info message if port is taken by another instance of this dev server (**unchanged**). - Continues if result unknown. - *(No longer logs dedicated message for another RN server running in a different project root.)* - This now checks if the TCP port is in use before attempting an HTTP fetch. Previous behaviour: [`handlePortUnavailable`](https://github.com/react-native-community/cli/blob/734222118707fff41c71463528e4e0c227b31cc6/packages/cli-tools/src/handlePortUnavailable.ts#L8). This decouples us from some lower-level `react-native-community/cli-tools` utils, which remain reused by the `android` and `ios` commands. Changelog: [Internal] Reviewed By: motiz88 Differential Revision: D48433285 fbshipit-source-id: eeb164b1c3f1dbfed989cad9d8dc412d2081a0d4
Summary: Pull Request resolved: facebook#39078 Simplifies and hardens behaviour for detecting other processes / dev server instances when running `react-native start`. - New flow: - Exits with error message if port is taken by another process (*no longer suggests next port*). - Exits with info message if port is taken by another instance of this dev server (**unchanged**). - Continues if result unknown. - *(No longer logs dedicated message for another RN server running in a different project root.)* - This now checks if the TCP port is in use before attempting an HTTP fetch. Previous behaviour: [`handlePortUnavailable`](https://github.com/react-native-community/cli/blob/734222118707fff41c71463528e4e0c227b31cc6/packages/cli-tools/src/handlePortUnavailable.ts#L8). This decouples us from some lower-level `react-native-community/cli-tools` utils, which remain reused by the `android` and `ios` commands. Changelog: [Internal] Differential Revision: https://internalfb.com/D48433285 fbshipit-source-id: 04e7189d8b85fd6150da091fd980ac9f3627d4ae
| This pull request was exported from Phabricator. Differential Revision: D48433285 | 
Summary: Pull Request resolved: facebook#39078 Simplifies and hardens behaviour for detecting other processes / dev server instances when running `react-native start`. - New flow: - Exits with error message if port is taken by another process (*no longer suggests next port*). - Exits with info message if port is taken by another instance of this dev server (**unchanged**). - Continues if result unknown. - *(No longer logs dedicated message for another RN server running in a different project root.)* - This now checks if the TCP port is in use before attempting an HTTP fetch. Previous behaviour: [`handlePortUnavailable`](https://github.com/react-native-community/cli/blob/734222118707fff41c71463528e4e0c227b31cc6/packages/cli-tools/src/handlePortUnavailable.ts#L8). This decouples us from some lower-level `react-native-community/cli-tools` utils, which remain reused by the `android` and `ios` commands. Changelog: [Internal] Reviewed By: motiz88 Differential Revision: D48433285 fbshipit-source-id: 77a062b7519cf78d1e19d6d401217c02d6e5d381
2b53149    to
    d80873d      
    Compare
  
    Summary: Pull Request resolved: facebook#39078 Simplifies and hardens behaviour for detecting other processes / dev server instances when running `react-native start`. - New flow: - Exits with error message if port is taken by another process (*no longer suggests next port*). - Exits with info message if port is taken by another instance of this dev server (**unchanged**). - Continues if result unknown. - *(No longer logs dedicated message for another RN server running in a different project root.)* - This now checks if the TCP port is in use before attempting an HTTP fetch. Previous behaviour: [`handlePortUnavailable`](https://github.com/react-native-community/cli/blob/734222118707fff41c71463528e4e0c227b31cc6/packages/cli-tools/src/handlePortUnavailable.ts#L8). This decouples us from some lower-level `react-native-community/cli-tools` utils, which remain reused by the `android` and `ios` commands. Changelog: [Internal] Differential Revision: https://internalfb.com/D48433285 fbshipit-source-id: e0e340e834d7428b4a191613112d8d675ffe2fe1
| This pull request was exported from Phabricator. Differential Revision: D48433285 | 
Summary: Pull Request resolved: facebook#39078 Simplifies and hardens behaviour for detecting other processes / dev server instances when running `react-native start`. - New flow: - Exits with error message if port is taken by another process (*no longer suggests next port*). - Exits with info message if port is taken by another instance of this dev server (**unchanged**). - Continues if result unknown. - *(No longer logs dedicated message for another RN server running in a different project root.)* - This now checks if the TCP port is in use before attempting an HTTP fetch. Previous behaviour: [`handlePortUnavailable`](https://github.com/react-native-community/cli/blob/734222118707fff41c71463528e4e0c227b31cc6/packages/cli-tools/src/handlePortUnavailable.ts#L8). This decouples us from some lower-level `react-native-community/cli-tools` utils, which remain reused by the `android` and `ios` commands. Changelog: [Internal] Reviewed By: motiz88 Differential Revision: D48433285 fbshipit-source-id: 5dce80365449165116d52e68c4de5624cc3a840c
d80873d    to
    f39483d      
    Compare
  
    Summary: Pull Request resolved: facebook#39078 Simplifies and hardens behaviour for detecting other processes / dev server instances when running `react-native start`. - New flow: - Exits with error message if port is taken by another process (*no longer suggests next port*). - Exits with info message if port is taken by another instance of this dev server (**unchanged**). - Continues if result unknown. - *(No longer logs dedicated message for another RN server running in a different project root.)* - This now checks if the TCP port is in use before attempting an HTTP fetch. Previous behaviour: [`handlePortUnavailable`](https://github.com/react-native-community/cli/blob/734222118707fff41c71463528e4e0c227b31cc6/packages/cli-tools/src/handlePortUnavailable.ts#L8). This decouples us from some lower-level `react-native-community/cli-tools` utils, which remain reused by the `android` and `ios` commands. Changelog: [Internal] Differential Revision: https://internalfb.com/D48433285 fbshipit-source-id: 06b566c451ea8790ae845917cbd70931a7737597
Summary: Follow-up to facebook#38988. - Upgrade to RN CLI `12.0.0-alpha.10`. - Restore previous value check against `/status` response in test scripts (restored in above CLI alpha). Changelog: [Internal] Differential Revision: https://internalfb.com/D48432629 fbshipit-source-id: 755be14a954c28f807eed94238e9f3497fdda9c0
Summary: Pull Request resolved: facebook#39075 Small refactor: reorganise command entry points and types into a consistent pattern. Changelog: [Internal] Differential Revision: https://internalfb.com/D48433284 fbshipit-source-id: 5cc145b474c8c5cbf350cfee1a1b92091afd9b18
Summary: Pull Request resolved: facebook#39078 Simplifies and hardens behaviour for detecting other processes / dev server instances when running `react-native start`. - New flow: - Exits with error message if port is taken by another process (*no longer suggests next port*). - Exits with info message if port is taken by another instance of this dev server (**unchanged**). - Continues if result unknown. - *(No longer logs dedicated message for another RN server running in a different project root.)* - This now checks if the TCP port is in use before attempting an HTTP fetch. Previous behaviour: [`handlePortUnavailable`](https://github.com/react-native-community/cli/blob/734222118707fff41c71463528e4e0c227b31cc6/packages/cli-tools/src/handlePortUnavailable.ts#L8). This decouples us from some lower-level `react-native-community/cli-tools` utils, which remain reused by the `android` and `ios` commands. Changelog: [Internal] Reviewed By: motiz88 Differential Revision: D48433285 fbshipit-source-id: 22ed8b050a6ce729d19cc46da377697547a32582
Summary: Pull Request resolved: facebook#39078 Simplifies and hardens behaviour for detecting other processes / dev server instances when running `react-native start`. - New flow: - Exits with error message if port is taken by another process (*no longer suggests next port*). - Exits with info message if port is taken by another instance of this dev server (**unchanged**). - Continues if result unknown. - *(No longer logs dedicated message for another RN server running in a different project root.)* - This now checks if the TCP port is in use before attempting an HTTP fetch. Previous behaviour: [`handlePortUnavailable`](https://github.com/react-native-community/cli/blob/734222118707fff41c71463528e4e0c227b31cc6/packages/cli-tools/src/handlePortUnavailable.ts#L8). This decouples us from some lower-level `react-native-community/cli-tools` utils, which remain reused by the `android` and `ios` commands. Changelog: [Internal] Differential Revision: https://internalfb.com/D48433285 fbshipit-source-id: c893444eafc19dd3bfc7cc91995550f6e8372e3f
| This pull request was exported from Phabricator. Differential Revision: D48433285 | 
f39483d    to
    bcf41d8      
    Compare
  
    | This pull request has been merged in 13eda31. | 
Summary:
Simplifies and hardens behaviour for detecting other processes / dev server instances when running
react-native start.Previous behaviour:
handlePortUnavailable. This decouples us from some lower-levelreact-native-community/cli-toolsutils, which remain reused by theandroidandioscommands.Changelog: [Internal]
Reviewed By: motiz88
Differential Revision: D48433285