mirror of
https://github.com/facebook/react.git
synced 2026-02-27 03:07:57 +00:00
279 lines
19 KiB
Markdown
279 lines
19 KiB
Markdown
# React DevTools changelog
|
|
|
|
<details>
|
|
<summary>
|
|
Changes that have landed in master but are not yet released.
|
|
Click to see more.
|
|
</summary>
|
|
|
|
<!-- Upcoming changes go here -->
|
|
|
|
</details>
|
|
|
|
## 4.6.0 (March 26, 2020)
|
|
|
|
#### Features
|
|
* Add shortcut keys for tab switching ([kerolloz](https://github.com/kerolloz) in [#18248](https://github.com/facebook/react/pull/18248))
|
|
|
|
#### Bugfix
|
|
* Improve display of complex values for `useDebugValue` ([eps1lon](https://github.com/eps1lon) in [#18070](https://github.com/facebook/react/pull/18070))
|
|
* Fix minor CSS layout issue that broke Profiler commit selector UI ([bvaughn](https://github.com/bvaughn) in [#18286](https://github.com/facebook/react/pull/18286))
|
|
* Inlined DevTools event emitter implementation to fix a source of Profiler bugs ([bvaughn](https://github.com/bvaughn) in [#18378](https://github.com/facebook/react/pull/18378))
|
|
|
|
#### Cleanup
|
|
* Remove "es6-symbol" dependency from "react-devtools-inline" package ([bvaughn](https://github.com/bvaughn) in [#18397](https://github.com/facebook/react/pull/18397))
|
|
|
|
## 4.5.0 (March 3, 2020)
|
|
|
|
#### Features
|
|
* Improve function props display for inspected elements ([bvaughn](https://github.com/bvaughn) in [#17789](https://github.com/facebook/react/pull/17789))
|
|
* Re-enabled context menu for Firefox extension ([bvaughn](https://github.com/bvaughn) in [#17838](https://github.com/facebook/react/pull/17838))
|
|
* Apply changes to props/state/hooks on blur (rather than on ENTER) ([muratcatal](https://github.com/muratcatal) in [#17062](https://github.com/facebook/react/pull/17062))
|
|
* Add info tooltip to nodes in Profiler ([M-Izadmehr](https://github.com/M-Izadmehr) in [#18048](https://github.com/facebook/react/pull/18048))
|
|
* Added resize support to Components panel ([hristo-kanchev](https://github.com/hristo-kanchev) in [#18046](https://github.com/facebook/react/pull/18046))
|
|
|
|
#### Bugfix
|
|
* Improve how empty commits are filtered ([nutboltu](https://github.com/nutboltu) in [#17931](https://github.com/facebook/react/pull/17931))
|
|
* BigInt serialize issue in devtools copy to clipboard ([bvaughn](https://github.com/bvaughn) in [#17771](https://github.com/facebook/react/pull/17771))
|
|
* Renamed "backend.js" to "react_devtools_backend.js" to reduce potential confusion from profiling ([bvaughn](https://github.com/bvaughn) in [#17790](https://github.com/facebook/react/pull/17790))
|
|
* Update root styles to prevent `box-sizing` style from leaking outside of inline target ([GasimGasimzada](https://github.com/GasimGasimzada) in [#17775](https://github.com/facebook/react/pull/17775))
|
|
* Fix "_Cannot read property 'sub' of undefined_" error when navigating to plain-text pages ([wfnuser](https://github.com/wfnuser) in [#17848](https://github.com/facebook/react/pull/17848))
|
|
* Fix potential error with composite hooks during shallow re-rendering ([bvaughn](https://github.com/bvaughn) in [#18130](https://github.com/facebook/react/pull/18130))
|
|
* Scope dev tools wildcard styles within DevTools CSS class ([@GasimGasimzada](https://github.com/GasimGasimzada) in [9cc094a](https://github.com/facebook/react/commit/9cc094a19a9e43d33ba5ac713935e657ea4e3cdd#diff-ab5ee5655b2aac3260e1f836546a13c9))
|
|
|
|
###### Info summary tooltips
|
|
|
|

|
|
|
|

|
|
|
|
###### Components panel resize
|
|
|
|

|
|
|
|

|
|
|
|
## 4.4.0 (January 3, 2020)
|
|
#### Features
|
|
* Re-enabled "copy" prop/state/hooks context menu option for Firefox ([bvaughn](https://github.com/bvaughn),[rpl](https://github.com/rpl) in [#17740](https://github.com/facebook/react/pull/17740))
|
|
* Shift+Enter focuses previous search result in Components tree ([Bo-Duke](https://github.com/Bo-Duke) in [#17005](https://github.com/facebook/react/pull/17005))
|
|
* Properly display formatted `RegExp` values in props/state panel([bvaughn](https://github.com/bvaughn) in [#17690](https://github.com/facebook/react/pull/17690))
|
|
* Profiler commit selector wraps around for easier navigation of large profiles ([bvaughn](https://github.com/bvaughn) in [#17760](https://github.com/facebook/react/pull/17760))
|
|
#### Bugfix
|
|
* Check `document.contentType` before injecting hook to avoid breaking XML file syntax highlighting in Firefox ([bvaughn](https://github.com/bvaughn) in [#17739](https://github.com/facebook/react/pull/17739))
|
|
* Fix standalone UI not responding to mouse interactions due to `webkit-app-region` style ([cwatson88](https://github.com/cwatson88) in [#17584](https://github.com/facebook/react/pull/17584))
|
|
* Support inspecting object values with null protos ([bvaughn](https://github.com/bvaughn) in [#17757](https://github.com/facebook/react/pull/17757))
|
|
* Support inspecting values that have overridden `hasOwnProperty` attribute ([bvaughn](https://github.com/bvaughn) in [#17768](https://github.com/facebook/react/pull/17768))
|
|
* Fixed regression that made Profiler "Could not find node…" error happen more frequently ([bvaughn](https://github.com/bvaughn) in [#17759](https://github.com/facebook/react/pull/17759))
|
|
|
|
## 4.3.0 (December 20, 2019)
|
|
#### Features
|
|
* Show component location for selected element in bottom/right panel ([bvaughn](https://github.com/bvaughn) in [#17567](https://github.com/facebook/react/pull/17567))
|
|
* Improved inspected element values with inline previews ([bvaughn](https://github.com/bvaughn) in [#17579](https://github.com/facebook/react/pull/17579))
|
|
* Improved selection and toggling for inspected element panel ([bvaughn](https://github.com/bvaughn) in [#17588](https://github.com/facebook/react/pull/17588))
|
|
* Copy context menu for inspecting and copying props/state/hooks/context values ([bvaughn](https://github.com/bvaughn) in [#17608](https://github.com/facebook/react/pull/17608))
|
|
#### Bug fixes
|
|
* Fix serialization for `BigInt` type so that it does not break inspection panel. ([nutboltu](https://github.com/nutboltu) in [#17233](https://github.com/facebook/react/pull/17233))
|
|
* Fix display name logic for `forwardRef`s that use `displayName` property ([zthxxx](https://github.com/zthxxx) in [#17613](https://github.com/facebook/react/pull/17613))
|
|
|
|
## 4.2.1 (November 27, 2019)
|
|
#### Bug fixes
|
|
* Profiler automatically filters certain types of empty (no work) commits. ([bvaughn](https://github.com/bvaughn) in [#17253](https://github.com/facebook/react/pull/17253))
|
|
* Fix memoized components showing as "Anonymous" in Components tab. ([wsmd](https://github.com/wsmd) in [#17274](https://github.com/facebook/react/pull/17274))
|
|
* Edge-case bugfix for non-string element keys. ([bvaughn](https://github.com/bvaughn) in [#17164](https://github.com/facebook/react/pull/17164))
|
|
|
|
## 4.2.0 (October 3, 2019)
|
|
#### Features
|
|
* "Highlight updates" feature added for browser extensions and `react-devtools-inline` NPM package. ([bvaughn](https://github.com/bvaughn) in [#16989](https://github.com/facebook/react/pull/16989))
|
|
|
|
## 4.1.3 (September 30, 2019)
|
|
#### Bug fixes
|
|
* Fixed regression where DevTools wouldn't properly connect with apps when using the `file://` protocol. ([linshunghuang](https://github.com/linshunghuang) in [#16953](https://github.com/facebook/react/pull/16953))
|
|
|
|
## 4.1.2 (September 27, 2019)
|
|
#### Bug fixes
|
|
* Fixed an infinite loop that occurred in some cases with prop values of `NaN`. ([bvaughn](https://github.com/bvaughn) in [#16934](https://github.com/facebook/react/pull/16934))
|
|
|
|
## 4.1.1 (September 26, 2019)
|
|
#### Bug fixes
|
|
* Fixed bug where Components panel was always empty for certain users. ([linshunghuang](https://github.com/linshunghuang) in [#16900](https://github.com/facebook/react/pull/16900))
|
|
* Fixed regression in DevTools editable hooks interface that caused primitive values to be shown as `undefined`. ([bvaughn](https://github.com/bvaughn) in [#16867](https://github.com/facebook/react/pull/16867))
|
|
* Fixed bug where DevTools showed stale values in props/state/hooks editing interface. ([bvaughn](https://github.com/bvaughn) in [#16878](https://github.com/facebook/react/pull/16878))
|
|
* Show unsupported version dialog with downgrade instructions. ([bvaughn](https://github.com/bvaughn) in [#16897](https://github.com/facebook/react/pull/16897))
|
|
|
|
## 4.1.0 (September 19, 2019)
|
|
#### Features
|
|
* Props/state editor supports adding new values and changing value types. ([hristo-kanchev](https://github.com/hristo-kanchev) in [#16700](https://github.com/facebook/react/pull/16700))
|
|
#### Bug fixes
|
|
* Profiler correctly saves/exports profiling data in Firefox now. ([hristo-kanchev](https://github.com/hristo-kanchev) in [#16612](https://github.com/facebook/react/pull/16612))
|
|
* Class components now show "legacy context" header (rather than "context") for legacy API. ([hristo-kanchev](https://github.com/hristo-kanchev) in [#16617](https://github.com/facebook/react/pull/16617))
|
|
* Show component source button ("<>") now highlights the `render` method for class components. ([theKashey](https://github.com/theKashey) in [#16759](https://github.com/facebook/react/pull/16759))
|
|
* Bugfix for components with non-standard object values for `function.name`. ([LetItRock](https://github.com/LetItRock) in [#16798](https://github.com/facebook/react/pull/16798))
|
|
|
|
## 4.0.6 (August 26, 2019)
|
|
#### Bug fixes
|
|
* Remove ⚛️ emoji prefix from Firefox extension tab labels
|
|
* Standalone polyfills `Symbol` usage
|
|
|
|
## 4.0.5 (August 19, 2019)
|
|
#### Bug fixes
|
|
* Props, state, and context values are alpha sorted.
|
|
* Standalone DevTools properly serves backend script over localhost:8097
|
|
|
|
## 4.0.4 (August 18, 2019)
|
|
#### Bug fixes
|
|
* Bugfix for potential error if a min-duration commit filter is applied after selecting a fiber in the Profiler UI.
|
|
|
|
## 4.0.3 (August 17, 2019)
|
|
#### Bug fixes
|
|
* ES6 `Map` and `Set`, typed arrays, and other unserializable types (e.g. Immutable JS) can now be inspected.
|
|
* Empty objects and arrays now display an "(empty)" label to the right to reduce confusion.
|
|
* Components that use only the `useContext` hook now properly display hooks values in side panel.
|
|
* Style editor now supports single quotes around string values (e.g. both `"red"` and `'red'`).
|
|
* Fixed edge case bug that prevented profiling when both React v16 and v15 were present on a page.
|
|
|
|
## 4.0.2 (August 15, 2019)
|
|
#### Permissions cleanup
|
|
* Removed unnecessary `webNavigation ` permission from Chrome and Firefox extensions.
|
|
|
|
## 4.0.1 (August 15, 2019)
|
|
#### Permissions cleanup
|
|
* Removed unnecessary `<all_urls>`, `background`, and `tabs` permissions from Chrome and Firefox extensions.
|
|
|
|
## 4.0.0 (August 15, 2019)
|
|
|
|
### General changes
|
|
|
|
#### Improved performance
|
|
The legacy DevTools extension used to add significant performance overhead, making it unusable for some larger React applications. That overhead has been effectively eliminated in version 4.
|
|
|
|
[Learn more](https://github.com/facebook/react/blob/master/packages/react-devtools/OVERVIEW.md) about the performance optimizations that made this possible.
|
|
|
|
#### Component stacks
|
|
|
|
React component authors have often requested a way to log warnings that include the React ["component stack"](https://reactjs.org/docs/error-boundaries.html#component-stack-traces). DevTools now provides an option to automatically append this information to warnings (`console.warn`) and errors (`console.error`).
|
|
|
|

|
|
|
|
It can be disabled in the general settings panel:
|
|
|
|

|
|
|
|
### Components tree changes
|
|
|
|
#### Component filters
|
|
|
|
Large component trees can sometimes be hard to navigate. DevTools now provides a way to filter components so that you can hide ones you're not interested in seeing.
|
|
|
|

|
|
|
|
Host nodes (e.g. HTML `<div>`, React Native `View`) are now hidden by default, but you can see them by disabling that filter.
|
|
|
|
Filter preferences are remembered between sessions.
|
|
|
|
#### No more inline props
|
|
|
|
Components in the tree no longer show inline props. This was done to [make DevTools faster](https://github.com/facebook/react/blob/master/packages/react-devtools/OVERVIEW.md) and to make it easier to browse larger component trees.
|
|
|
|
You can view a component's props, state, and hooks by selecting it:
|
|
|
|

|
|
|
|
#### "Rendered by" list
|
|
|
|
In React, an element's "owner" refers to the thing that rendered it. Sometimes an element's parent is also its owner, but usually they're different. This distinction is important because props come from owners.
|
|
|
|

|
|
|
|
When you are debugging an unexpected prop value, you can save time if you skip over the parents.
|
|
|
|
DevTools v4 adds a new "rendered by" list in the right hand pane that allows you to quickly step through the list of owners to speed up your debugging.
|
|
|
|

|
|
|
|
#### Owners tree
|
|
|
|
The inverse of the "rendered by" list is called the "owners tree". It is the list of things rendered by a particular component- (the things it "owns"). This view is kind of like looking at the source of the component's render method, and can be a helpful way to explore large, unfamiliar React applications.
|
|
|
|
Double click a component to view the owners tree and click the "x" button to return to the full component tree:
|
|
|
|

|
|
|
|
#### No more horizontal scrolling
|
|
|
|
Deeply nested components used to require both vertical and horizontal scrolling to see, making it easy to "get lost" within large component trees. DevTools now dynamically adjusts nesting indentation to eliminate horizontal scrolling.
|
|
|
|

|
|
|
|
#### Improved hooks support
|
|
|
|
Hooks now have the same level of support as props and state: values can be edited, arrays and objects can be drilled into, etc.
|
|
|
|

|
|
|
|
#### Improved search UX
|
|
|
|
Legacy DevTools search filtered the components tree to show matching nodes as roots. This made the overall structure of the application harder to reason about, because it displayed ancestors as siblings.
|
|
|
|
Search results are now shown inline similar to the browser's find-in-page search.
|
|
|
|

|
|
|
|
#### Higher order components
|
|
|
|
[Higher order components](https://reactjs.org/docs/higher-order-components.html) (or HOCs) often provide a [custom `displayName`](https://reactjs.org/docs/higher-order-components.html#convention-wrap-the-display-name-for-easy-debugging) following a convention of `withHOC(InnerComponentName)` in order to make it easier to identify components in React warnings and in DevTools.
|
|
|
|
The new Components tree formats these HOC names (along with several built-in utilities like `React.memo` and `React.forwardRef`) as a special badge to the right of the decorated component name.
|
|
|
|

|
|
|
|
Components decorated with multiple HOCs show the topmost badge and a count. Selecting the component shows all of the HOCs badges in the properties panel.
|
|
|
|

|
|
|
|
#### Restoring selection between reloads
|
|
|
|
DevTools now attempts to restore the previously selected element when you reload the page.
|
|
|
|

|
|
|
|
#### Suspense toggle
|
|
|
|
React's experimental [Suspense API](https://reactjs.org/docs/react-api.html#suspense) lets components "wait" for something before rendering. `<Suspense>` components can be used to specify loading states when components deeper in the tree are waiting to render.
|
|
|
|
DevTools lets you test these loading states with a new toggle:
|
|
|
|

|
|
|
|
### Profiler changes
|
|
|
|
#### Reload and profile
|
|
|
|
The profiler is a powerful tool for performance tuning React components. Legacy DevTools supported profiling, but only after it detected a profiling-capable version of React. Because of this there was no way to profile the initial _mount_ (one of the most performance sensitive parts) of an application.
|
|
|
|
This feature is now supported with a "reload and profile" action:
|
|
|
|

|
|
|
|
#### Import/export
|
|
|
|
Profiler data can now be exported and shared with other developers to enable easier collaboration.
|
|
|
|

|
|
|
|
Exports include all commits, timings, interactions, etc.
|
|
|
|
#### "Why did this render?"
|
|
|
|
"Why did this render?" is a common question when profiling. The profiler now helps answer this question by recording which props and state change between renders.
|
|
|
|

|
|
|
|
Because this feature adds a small amount of overhead, it can be disabled in the profiler settings panel.
|
|
|
|
#### Component renders list
|
|
|
|
The profiler now displays a list of each time the selected component rendered during a profiling session, along with the duration of each render. This list can be used to quickly jump between commits when analyzing the performance of a specific component.
|
|
|
|

|