Standalone NPM packages and React Native support (#335) * Add version 4 react-devtools and react-devtools-core packages which support both React Native and e.g. Safari or iframe DOM usage. * Replaces typed operations arrays with regular arrays in order to support Hermes. This is unfortunate, since in theory a typed array buffer could be more efficiently transferred between frontend and backend for the web extension, but this never actually worked properly in v8, only Spidermonkey, and it fails entirely in Hermes so for the time being- it's been removed. * Adds support for React Native (paper renderer) * Adds a style editor for react-native and react-native-web - #10
Standalone NPM packages and React Native support (#335)
* Add version 4 react-devtools and react-devtools-core packages which support both React Native and e.g. Safari or iframe DOM usage.
* Replaces typed operations arrays with regular arrays in order to support Hermes. This is unfortunate, since in theory a typed array buffer could be more efficiently transferred between frontend and backend for the web extension, but this never actually worked properly in v8, only Spidermonkey, and it fails entirely in Hermes so for the time being- it's been removed.
* Adds support for React Native (paper renderer)
* Adds a style editor for react-native and react-native-web#10Menkalian wants to merge 1 commit into
Conversation
* Add version 4 react-devtools and react-devtools-core packages which support both React Native and e.g. Safari or iframe DOM usage. * Replaces typed operations arrays with regular arrays in order to support Hermes. This is unfortunate, since in theory a typed array buffer could be more efficiently transferred between frontend and backend for the web extension, but this never actually worked properly in v8, only Spidermonkey, and it fails entirely in Hermes so for the time being- it's been removed. * Adds support for React Native (paper renderer) * Adds a style editor for react-native and react-native-web
There was a problem hiding this comment.
Pull request overview
This pull request adds standalone NPM packages (react-devtools and react-devtools-core) with React Native support, replacing typed arrays with regular arrays for Hermes compatibility and introducing a style editor for React Native and react-native-web.
Key Changes:
- Replaces
Uint32ArraywithArray<number>throughout the codebase for Hermes compatibility - Adds two new NPM packages:
react-devtools(Electron app) andreact-devtools-core(backend/standalone) - Introduces React Native style editor with layout viewer and style editing capabilities
Reviewed changes
Copilot reviewed 73 out of 77 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| yarn.lock | Adds dependencies for Electron, WebSocket (ws@^7), and various utilities |
| src/utils.js | Converts UTF encoding functions from Uint32Array to Array |
| src/hydration.js | Improves data type handling with PropType enum and NaN/Infinity support |
| src/devtools/views/DevTools.js | Refactors viewElementSource API and removes browserName prop |
| src/devtools/store.js | Adds native style editor support and operations handling |
| src/bridge.js | Renames DOM-specific events to native* variants, changes operations type |
| src/backend/renderer.js | Updates operations from Uint32Array to Array, adds getInstanceAndStyle |
| src/backend/agent.js | Extracts highlighter setup, adds native style editor support |
| packages/react-devtools/* | New Electron-based standalone package |
| packages/react-devtools-core/* | New core package with backend and standalone implementations |
| babel.config.js | Adds IE 11 target for Hermes/React Native compatibility |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| {style !== null && ( | ||
| <StyleEditor | ||
| id={inspectedElementID} | ||
| style={style !== null ? style : {}} |
There was a problem hiding this comment.
Variable 'style' cannot be of type null, but it is compared to an expression of type null.
| @@ -0,0 +1,315 @@ | |||
| // @flow | |||
|
|
|||
| import Agent from 'src/backend/agent'; | |||
There was a problem hiding this comment.
Unused import Agent.
| // @flow | ||
|
|
||
| import Agent from 'src/backend/agent'; | ||
| import Bridge from 'src/bridge'; |
There was a problem hiding this comment.
Unused import Bridge.
|
|
||
| import memoize from 'memoize-one'; | ||
| import throttle from 'lodash.throttle'; | ||
| import Bridge from 'src/bridge'; |
There was a problem hiding this comment.
Unused import Bridge.
| import memoize from 'memoize-one'; | ||
| import throttle from 'lodash.throttle'; | ||
| import Bridge from 'src/bridge'; | ||
| import Agent from 'src/backend/agent'; |
There was a problem hiding this comment.
Unused import Agent.
| // @flow | ||
|
|
||
| import React, { Fragment, useContext, useMemo } from 'react'; | ||
| import Store from 'src/devtools/store'; |
There was a problem hiding this comment.
Unused import Store.
No description provided.