Commit Graph

143 Commits

Author SHA1 Message Date
Sebastian Silbermann b6ff9ad163 DevTools: update error indices when elements are added/removed (#22144) 2021-08-20 11:55:42 -04:00
Brian Vaughn e3049bb850 DevTools scheduling profiler: Add React component measures (#22013) 2021-08-03 13:03:29 -04:00
Brian Vaughn 42251331d8 DevTools: Scheduling profiler (#22006) 2021-08-02 14:30:43 -04:00
houssemchebeb e3b76a85c5 Devtools: Refactor imperative theme code (#21950)
Co-authored-by: Brian Vaughn <bvaughn@fb.com>
2021-08-02 11:20:04 -04:00
Brian Vaughn 27bf6f9a83 Scheduling profiler UX changes (#21990) 2021-08-02 09:23:48 -04:00
Piotr Szulc 9f88b5355b Devtools: Display as link if value is in specified protocols (#21964) 2021-07-28 09:29:13 -04:00
Brian Vaughn c21e8fccad Scheduling profiler: Improve native events UI (#21966)
Also highlight events that have synchronous updates inside of them. (We may want to relax this highlighting later to not warn about event handlers that are still fast enough.)
2021-07-26 19:30:43 -04:00
Brian Vaughn b1811ebf01 [DevTools] Add native events to the scheduling profiler (#21947) 2021-07-26 10:36:16 -04:00
Brian Vaughn f4161c3ec7 [DRAFT] Import scheduling profiler into DevTools Profiler (#21897) 2021-07-22 13:58:57 -04:00
Brian Vaughn 6840c98c32 Remove named hooks feature flag (#21894) 2021-07-16 00:14:20 -04:00
Brian Vaughn e26cb8f86d Clear named hooks Suspense and AST cache after a Fast Refresh (#21891) 2021-07-15 23:39:30 -04:00
houssemchebeb d5de45820a Fix typo (#21671) 2021-07-14 20:42:54 -04:00
Steve Rubin 232c67e911 Devtools Profiler: allow user to enter commit number (#19957)
Co-authored-by: Brian Vaughn <bvaughn@fb.com>
2021-07-14 20:37:02 -04:00
Brian Vaughn 92f3414d03 Reset inspected element cache in the event of an error (#21821) 2021-07-08 14:07:15 -04:00
Brian Vaughn feb2f6892a DevTool: hook names cache no longer loses entries between selection (#21831)
Made several changes to the hooks name cache to avoid losing cached data between selected elements:
1. No longer use React-managed cache. This had the unfortunate side effect of the inspected element cache also clearing the hook names cache. For now, instead, a module-level WeakMap cache is used. This isn't great but we can revisit it later.
2. Hooks are no longer the cache keys (since hook objects get recreated between element inspections). Instead a hook key string made of fileName + line number + column number is used.
3. If hook names have already been loaded for a component, skip showing the load button and just show the hook names by default when selecting the component.
2021-07-08 13:54:16 -04:00
Brian Vaughn 8b34d5a905 DevTools show error icon when hook name parsing fails (#21820) 2021-07-07 16:27:39 -04:00
Brian Vaughn c5cfa71948 DevTools: Show hook names based on variable usage (#21641)
Co-authored-by: Brian Vaughn <brian.david.vaughn@gmail.com>
Co-authored-by: Saphal Patro <saphal1998@gmail.com>
Co-authored-by: VibhorCodecianGupta <vibhordelgupta@gmail.com>
2021-07-01 14:39:18 -04:00
Brian Vaughn d483463bc8 Updated scripts and config to replace "master" with "main" branch (#21768) 2021-06-29 14:26:24 -04:00
Brian Vaughn 386e8f2ea7 DevTools: Fix Settings dialog scroll/size bug in Firefox (#21747) 2021-06-24 11:19:57 -04:00
Bao Pham 8b4201535c Devtools: add feature to trigger an error boundary (#21583)
Co-authored-by: Brian Vaughn <bvaughn@fb.com>
2021-06-03 11:21:44 -04:00
Brian Vaughn ebcec3cc20 Add key to inspected-element error boundary (#21535)
This way changing the selected element also recreates/resets the boundary automatically.
2021-05-19 17:38:12 -04:00
Brian Vaughn 99995c1063 Improve error boundary in inspected elements panel (#21531)
Show more info about the error as well as the option to report it to GitHub.
2021-05-19 13:27:56 -04:00
Brian Vaughn 7bef382bf9 Errors thrown by Store can be dismissed in boundary (#21520) 2021-05-18 10:36:31 -04:00
Brian Vaughn 1a2d792503 Tweaked DevTools error template title to match issue form template 2021-05-14 10:19:58 -04:00
Brian Vaughn 2bf4805e4b Update entry point exports (#21488)
The following APIs have been added to the `react` stable entry point:
* `SuspenseList`
* `startTransition`
* `unstable_createMutableSource`
* `unstable_useMutableSource`
* `useDeferredValue`
* `useTransition`

The following APIs have been added or removed from the `react-dom` stable entry point:
* `createRoot`
* `unstable_createPortal` (removed)

The following APIs have been added to the `react-is` stable entry point:
* `SuspenseList`
* `isSuspenseList`

The following feature flags have been changed from experimental to true:
* `enableLazyElements`
* `enableSelectiveHydration`
* `enableSuspenseServerRenderer`
2021-05-12 11:28:14 -04:00
Brian Vaughn 85b543c6b4 Added new GitHub issue form for React DevTools bug reports (#21450)
Added a new bug report template built with GitHub issue forms:
https://gh-community.github.io/issue-template-feedback/structured/

And updated DevTools bug report link to send information formatted for this new template.
2021-05-07 08:46:58 -04:00
Brian Vaughn d19257b8fa DevTools Store emits errors before throwing (#21426)
The Store should never throw an Error without also emitting an event. Otherwise Store errors will be invisible to users, but the downstream errors they cause will be reported as bugs. (For example, github.com/facebook/react/issues/21402)

Emitting an error event allows the ErrorBoundary to show the original error.

Throwing is still valuable for local development and for unit testing the Store itself.
2021-05-04 10:46:26 -04:00
Brian Vaughn b522638b99 Add GitHub API query to bug report template (#21421)
This may help debug why sometimes the GitHub API search seems to not find a match when it should.
2021-05-04 00:09:11 -04:00
Brian Vaughn 4ca62cac45 Improve DevTools bug template text (#21413) 2021-05-03 16:57:17 -04:00
Brian Vaughn 3c21aa855a DevTools refactor Profiler commit tree reconstruction to be iterative (#21383) 2021-04-28 16:32:35 -04:00
Brian Vaughn 5196a95fd1 Updated DevTools to replace fburl.com link with fb.me link 2021-04-27 23:49:30 -04:00
Brian Vaughn ecb599cd87 DevTools supports multiple modal dialogs at once (#21370) 2021-04-27 20:33:11 -04:00
Brian Vaughn 8e2bb3e89c DevTools: Add Bridge protocol version backend/frontend (#21331)
Add an explicit Bridge protocol version to the frontend and backend components as well as a check during initialization to ensure that both are compatible. If not, the frontend will display either upgrade or downgrade instructions.

Note that only the `react-devtools-core` (React Native) and `react-devtools-inline` (Code Sandbox) packages implement this check. Browser extensions inject their own backend and so the check is unnecessary. (Arguably the `react-devtools-inline` check is also unlikely to be necessary _but_ has been added as an extra guard for use cases such as Replay.io.)
2021-04-27 17:26:07 -04:00
Brian Vaughn fc33f12bde Remove unstable scheduler/tracing API (#20037) 2021-04-26 19:16:18 -04:00
Ricky a632f7de3b Flip tuple order of useTransition (#20976) 2021-04-20 12:21:44 -04:00
Brian Vaughn 83bdc565f9 Remove @octokit/rest dependency from DevTools (#21317) 2021-04-19 21:20:34 -04:00
Brian Vaughn 4def1ceee2 Update DevTools Error strings to support GitHub fuzzy search (#21314) 2021-04-19 13:05:28 -04:00
Brian Vaughn c1a53ad2b2 DevTools pre-filter GH issues by repo (#21292) 2021-04-15 19:56:41 -04:00
Brian Vaughn f3337aa544 DevTools error boundary: Search for pre-existing GH issues (#21279) 2021-04-15 13:34:54 -04:00
Brian Vaughn bdc23c3dba DevTools shows which fibers scheduled the current update (#21171) 2021-04-09 10:35:06 -04:00
Brian Vaughn a817840ea7 DevTools: useModalDismissSignal bugfix (#21173)
* DevTools: useModalDismissSignal bugfix

Make useModalDismissSignal's manually added click/keyboard events more robust to sync flushed passive effects. (Don't let the same click event that shows a modal dialog also dismiss it.)

* Replaced event.timeStamp check with setTimeout
2021-04-05 11:09:43 -04:00
Andrew Clark 6d3ecb70dc Remove unstable_changedBits (#20953)
We added this unstable feature a few years ago, as a way to opt out of
context updates, but it didn't prove useful in practice.

We have other proposals for how to address the same problem, like
context selectors.

Since it was prefixed with `unstable_`, we should be able to remove it
without consequence. The hook API already warned if you used it.

Even if someone is using it somewhere, it's meant to be an optimization
only, so if they are using the API properly, it should not have any
semantic impact.
2021-03-19 15:36:51 -07:00
Brian Vaughn 7d06b80af6 Fixed primitive hook badge colors for light theme (#21034) 2021-03-19 09:52:59 -04:00
Brian Vaughn 119736b1c2 [FB-only] Show which hooks (indices) changed when profiling (#20998) 2021-03-17 12:28:21 -04:00
Brian Vaughn bf11788bf0 DevTools Profiler: Add commit and post-commit durations to UI (#20984) 2021-03-17 12:27:37 -04:00
Chris Dobson bd245c1bab Ensure sync-xhr is allowed before reload and profile (#20879)
Co-authored-by: Brian Vaughn <brian.david.vaughn@gmail.com>
2021-03-11 10:31:57 -05:00
Brian Vaughn ec372faefe Remove DevTools dependency on Scheduler runWithPriority (#20967) 2021-03-10 08:52:19 -05:00
Brian Vaughn 5fe091c778 Swap log with cbrt for commit bar height (#20952) 2021-03-08 14:02:09 -05:00
Brian Vaughn cb88572227 Improve DevTools Profiler commit-selector UX (#20943)
* Improve DevTools Profiler commit-selector UX

1. Use natural log of durations (rather than linear) when calculating bar height. This reduces the impact of one (or few) outlier times on more common smaller durations. (Continue to use linear for bar color though.)
2. Decrease the minimum bar height to make the differences in height more noticeable.
3. Add a background hover highlight to increase contrast.
4. Add hover tooltip with commit duration and timestamp.
2021-03-08 11:09:55 -05:00
Brian Vaughn cfd8c1bd43 DevTools: Restore inspect-element bridge optimizations (#20789)
* Restore inspect-element bridge optimizations

When the new Suspense cache was integrated (so that startTransition could be used) I removed a couple of optimizations between the backend and frontend that reduced bridge traffic when e.g. dehydrated paths were inspected for elements that had not rendered since previously inspected. This commit re-adds those optimizations as well as an additional test with a bug fix that I noticed while reading the backend code.

There are two remaining TODO items as of this commit:
- Make inspected element edits and deletes also use transition API
- Don't over-eagerly refresh the cache in our ping-for-updates handler

I will addres both in subsequent commits.

* Poll for update only refreshes cache when there's an update

* Added inline comment
2021-02-22 14:04:20 -05:00