react icon indicating copy to clipboard operation
react copied to clipboard

[devtools] Introduce REACT_DEVTOOLS_PORT for the standalone react-devtools

Open brendo opened this issue 1 year ago • 4 comments

Summary

This PR attempts to make running the React DevTools a little friendlier in projects that are not completely React.

At the moment, running the DevTools with npx react-devtools will default to the port to use the PORT env variable otherwise it'll fall back to 8097. PORT is a common env variable, so we can get into this strange situation where the a Rails server (eg Puma) is using PORT, and then the React DevTools attempts to boot using the same PORT.

This PR introduces a dedicated env variable, REACT_DEVTOOLS_PORT to assist in this scenario.

How did you test this change?

I'm using fish shell, so I did the following, please let me know if there's a better way:

cd packages/react-devtools
set -x PORT 1000
set -x REACT_DEVTOOLS_PORT 2000
node bin.js

We can see in the UI that it's listening on 2000. Without this PR, it'd listen on 1000:

Screenshot 2024-08-21 at 10 45 42 AM

brendo avatar Aug 21 '24 00:08 brendo

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-compiler-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 11, 2024 9:44am

vercel[bot] avatar Aug 21 '24 00:08 vercel[bot]

Hi @brendo!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

facebook-github-bot avatar Aug 21 '24 00:08 facebook-github-bot

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

facebook-github-bot avatar Aug 22 '24 02:08 facebook-github-bot

👋 @sebmarkbage @hoxyq is this PR something the team would be interested in?

brendo avatar Sep 06 '24 05:09 brendo

This pull request has been automatically marked as stale. If this pull request is still relevant, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize reviewing it yet. Your contribution is very much appreciated.

github-actions[bot] avatar Feb 09 '25 10:02 github-actions[bot]

Bump.

brendo avatar Feb 10 '25 23:02 brendo

Thanks!

hoxyq avatar Feb 11 '25 18:02 hoxyq

This will be available with the next release of the npm package, I don't have dates set yet, but probably in a few weeks.

hoxyq avatar Feb 11 '25 18:02 hoxyq

Thank you!

brendo avatar Feb 12 '25 02:02 brendo