Commit Graph
30 Commits
Author SHA1 Message Date
Brian VaughnandGitHub 15fed0570a Update DevTools Error strings to support GitHub fuzzy search (#21314) 2021-04-19 13:05:28 -04:00
29afa88383 [devtools] Fix can't expand prop value in some scenario (#20534)
Co-authored-by: Brian Vaughn <[email protected]>
2021-01-19 10:26:52 -05:00
91e2ddbda9 Expose DEV-mode warnings in devtools UI (#20463)
Co-authored-by: Brian Vaughn <[email protected]>
2020-12-22 11:09:29 -05:00
7cb091e206 Don't consumer iterators while inspecting (#19831)
Co-authored-by: Brian Vaughn <[email protected]>
2020-09-22 14:23:20 -04:00
Brian VaughnandGitHub 692f18378d Improve DevTools editing interface (#19774)
* Improve DevTools editing interface

This commit adds the ability to rename or delete keys in the props/state/hooks/context editor and adds tests to cover this functionality. DevTools will degrade gracefully for older versions of React that do not inject the new reconciler rename* or delete* methods.

Specifically, this commit includes the following changes:
* Adds unit tests (for modern and legacy renderers) to cover overriding props, renaming keys, and deleting keys.
* Refactor backend override methods to reduce redundant Bridge/Agent listeners and methods.
* Inject new (DEV-only) methods from reconciler into DevTools to rename and delete paths.
* Refactor 'inspected element' UI components to improve readability.
* Improve auto-size input to better mimic Chrome's Style editor panel. (See this Code Sandbox for a proof of concept.)

It also contains the following code cleanup:
* Additional unit tests have been added for modifying values as well as renaming or deleting paths.
* Four new DEV-only methods have been added to the reconciler to be injected into the DevTools hook: overrideHookStateDeletePath, overrideHookStateRenamePath, overridePropsDeletePath, and overridePropsRenamePath. (DevTools will degrade gracefully for older renderers without these methods.)
* I also took this as an opportunity to refactor some of the existing code in a few places:
  * Rather than the backend implementing separate methods for editing props, state, hooks, and context– there are now three methods: deletePath, renamePath, and overrideValueAtPath that accept a type argument to differentiate between props, state, context, or hooks.
  * The various UI components for the DevTools frontend have been refactored to remove some unnecessary repetition.

This commit also adds temporary support for override* commands with mismatched backend/frontend versions:
* Add message forwarding for older backend methods (overrideContext, overrideHookState, overrideProps, and overrideState) to the new overrideValueAtPath method. This was done in both the frontend Bridge (for newer frontends passing messages to older embedded backends) and in the backend Agent (for older frontends passing messages to newer backends). We do this because React Native embeds the React DevTools backend, but cannot control which version of the frontend users use.
* Additional unit tests have been added as well to cover the older frontend to newer backend case. Our DevTools test infra does not make it easy to write tests for the other way around.
2020-09-18 11:07:18 -04:00
0d40530d94 React DevTools: Show symbols used as keys in state (#19786)
Co-authored-by: Brian Vaughn <[email protected]>
2020-09-14 09:55:19 -04:00
Ben PernickandGitHub b1abeba70d Add SuspenseList to devTools (#19684)
* ensure getDisplayName is only called on functions

* add SuspenseList to Dev tools element names

* Add SuspenseList and pass tests

* Import SuspenseList directly

* run prettier

* Refactor tests to use real components

* run linter
2020-08-26 18:04:43 +01:00
6h057andGitHub 20d39cbfc1 Fix DevTools crash when inspecting document.all (#19619)
* Add html_all_collection type to correct typeof document.all

* process HTMLAllCollection like HTMLElement + fix flow issue

* fix lint

* move flow fix comment

* Make it work with iframes too

* optimize how we get html_all_collection type

* use once Object.prototype.toString.call
2020-08-21 14:31:16 +01:00
Pascal Fong KyeandGitHub 8fa4975389 DevTools bug fix: Proxied methods should be safely dehydrated for display 2020-08-12 12:15:53 -04:00
Dan AbramovandGitHub ff7bec5200 DevTools: Make break-on-warn off by default (#19309) 2020-07-10 14:11:32 +01:00
Brian VaughnandGitHub 9b33a52ace DevTools: Add break-on-warn feature (#19048)
This commit adds a new tab to the Settings modal: Debugging

This new tab has the append component stacks feature and a new one: break on warn

This new feature adds a debugger statement into the console override
2020-05-29 14:34:43 -07:00
f6d661f499 [DevTools] Improve HOC search UX (#18802)
Co-authored-by: Brian Vaughn <[email protected]>
2020-05-15 10:37:34 -07:00
Sebastian MarkbågeandGitHub b4dbce0e7f Enable prefer-const lint rules (#18451)
* Enable prefer-const rule

Stylistically I don't like this but Closure Compiler takes advantage of
this information.

* Auto-fix lints

* Manually fix the remaining callsites
2020-04-01 12:35:52 -07:00
Sebastian MarkbågeandGitHub 06d440d261 Remove ConcurrentMode and AsyncMode symbols (#18450)
This API was never released.
2020-04-01 10:18:52 -07:00
Brian VaughnandGitHub 41ca1650ab Remove "es6-symbol" package from DevTools (#18397) 2020-03-26 09:31:36 -07:00
Brian VaughnandGitHub c25efc0724 Fix DevTools Flow error for key-sort function (#17849) 2020-01-15 09:45:16 -08:00
Dawid LorancandNicolas Gallagher 07c76b845f Fix message typo in printOperationsArray function (#17039) 2020-01-09 14:13:03 -08:00
Brian VaughnandGitHub a403f656ca DevTools: Improve function props display for inspected elements (#17789) 2020-01-06 09:19:59 -08:00
Brian VaughnandGitHub 3b3ed4abde DevTools: Replaced unsafe hasOwnProperty() calls (#17768)
DevTools previously called  in several places with user-defined values. This could lead to runtime errors if those values had an overriden  attribute. This commit replaces those callse with  instead.

New test cases have been added.
2020-01-03 09:34:12 -08:00
Brian VaughnandGitHub bf429aec5f Added missing guard to DevTools for Objects with null proto (#17757)
This prevents a runtime error from occurring when these objects are inspected.
2020-01-02 08:27:29 -08:00
1da38f4818 [DevTools] Display RegExp values in props/state (#17690)
Previously, when props/state contained a regexp, it was shown as an
empty object. This commit adds regexps as values in need of special
rehydration (like Symbols or TypedArrays), and display them as a user
might expect.

Co-authored-by: Zirak <[email protected]>
2019-12-22 11:49:28 -08:00
Brian VaughnandGitHub 023cf96871 Improved inspected element props with inline previews (#17579)
* Improved inspected element props with inline previews

This mimics the inline preview shown by the brower console and dramatically improves the UX when inspecting deep values. I also updated tests to add more coverage for this new functionality.

* Cleaned up the DataView vs typed array check

* Added early bailouts to DevTools when generating preview strings for iterables/objects/arrays, to avoid doing unnecessary work
2019-12-11 17:52:17 -08:00
Pavlo TymchukandBrian Vaughn f582d2ed34 [react-devtools-shared] Added string type check for object name prop in getDisplayName function (#16798)
* [react-devtools-shared] Added string type check for object name prop in getDisplayName function from utils.js file; tests included;

* Re-added empty string check to getDisplayName()

* Tweaked tests to use real functions

This more closely simulates how the utility is being used in production, and would catch cases like anonymous functions (with empty string names).
2019-09-17 13:17:04 -07:00
Brian Vaughn a0b66f405d Added FB copyright header 2019-08-27 10:54:01 -07:00
Brian Vaughn c4e4e3f792 Fixed remaining DevTools broken tests by fixing a hydration/spread bug 2019-08-27 08:50:36 -07:00
Brian Vaughn 7abec59c5b Merged changes from 4.0.5 -> 4.0.6 from DevTools fork 2019-08-26 10:12:18 -07:00
Brian Vaughn d96b8a5606 Merged changes from 4.0.0 -> 4.0.5 from DevTools fork 2019-08-20 11:34:51 -07:00
Brian Vaughn 73aec5cc57 Prettier 2019-08-13 17:58:03 -07:00
Brian Vaughn 0da4f3f4aa Reorganized folders into packages/* 2019-08-13 15:59:43 -07:00
Brian Vaughn 1435d5c8d3 Reorganized things again into packages 2019-08-13 11:37:25 -07:00