UNPKG

12.3 kBMarkdownView Raw
1# React DevTools changelog
2
3<details>
4 <summary>
5 Changes that have landed in master but are not yet released.
6 Click to see more.
7 </summary>
8
9 <!-- Upcoming changes go here -->
10
11</details>
12
13## 4.2.0 (October 3, 2019)
14#### Features
15* "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))
16
17## 4.1.3 (September 30, 2019)
18#### Bug fixes
19* 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))
20
21## 4.1.2 (September 27, 2019)
22#### Bug fixes
23* 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))
24
25## 4.1.1 (September 26, 2019)
26#### Bug fixes
27* 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))
28* 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))
29* 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))
30* Show unsupported version dialog with downgrade instructions. ([bvaughn](https://github.com/bvaughn) in [#16897](https://github.com/facebook/react/pull/16897))
31
32## 4.1.0 (September 19, 2019)
33#### Features
34* 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))
35#### Bug fixes
36* 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))
37* 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))
38* 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))
39* 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))
40
41## 4.0.6 (August 26, 2019)
42#### Bug fixes
43* Remove ⚛️ emoji prefix from Firefox extension tab labels
44* Standalone polyfills `Symbol` usage
45
46## 4.0.5 (August 19, 2019)
47#### Bug fixes
48* Props, state, and context values are alpha sorted.
49* Standalone DevTools properly serves backend script over localhost:8097
50
51## 4.0.4 (August 18, 2019)
52#### Bug fixes
53* Bugfix for potential error if a min-duration commit filter is applied after selecting a fiber in the Profiler UI.
54
55## 4.0.3 (August 17, 2019)
56#### Bug fixes
57* ES6 `Map` and `Set`, typed arrays, and other unserializable types (e.g. Immutable JS) can now be inspected.
58* Empty objects and arrays now display an "(empty)" label to the right to reduce confusion.
59* Components that use only the `useContext` hook now properly display hooks values in side panel.
60* Style editor now supports single quotes around string values (e.g. both `"red"` and `'red'`).
61* Fixed edge case bug that prevented profiling when both React v16 and v15 were present on a page.
62
63## 4.0.2 (August 15, 2019)
64#### Permissions cleanup
65* Removed unnecessary `webNavigation ` permission from Chrome and Firefox extensions.
66
67## 4.0.1 (August 15, 2019)
68#### Permissions cleanup
69* Removed unnecessary `<all_urls>`, `background`, and `tabs` permissions from Chrome and Firefox extensions.
70
71## 4.0.0 (August 15, 2019)
72
73### General changes
74
75#### Improved performance
76The 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.
77
78[Learn more](https://github.com/facebook/react/blob/master/packages/react-devtools/OVERVIEW.md) about the performance optimizations that made this possible.
79
80#### Component stacks
81
82React 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`).
83
84![Example console warning with component stack added](https://user-images.githubusercontent.com/29597/62228120-eec3da80-b371-11e9-81bb-018c1e577389.png)
85
86It can be disabled in the general settings panel:
87
88![Settings panel showing "component stacks" option](https://user-images.githubusercontent.com/29597/62227882-8f65ca80-b371-11e9-8a4e-5d27011ad1aa.png)
89
90### Components tree changes
91
92#### Component filters
93
94Large 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.
95
96![Component filter demo video](https://user-images.githubusercontent.com/29597/62229209-0bf9a880-b374-11e9-8f84-cebd6c1a016b.gif)
97
98Host nodes (e.g. HTML `<div>`, React Native `View`) are now hidden by default, but you can see them by disabling that filter.
99
100Filter preferences are remembered between sessions.
101
102#### No more inline props
103
104Components 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.
105
106You can view a component's props, state, and hooks by selecting it:
107
108![Inspecting props](https://user-images.githubusercontent.com/29597/62303001-37da6400-b430-11e9-87fd-10a94df88efa.png)
109
110#### "Rendered by" list
111
112In 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.
113
114![Example code](https://user-images.githubusercontent.com/29597/62229551-bbcf1600-b374-11e9-8411-8ff411f4f847.png)
115
116When you are debugging an unexpected prop value, you can save time if you skip over the parents.
117
118DevTools 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.
119
120![Example video showing the "rendered by" list](https://user-images.githubusercontent.com/29597/62229747-4152c600-b375-11e9-9930-3f6b3b92be7a.gif)
121
122#### Owners tree
123
124The 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.
125
126Double click a component to view the owners tree and click the "x" button to return to the full component tree:
127
128![Demo showing "owners tree" feature](https://user-images.githubusercontent.com/29597/62229452-84f90000-b374-11e9-818a-61eec6be0bb4.gif)
129
130#### No more horizontal scrolling
131
132Deeply 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.
133
134![Video demonstration dynamic indentation to eliminate horizontal scrolling](https://user-images.githubusercontent.com/29597/62246661-f8ad0400-b398-11e9-885f-284f150a6d76.gif)
135
136#### Improved hooks support
137
138Hooks now have the same level of support as props and state: values can be edited, arrays and objects can be drilled into, etc.
139
140![Video demonstrating hooks support](https://user-images.githubusercontent.com/29597/62230532-d86c4d80-b376-11e9-8629-1b2129b210d6.gif)
141
142#### Improved search UX
143
144Legacy 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.
145
146Search results are now shown inline similar to the browser's find-in-page search.
147
148![Video demonstrating the search UX](https://user-images.githubusercontent.com/29597/62230923-c63edf00-b377-11e9-9f95-aa62ddc8f62c.gif)
149
150#### Higher order components
151
152[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.
153
154The 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.
155
156![Screenshot showing HOC badges](https://user-images.githubusercontent.com/29597/62302774-c4385700-b42f-11e9-9ef4-49c5f18d6276.png)
157
158Components decorated with multiple HOCs show the topmost badge and a count. Selecting the component shows all of the HOCs badges in the properties panel.
159
160![Screenshot showing a component with multiple HOC badges](https://user-images.githubusercontent.com/29597/62303729-7fadbb00-b431-11e9-8685-45f5ab52b30b.png)
161
162#### Restoring selection between reloads
163
164DevTools now attempts to restore the previously selected element when you reload the page.
165
166![Video demonstrating selection persistence](https://user-images.githubusercontent.com/810438/63130054-2c02ac00-bfb1-11e9-92fa-382e9e433638.gif)
167
168#### Suspense toggle
169
170React'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.
171
172DevTools lets you test these loading states with a new toggle:
173
174![Video demonstrating suspense toggle UI](https://user-images.githubusercontent.com/29597/62231446-e15e1e80-b378-11e9-92d4-086751dc65fc.gif)
175
176### Profiler changes
177
178#### Reload and profile
179
180The 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.
181
182This feature is now supported with a "reload and profile" action:
183
184![Video demonstrating the reload-and-profile feature](https://user-images.githubusercontent.com/29597/62233455-7a8f3400-b37d-11e9-9563-ec334bfb2572.gif)
185
186#### Import/export
187
188Profiler data can now be exported and shared with other developers to enable easier collaboration.
189
190![Video demonstrating exporting and importing profiler data](https://user-images.githubusercontent.com/29597/62233911-6566d500-b37e-11e9-9052-692378c92538.gif)
191
192Exports include all commits, timings, interactions, etc.
193
194#### "Why did this render?"
195
196"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.
197
198![Video demonstrating profiler "why did this render?" feature](https://user-images.githubusercontent.com/29597/62234698-0f932c80-b380-11e9-8cf3-a5183af0c388.gif)
199
200Because this feature adds a small amount of overhead, it can be disabled in the profiler settings panel.
201
202#### Component renders list
203
204The 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.
205
206![Video demonstrating profiler's component renders list](https://user-images.githubusercontent.com/29597/62234547-bcb97500-b37f-11e9-9615-54fba8b574b9.gif)