From 9970b3463ff3ba8d16082d3cf4563f9761195bc2 Mon Sep 17 00:00:00 2001 From: jhen Date: Fri, 21 Jul 2023 13:48:53 +0800 Subject: [PATCH 1/2] Default RN pakcager port of new window to 19000 --- app/containers/App.js | 2 +- npm-package/bin/rndebugger-open.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/containers/App.js b/app/containers/App.js index 795f8006..b5833bb0 100644 --- a/app/containers/App.js +++ b/app/containers/App.js @@ -166,7 +166,7 @@ export default class App extends Component { button="Confirm" inputProps={{ type: 'input', - value: 19001, + value: 19000, }} onInputChange={value => Number(value.replace(/\D/g, '').substr(0, 5)) || ''} onSubmit={this.handlePortOnSubmit} diff --git a/npm-package/bin/rndebugger-open.js b/npm-package/bin/rndebugger-open.js index 54033e2e..2c503e68 100755 --- a/npm-package/bin/rndebugger-open.js +++ b/npm-package/bin/rndebugger-open.js @@ -6,7 +6,7 @@ const fs = require('fs'); const path = require('path'); const defaultPort = 8081; -const expoDefaultPort = 19001; +const expoDefaultPort = 19000; const expoInfoPath = path.join(process.cwd(), '.expo/packager-info.json'); From b5bb1c6c582fc031d8c6720cb92f4243452ccc39 Mon Sep 17 00:00:00 2001 From: jhen Date: Fri, 21 Jul 2023 13:58:53 +0800 Subject: [PATCH 2/2] rndebugger-open: Remove --expo flag expo 49 start using 8081 as default packager port, also packager-info is no longer supported. users are also able to use `--port 19000` for Expo <= 48. closes #689 --- npm-package/README.md | 3 ++- npm-package/bin/rndebugger-open.js | 16 +--------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/npm-package/README.md b/npm-package/README.md index 4e1e79c5..8ec89c94 100644 --- a/npm-package/README.md +++ b/npm-package/README.md @@ -47,6 +47,8 @@ $ REACT_DEBUGGER="rndebugger-open --open --port 8081" npm start $ set REACT_DEBUGGER="rndebugger-open --open --port 8081" && npm start ``` +If you're using Expo <= 48, use port 19000 instead of 8081. + #### Options (--option) Name | Description @@ -55,7 +57,6 @@ Name | Description `revert` | Revert rndebugger-open injection. Default is `false` `open` | Run open directly instead of inject patch `port` | Specified react-native packager port with `--open` option. Default is `8081` -`expo` | Use [Expo](https://github.com/expo)'s RN packager port if you're not specified port. You can also [`Launch by CLI or React Native packager`](https://github.com/jhen0409/react-native-debugger/blob/master/docs/getting-started.md#launch-by-cli-or-react-native-packager-macos-only) instead of this package. diff --git a/npm-package/bin/rndebugger-open.js b/npm-package/bin/rndebugger-open.js index 2c503e68..d6e5bb89 100755 --- a/npm-package/bin/rndebugger-open.js +++ b/npm-package/bin/rndebugger-open.js @@ -2,19 +2,7 @@ 'use strict'; -const fs = require('fs'); -const path = require('path'); - const defaultPort = 8081; -const expoDefaultPort = 19000; - -const expoInfoPath = path.join(process.cwd(), '.expo/packager-info.json'); - -/* eslint-disable global-require */ -const getExpoPort = () => - (fs.existsSync(expoInfoPath) - ? require(expoInfoPath).packagerPort || expoDefaultPort - : expoDefaultPort); const argv = require('minimist')(process.argv.slice(2), { boolean: [ @@ -26,8 +14,6 @@ const argv = require('minimist')(process.argv.slice(2), { 'macos', // Open directly instead of Inject code 'open', - // Use expo packager port (getExpoPort) instead of RN packager default port (8081) - 'expo', ], string: ['port', 'host'], default: { @@ -36,7 +22,7 @@ const argv = require('minimist')(process.argv.slice(2), { }); let moduleName; -argv.port = Number(argv.port) || (argv.expo ? getExpoPort() : defaultPort); +argv.port = Number(argv.port) || defaultPort; if (argv.open && (argv.port || argv.host)) { moduleName = '../lib/open'; } else {