react/packages/react-devtools-extensions
MU AOHUA dc9b74647e
[DevTools] Add fb local build command (#32644)
<!--
  Thanks for submitting a pull request!
We appreciate you spending the time to work on these changes. Please
provide enough information so that others can review your pull request.
The three fields below are mandatory.

Before submitting a pull request, please make sure the following is
done:

1. Fork [the repository](https://github.com/facebook/react) and create
your branch from `main`.
  2. Run `yarn` in the repository root.
3. If you've fixed a bug or added code that should be tested, add tests!
4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch
TestName` is helpful in development.
5. Run `yarn test --prod` to test in the production environment. It
supports the same options as `yarn test`.
6. If you need a debugger, run `yarn test --debug --watch TestName`,
open `chrome://inspect`, and press "Inspect".
7. Format your code with
[prettier](https://github.com/prettier/prettier) (`yarn prettier`).
8. Make sure your code lints (`yarn lint`). Tip: `yarn linc` to only
check changed files.
  9. Run the [Flow](https://flowtype.org/) type checks (`yarn flow`).
  10. If you haven't already, complete the CLA.

Learn more about contributing:
https://reactjs.org/docs/how-to-contribute.html
-->

## Summary
1. Having a development build for FB will be convenient for fb internal
feature development
2. Add a new checkbox to toggle new internal features added to React
Devtools.

## How did you test this change?
1. yarn test
2. set extra env variables in bash profile and build an internal version
with the new script.
3. toggle on/off the new checkbox, the value is stored in local storage
correctly.

---------

Co-authored-by: Aohua Mu <muaohua@fb.com>
2025-03-25 13:45:48 +00:00
..
.circleci Reorganized things again into packages 2019-08-13 11:37:25 -07:00
chrome React DevTools 6.1.0 -> 6.1.1 (#32326) 2025-02-07 10:54:44 +00:00
edge React DevTools 6.1.0 -> 6.1.1 (#32326) 2025-02-07 10:54:44 +00:00
firefox React DevTools 6.1.0 -> 6.1.1 (#32326) 2025-02-07 10:54:44 +00:00
flow-typed lint: enable reportUnusedDisableDirectives and remove unused suppressions (#28721) 2024-06-21 12:24:32 -04:00
icons Optimized DevTools extension images 2021-08-02 09:32:46 -04:00
popups feat[devtools/extension]: show disclaimer when page doesnt run react and refactor react polling logic (#27373) 2023-09-20 13:30:50 +01:00
src fix[DevTools/Tree]: only scroll to item when panel is visible (#32018) 2025-01-09 18:38:49 +00:00
build.js refactor: resolve browser via env variables based on build rather than user agent (#27179) 2023-08-29 10:40:02 +01:00
deploy.chrome.html Fixed a bunch of Lint issues 2019-08-13 21:59:07 -07:00
deploy.edge.html React developer tools extension for Microsoft Edge (#18041) 2020-02-18 09:40:30 -08:00
deploy.firefox.html Fixed a bunch of Lint issues 2019-08-13 21:59:07 -07:00
deploy.html make link https (#19147) 2020-06-30 12:43:52 +01:00
deploy.js Added windows powershell syntax to build scripts (#27692) 2023-11-16 11:35:43 +00:00
improveImages.mjs [DevTools] Optimize Images yarn command (part 2) (#21968) 2021-08-02 09:32:17 -04:00
main.html Fixed a bunch of Lint issues 2019-08-13 21:59:07 -07:00
package.json [DevTools] Add fb local build command (#32644) 2025-03-25 13:45:48 +00:00
panel.html feat[devtools/extension]: show disclaimer when page doesnt run react and refactor react polling logic (#27373) 2023-09-20 13:30:50 +01:00
README.md Include install command for devtools-extension build instructions (#25053) 2022-10-05 11:27:09 -04:00
utils.js chore[react-devtools]: unify console patching and default to ansi escape symbols (#29869) 2024-06-17 16:31:36 +01:00
webpack.backend.js chore[react-devtools]: add global for native and use it to fork backend implementation (#30533) 2024-08-02 10:51:15 +01:00
webpack.config.js feat: display message if user ended up opening hook script (#31000) 2024-09-19 15:44:34 +01:00

This is the source code for the React DevTools browser extension.

Installation

The easiest way to install this extension is as a browser add-on:

Local development

You can also build and install this extension from source.

Prerequisite steps

DevTools depends on local versions of several NPM packages1 also in this workspace. You'll need to either build or download those packages first.

1 Note that at this time, an experimental build is required because DevTools depends on the createRoot API.

To install all necessary dependencies, run the following command from the root of the repository:

yarn install

Build from source

To build dependencies from source, run the following command from the root of the repository:

yarn build-for-devtools

Download from CI

To use the latest build from CI, run the following commands starting from the root of the repository:

cd scripts/release
yarn install
./download-experimental-build.js

Build steps

Once the above packages have been built or downloaded, you can build the extension by running:

cd packages/react-devtools-extensions/

yarn build:chrome # => packages/react-devtools-extensions/chrome/build
yarn run test:chrome # Test Chrome extension

yarn build:firefox # => packages/react-devtools-extensions/firefox/build
yarn run test:firefox # Test Firefox extension

yarn build:edge # => packages/react-devtools-extensions/edge/build
yarn run test:edge # Test Edge extension