Commit Graph
37 Commits
Author SHA1 Message Date
Brian VaughnandGitHub 29a8f028c6 DevTools: Add post-commit hook (#21183)
I recently added UI for the Profiler's commit and post-commit durations to the DevTools, but I made two pretty silly oversights:

    1. I used the commit hook (called after mutation+layout effects) to read both the layout and passive effect durations. This is silly because passive effects may not have flushed yet git at this point.
    2. I didn't reset the values on the HostRoot node, so they accumulated with each commit.

    This commitR addresses both issues:

    1. First it adds a new DevTools hook, onPostCommitRoot*, to be called after passive effects get flushed. This gives DevTools the opportunity to read passive effect durations (if the build of React being profiled supports it).
    2. Second the work loop resets these durations (on the HostRoot) after calling the post-commit hook so address the accumulation problem.
    I've also added a unit test to guard against this regressing in the future.

    * Doing this in flushPassiveEffectsImpl seemed simplest, since there are so many places we flush passive effects. Is there any potential problem with this though?
2021-04-08 22:04:51 -04:00
Brian VaughnandGitHub 0a5bf1a801 DevTools Profiler: Add commit and post-commit durations to UI (#20984) 2021-03-17 12:27:37 -04:00
Brian VaughnandGitHub d6004f38b7 Remove DevTools dependency on Scheduler runWithPriority (#20967) 2021-03-10 08:52:19 -05:00
Brian VaughnandGitHub 0e9cf4d68c Add rudimentary support for Cache to DevTools (#20458) 2021-01-04 09:32:03 -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
Brian VaughnandGitHub d8d7ea4aa0 Improved DevTools context test harness (#19878) 2020-09-21 16:39:53 -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
Brian VaughnandGitHub ddd1a33b03 Fix DevTools handling of empty Suspense tag for legacy renderer versions (#19337) 2020-07-13 16:21:56 -04:00
181e627c40 [DevTools] Show HOC names in profiler (#19283)
* show hoc names in profiler

* Added hocDisplayNames.length check

Co-authored-by: Brian Vaughn <[email protected]>
2020-07-10 11:21:19 -04:00
RickyandGitHub 7c9c5ff51c Fix spelling errors and typos (#19138) 2020-06-15 19:59:44 -04:00
Brian VaughnandGitHub dbe7c18b21 Updated DevTools unstable_ API references (#18847) 2020-05-06 11:14:30 -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
Brian VaughnandGitHub c7e696b944 Fix flow types (#18204)
* Added missing @flow pragma to React.js

* Fixed useContext() return type definition

* Fixed previously masked Flow errors in DevTools and react-interactions packages

* Added displayName to internal Context Flow type

* Removed Flow generic annotations for createResponder

This seems to cause a parsing error. (Not sure why.) The API is deprecated anyway so I'm being lazy for now and just adding a .
2020-03-03 12:46:24 -08:00
Sebastian MarkbågeandGitHub 33fea4647c Codemod to import * as React from "react"; (#18102)
* import * as React from "react";

This is the correct way to import React from an ES module since the ES
module will not have a default export. Only named exports.

* import * as ReactDOM from "react-dom"
2020-02-21 19:45:20 -08:00
Brian VaughnandGitHub 6cf12af8e6 Added $FlowFixMe to DevTools shell for module we Flow-ignore (#18001) 2020-02-07 14:36:51 -08:00
Farhad YasirandGitHub 32428b62d8 fix: check bigint in serializeToString and change it to string (#17931) 2020-01-31 14:35:59 -08:00
Dan AbramovandGitHub 6e9c0d3038 Bump Prettier (#17811)
* Bump Prettier

* Reformat

* Use non-deprecated option
2020-01-09 13:54:11 +00: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
Brian VaughnandGitHub cfbc83cf06 Devtools renable copy attr context menu for firefox (#17740)
* Use exportFunction() to share clipboard copy with JS running in document/page context.

* Remove no-longer-used option to disable copy operation.
2019-12-29 13:27:44 -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 330bd02c7c Disable "copy to clipboard" and "go to definition" context menu options for Firefox addon (#17668) 2019-12-20 08:31:38 -08:00
Brian VaughnandGitHub 8f25f2637f DevTools context menu (#17608)
* Added rudimentary context menu hook and menu UI

* Added backend support for copying a value at a specific path for the inspected element

* Added backend support for storing a value (at a specified path) as a global variable

* Added special casing to enable copying undefined/unserializable values to the clipboard

* Added copy and store-as-global context menu options to selected element props panel

* Store global variables separately, with auto-incremented name (like browsers do)

* Added tests for new copy and store-as-global backend functions

* Fixed some ownerDocument/contentWindow edge cases

* Refactored context menu to support dynamic options

Used this mechanism to add a conditional menu option for inspecting the current value (if it's a function)

* Renamed "safeSerialize" to "serializeToString" and added inline comment
2019-12-18 12:12:34 -08:00
Brian VaughnandGitHub 6a90e8396c Added more forwardRef test cases for DevTools (#17642) 2019-12-17 12:45:10 -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
Sebastian MarkbågeandGitHub 6fe5d2d8d4 SuspenseList support in DevTools (#17145)
* SuspenseList support in DevTools

This adds SuspenseList tags to DevTools so that the name properly shows
up.

It also switches to use the tag instead of Symbol type for Suspense
components. We shouldn't rely on the type for any built-ins since that
field will disappear from the fibers. How the Fibers get created is an
implementation detail that can change e.g. with a compiler or if we
use instanceof checks that are faster than symbol comparisons.

* Add SuspenseList test to shell app
2019-10-18 17:18:36 -07:00
Sebastian MarkbågeandGitHub d3710442de Remove unstable_ prefix in various internal uses (#17146)
* Rename unstable_createRoot in DevTools

* Rename createSyncRoot in warning
2019-10-18 17:18:10 -07:00
Brian VaughnandGitHub 8befd943c1 DevTools test shell tweaks (#17054)
* Updated DevTools shell ignore warning message to account for recent changes in warning text

* Update DevTools console patching to patch the parent window's console rather than the iframe, to more accurately simulate real usage environment
2019-10-09 12:37:25 -07:00
Nicolas GallagherandGitHub 47595258f0 Move eventSystemFlags to last argument in event plugin extractors (#16978)
Fix for necolas/react-native-web#1443
2019-10-02 10:31:15 -07:00
Brian VaughnandGitHub df2e7d2219 DevTools shows unsupported renderer version dialog (#16897)
* DevTools shows unsupported renderer version dialog

* Optimistic CHANGELOG udpate
2019-09-26 08:41:46 -07:00
Dan AbramovandBrian Vaughn cff975b2c9 [DevTools] Remove Welcome dialog (#16834) 2019-09-19 08:41:18 -07:00
Brian Vaughn a0b66f405d Added FB copyright header 2019-08-27 10:54:01 -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 0fdcfc98b1 Fixed a bunch of Lint issues 2019-08-13 21:59:07 -07:00
Brian Vaughn 274ad2ea6b Prettier 2019-08-13 18:12:19 -07:00
Brian Vaughn dcf5c65d46 Moved shell fixture into packages/react-devtools-shell 2019-08-13 18:11:59 -07:00