Commit Graph

35 Commits

Author SHA1 Message Date
Tianyu Yao
44e2ca393e React DevTools 4.26.0 -> 4.26.1 (#25478) 2022-10-14 10:36:52 -07:00
Jan Kassens
ea04a486a7 Flow: remove unused suppressions (#25424)
Removes $FlowFixMe's that are no longer needed.

Used flow/tool from the Flow repo:

```
 ~/Developer/flow/tool update-suppressions .
```
2022-10-04 16:18:12 -04:00
Jan Kassens
3b6826ed9e Flow: inference_mode=constrain_writes
This mode is going to be the new default in Flow going forward.
There was an unfortuante large number of suppressions in this update.

More on the changes can be found in this [Flow blog post](https://medium.com/flow-type/new-flow-language-rule-constrained-writes-4c70e375d190).

Added some of the required annotations using the provided codemod:

```sh
node_modules/.bin/flow codemod annotate-declarations --write .
```

ghstack-source-id: 0b168e1b23
Pull Request resolved: https://github.com/facebook/react/pull/25422
2022-10-04 15:49:48 -04:00
Jan Kassens
1089faf0d8 Flow: run codemod to remove existential type
The existential type `*` was deprecated and a codemod provided to replace it. Ran that and did some manual fixups:

```sh
node_modules/.bin/flow codemod replace-existentials --write .
```

ghstack-source-id: 4c98b8db6a
Pull Request resolved: https://github.com/facebook/react/pull/25416
2022-10-04 13:37:58 -04:00
Jan Kassens
9f8a98a390 Flow upgrade to 0.153
- method unbinding is no longer supported in Flow for soundness, this added a bunch of suppressions
- Flow now prevents objects to be supertypes of interfaces/classes

ghstack-source-id: d7749cbad8
Pull Request resolved: https://github.com/facebook/react/pull/25412
2022-10-04 11:30:06 -04:00
Tianyu Yao
e099e1dc0e React DevTools 4.25.0 -> 4.26.0 (#25283) 2022-09-16 12:35:00 -07:00
Jan Kassens
fc16293f3f Flow: well_formed_exports for devtools (#25266) 2022-09-15 16:45:29 -04:00
Jan Kassens
e6a062bd2a Flow: add simple explicit export types to Devtools (#25251) 2022-09-13 12:03:20 -04:00
Jan Kassens
8003ab9cf5 Flow: remove explicit object syntax (#25223) 2022-09-09 16:03:48 -04:00
Jan Kassens
8a9e7b6cef Flow: implicit-inexact-object=error (#25210)
* implicit-inexact-object=error
* default everything ambiguous to exact object
* inexact where exact causes errors
2022-09-09 10:13:58 -04:00
Mengdi Chen
d54880d424 React DevTools 4.24.7 -> 4.25.0 (#24919) 2022-07-13 15:57:50 -04:00
Luna Ruan
4e1fcfa771 [DevTools] Resign Timeline Profiler Sidebar (#24816)
This PR:
* Redesigned the sidebar to resemble the flamegraph profiler sidebar and added title and timestamp to the sidebar
* Added ability to copy the component stack (for places where you're unable to link to source)

https://user-images.githubusercontent.com/2735514/176564897-5301d6d4-429a-4ea3-86cd-74427cff4ce6.mov
2022-06-29 17:54:06 -07:00
Luna Ruan
1974d08c93 [DevTools] Fix Bugs With Component Stacks (#24815)
This PR:
* Simplifies the code in `SidebarEventInfo` by passing it the actual clicked event rather than an index.
* Lightly refactored the `SidebarEventInfo` code so that it can be used for more than just `schedulingEvents`
* Fixes bug. Previously, whenever a state update event was clicked, we updated the `selectedCommitIndex` in the `ProfilerContext`. However, this index is used for the selected commit in the Flamegraph profiler, which caused a bug where if you would change the contents of the event sidebar, the commit sidebar in the Flamegraph profiler would change too. This PR replaces this with the actual event info instead
2022-06-29 16:00:48 -07:00
Blake Friedman
2e1c8841e9 [DevTools] front-end for profiling event stack (#24805)
* [DevTools] front-end for profiling event stack

Adds a side-bar to the profiling tab. Users can now select an update event, and are
shown the callstack from the originating component. When a source path is available
there is now UI to jump to source.

Add FB enabled feature flag: enableProfilerComponentTree for the side-bar.

resolves #24170
2022-06-28 22:15:24 +01:00
Luna Ruan
9abe745aa7 [DevTools][Timeline Profiler] Component Stacks Backend (#24776)
This PR adds a component stack field to the `schedule-state-update` event. The algorithm is as follows:
* During profiling, whenever a state update happens collect the parents of the fiber that caused the state update and store it in a map
* After profiling finishes, post process the `schedule-state-update` event and using the parent fibers, generate the component stack by using`describeFiber`, a function that uses error throwing to get the location of the component by calling the component without props.

---

Co-authored-by: Blake Friedman <blake.friedman@gmail.com>
2022-06-23 11:19:23 -07:00
Luna Ruan
25837acfee React DevTools 4.24.6 -> 4.24.7 (#24646) 2022-05-31 16:16:07 -04:00
Mengdi "Monday" Chen
52c434be1d React DevTools 4.24.5 -> 4.24.6 (#24547) 2022-05-12 10:52:55 -04:00
Brian Vaughn
547b707493 React DevTools 4.24.4 -> 4.24.5 (#24503) 2022-05-05 10:19:08 -07:00
Andrew Clark
f993ffc514 Fix infinite update loop that happens when an unmemoized value is passed to useDeferredValue (#24247)
* Fix infinite loop if unmemoized val passed to uDV

The current implementation of useDeferredValue will spawn a new
render any time the input value is different from the previous one. So
if you pass an unmemoized value (like an inline object), it will never
stop spawning new renders.

The fix is to only defer during an urgent render. If we're already
inside a transition, retry, offscreen, or other non-urgen render, then
we can use the latest value.

* Temporarily disable "long nested update" warning

DevTools' timeline profiler warns if an update inside a layout effect
results in an expensive re-render. However, it misattributes renders
that are spawned from a sync render at lower priority. This affects the
new implementation of useDeferredValue but it would also apply to things
like Offscreen.

It's not obvious to me how to fix this given how DevTools models the
idea of a "nested update" so I'm disabling the warning for now to
unblock the bugfix for useDeferredValue.
2022-04-11 12:34:03 -04:00
Brian Vaughn
5b2e7253f9 React DevTools 4.24.3 -> 4.24.4 (#24315) 2022-04-08 11:38:07 -04:00
Mengdi "Monday" Chen
adb8ebc927 React DevTools 4.24.2 -> 4.24.3 (#24198) 2022-03-29 14:44:32 -04:00
Brian Vaughn
8df8a57edd React DevTools 4.24.1 -> 4.24.2 (#24150) 2022-03-24 09:06:10 -04:00
Luna Ruan
ac574d6883 React DevTools 4.24.0 -> 4.24.1 (#24100) 2022-03-15 14:13:00 -04:00
Brian Vaughn
f6c130f614 React DevTools 4.23.0 -> 4.24.0 (#23400)
* React DevTools 4.23.0 -> 4.24.0

* Fixed CHANGELOG header format

* Add separator line beween header version numbers
2022-03-02 13:28:42 -05:00
Brian Vaughn
fa816be7f0 DevTools: Timeline profiler refactor
Refactor DevTools to record Timeline data (in memory) while profiling. Updated the Profiler UI to import/export Timeline data along with legacy profiler data.

Relates to issue #22529
2022-01-28 13:09:28 -05:00
Brian Vaughn
e28a0db224 React DevTools 4.22.1 -> 4.23.0 2022-01-24 09:29:18 -05:00
Brian Vaughn
51947a14bb Refactored how React/DevTools log Timeline performance data (#23102)
Until now, DEV and PROFILING builds of React recorded Timeline profiling data using the User Timing API. This commit changes things so that React records this data by calling methods on the DevTools hook. (For now, DevTools still records that data using the User Timing API, to match previous behavior.)

This commit is large but most of it is just moving things around:

* New methods have been added to the DevTools hook (in "backend/profilingHooks") for recording the Timeline performance events.
* Reconciler's "ReactFiberDevToolsHook" has been updated to call these new methods (when they're present).
* User Timing method calls in "SchedulingProfiler" have been moved to DevTools "backend/profilingHooks" (to match previous behavior, for now).
* The old reconciler tests, "SchedulingProfiler-test" and "SchedulingProfilerLabels-test", have been moved into DevTools "TimelineProfiler-test" to ensure behavior didn't change unexpectedly.
* Two new methods have been added to the injected renderer interface: injectProfilingHooks() and getLaneLabelMap().

Relates to #22529.
2022-01-13 14:55:54 -05:00
Brian Vaughn
5b69c94eed React DevTools 4.22.0 -> 4.22.1 (#22962) 2021-12-14 23:52:50 -05:00
jstejada
0229baee21 React DevTools 4.21.0 -> 4.22.0 (#22951) 2021-12-14 14:19:21 -05:00
Brian Vaughn
8b8817845a Timeline search (#22799)
Refactor SearchInput component (used in Components tree) to be generic DevTools component with two uses: ComponentSearchInput and TimelineSearchInput.

Refactored Timeline Suspense to more closely match other, newer Suspense patterns (e.g. inspect component, named hooks) and colocated Susepnse code in timelineCache file.

Add search by component name functionality to the Timeline. For now, searching zooms in to the component measure and you can step through each time it rendered using the next/previous arrows.
2021-12-03 16:23:48 -05:00
Brian Vaughn
e0aa5e205f Add Scheduling Profiler GK link to Timeline UI for FB build (#22730)
This is a constant source of confusion for FB engineers trying to figure out why Chrome profiling data does not have any React marks.
2021-11-09 16:10:48 -05:00
Yash Joshi
2b77ab26ad fix(devtools): accept json file in import fileinput (#22717) 2021-11-08 16:35:35 -05:00
Brian Vaughn
99a73ac670 Timeline: Improved snapshot view (#22706) 2021-11-08 12:28:33 -05:00
Brian Vaughn
13455d26d1 Cleaned up remaining "scheduling profiler" references in DevTools (#22696) 2021-11-04 11:40:45 -04:00
Brian Vaughn
1bf6deb865 Renamed packages/react-devtools-scheduling-profiler to packages/react-devtools-timeline (#22691) 2021-11-04 10:02:06 -04:00