Commit Graph

94 Commits

Author SHA1 Message Date
Brian Vaughn cb3fb42129
Patch console to append component stacks (#348)
* Patch console.warn and console.error to auto-append owners-only component stacks.

This setting is enabled by default and will work for React Native even if no front-end DevTools shell is being used. The setting can be disabled via a new, persisted user preference though.
2019-07-17 11:12:39 -07:00
Brian Vaughn 0f2fb5badf
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
2019-07-13 10:05:04 -07:00
Brian Vaughn a6d3f30f95 Initial support for hydration added to both renderer interfaces. 2019-06-16 17:32:37 -07:00
Brian Vaughn ea03ddd583 Added Flow type coverage for all EventEmitter subclasses 2019-06-09 15:50:17 -07:00
Brian Vaughn bd5c2e4621 Initial change tracking implemented
* User profiling setting
* Background collects changed props/state (not added/removed or hooks yet)
* Tests updated
2019-06-07 15:38:26 -07:00
Brian Vaughn 78721bde4c Backend notifies the frontend of Storage API support. Frontend disables e.g. reload-and-profile based on this. 2019-06-07 13:08:49 -07:00
Brian Vaughn 3e3c83aecd Updated reload-and-profile temp key to use sessioStorage instead of localStorage 2019-06-07 12:40:59 -07:00
Brian Vaughn 89e36e3976 Wrap all calls to localStorage/sessionStorage to avoid potential runtime errors 2019-06-07 10:51:01 -07:00
Brian Vaughn aa87b125e7 Lots of tweaks
Remove selected guideline in favor of background color for selected subtree.
Add badges in grid format to selected elements prop panel.
Show badges beside owners list.
2019-06-01 08:24:24 -07:00
Brian Vaughn af47c39dbb Added and view-source support for Memo components 2019-05-26 10:33:19 -07:00
Brian Vaughn 98623dfdb0 Tweak 2019-05-22 16:40:40 -07:00
Dominic Gannaway d98161874c [Flare] Ensure DOM inspection is Flare compatible 2019-05-22 16:29:54 -07:00
Brian Vaughn c6de014a9a Massively overhauled profiling data architecture 2019-05-22 06:05:25 -07:00
Brian Vaughn 6fd2e72b5e Minor nits 2019-05-14 11:01:41 -07:00
Ivan Babak 76e569992b Cleanup profile export/import data types, add export/import test
Strengthened the I/O-boundary type conversion logic.

Fixed type inconsistencies uncovered by removing `any` and
by making explicit type annotations and transformations.

In particular, these were likely malformed when restored from a file:
- `commitDetails`
- `interactions`
- `initialTreeBaseDurations`

The mismatches were Map vs interleaved Array.
2019-05-13 23:59:01 -07:00
Brian Vaughn b74f3f507a Added basic tests for InspectedElementContext 2019-05-10 09:13:54 -07:00
Brian Vaughn 564a223368 Fetch owners list from renderer (using suspense)
Owners in the list may have been filtered out of the Store, but in the owners list view- it's important to still show them. The frontend cannot do this on its own, so this list needs to come from the renderer interface.
2019-05-09 11:47:22 -07:00
Brian Vaughn acdc9bae67 Added export+import profiling data test coverage
Also fixed an incomplete import feature as well as a regression in export that had gone unnoticed due to previous lack of test coverage.
2019-05-07 13:08:46 -07:00
Brian Vaughn 8850a9a64a Merge branch '232-clear-profiling-data-for-unmounted-root' of https://github.com/sompylasar/react-devtools-experimental into sompylasar-232-clear-profiling-data-for-unmounted-root 2019-05-03 09:24:58 -07:00
Brian Vaughn ef596be1ef
Merge pull request #207 from sompylasar/131-highlight-all-children
Support highlighting of all DOM elements of Fragments, not just first
2019-05-02 08:31:22 -07:00
Brian Vaughn 8429220164 Added filter UI (but with a lot of $FlowFixMe comments) 2019-05-01 10:45:18 -07:00
Brian Vaughn a241780dc2 Filter changes are applied to the renderer without reloading 2019-05-01 10:45:18 -07:00
Ivan Babak c6c71ef8f9 Fix profiling screenshots data structure to map rootID to commitIndex
Propagate `rootID` throughout the code for `captureScreenshot`.

Rename private profiling maps of `store` to make relations more clear.

Fix missing cleanup for screenshots data in `set importedProfilingData` of `store`.
2019-05-01 01:07:36 -07:00
Ivan Babak 0b817777b4 Remove Agent addBridge: there can only be one bridge, add in constructor
Let's make impossible states truly impossible, and fix Flow types, too.

All three usages of Agent called addBridge right after constructing it.
Agent has one field `_bridge` which is force-typed as not-null despite
there's a temporary zone between the constructor end and addBridge start
where `_bridge` is null.
2019-04-28 04:03:28 -07:00
Ivan Babak 281616f462 Support highlighting of all DOM elements of Fragments, not just first
Fixes https://github.com/bvaughn/react-devtools-experimental/issues/131

Uses the new function `findAllCurrentHostFibers`.

Removes dependency on React's `renderer.findHostInstanceByFiber` function
which used to highlight only the first DOM element of a Fragment.

Reworked `src/backend/views/Overlay` to support highlighting
more than one element rectangle annotated with one tooltip.
Fixed minor issues with the tooltip position calculation.
2019-04-26 01:22:49 -07:00
Dan Abramov 5d2d4213ec Delete stale paths 2019-04-24 15:05:21 +01:00
Dan Abramov e050529c7d Read renderer ID from operations 2019-04-24 15:00:46 +01:00
Dan Abramov 26162988aa Fix tests 2019-04-24 14:37:46 +01:00
Dan Abramov d8abecdcf9 Persist and restore selection in agent
This implements the infrastructure for saving and restoring renderer-specific selection state in the session storage.

Note this doesn't actually implement the calculation and tracking of paths in the renderer. It only simulates that the renderer can do it. The actual implementation will come in a later commit.
2019-04-24 14:37:46 +01:00
Dan Abramov 006e03c38e Ignore leading edge of find-by-DOM throttle 2019-04-20 22:17:12 +01:00
Dan Abramov d05106e364 Clear DOM overlay on shutdown 2019-04-20 14:34:13 +01:00
Dan ce335b8975 View DOM button opens Elements tab 2019-04-13 18:59:47 +01:00
Dan Abramov 1c381c588a Picking a DOM node focuses the tree 2019-04-10 18:27:40 +01:00
Dan 72eccb465d Make DOM selection binding one-way 2019-04-09 01:30:40 +01:00
Dan Abramov 267ab34fbd
Merge pull request #99 from gaearon/sync-tabs
Sync DevTools Elements and Components tabs
2019-04-08 23:55:16 +01:00
Dan 3b793953b1 Keep DOM selection if last $0 resolves to same component 2019-04-08 23:46:47 +01:00
Dan 436912ab2d Remove unnecessary logic 2019-04-08 23:35:01 +01:00
Dan 7aecd58d81 Nits 2019-04-08 23:28:31 +01:00
Dan c91676b557 Don't change browser selection unless React selection changed 2019-04-08 21:57:13 +01:00
Brian Vaughn 5db5e40bf1 Replaced Agent setInterval with throttle+memoize 2019-04-08 13:50:04 -07:00
Dan Abramov 388677fcbc
Merge branch 'master' into continuous-select 2019-04-08 20:50:58 +01:00
Dan Abramov 4a301bd0e0 Sync DevTools Elements and Components tabs 2019-04-08 20:41:01 +01:00
Dan Abramov 5b120d6b24 Add a separate button for logging values 2019-04-08 18:39:37 +01:00
Dan Abramov c6ee445ea9 Address review 2019-04-08 18:00:48 +01:00
Dan Abramov 39223239bb Select DOM nodes on hover 2019-04-08 17:58:12 +01:00
Brian Vaughn 44c0febd23 Profiler shows commit times and durations for selected fiber 2019-04-07 08:36:37 -07:00
Dan 99593444b9 Address review 2019-04-06 21:30:57 +01:00
Dan 785bb9f56c Continuously update tree selection in DOM inspection mode 2019-04-06 20:27:36 +01:00
Dan 5eec8aed33 Nit 2019-04-06 18:26:17 +01:00
Dan ab9c1b84c8 Show owner in DOM highilght overlay 2019-04-06 17:07:06 +01:00