Commit Graph

941 Commits

Author SHA1 Message Date
Brian Vaughn a2ba90bf96 Fixed a path selection bug when filter pereferences are updated 2019-05-01 10:45:18 -07:00
Brian Vaughn c4c51c0821 Prevent filter preference changes while profiling is active 2019-05-01 10:45:18 -07:00
Brian Vaughn eb9705abc8 Removed FilterList UI for now (collapsed into Settings component) 2019-05-01 10:45:18 -07:00
Brian Vaughn a241780dc2 Filter changes are applied to the renderer without reloading 2019-05-01 10:45:18 -07:00
Brian Vaughn 27a1820039 Refactored filter preferences a bit more to be stored in the Store 2019-05-01 10:45:18 -07:00
Brian Vaughn ee1b38e4db Added filter preference types and plugged into renderer partly. Lots of work to do still. 2019-05-01 10:45:18 -07:00
Brian Vaughn 9db209ee64 Initial pass at adding filter-by-type Flow types and support to renderer 2019-05-01 10:45:18 -07:00
Brian Vaughn 17c5feb66a Reorganized types shared between backend and frontend slightly. 2019-05-01 10:45:18 -07:00
Brian Vaughn 18b34b4926 Rearranged Settings UI in prep for custom filter controls 2019-05-01 10:45:18 -07:00
Brian Vaughn a9aa9f2106
Merge pull request #251 from gaearon/devserver
Use WebpackDevServer for local testing
2019-05-01 09:29:43 -07:00
Dan Abramov b9ae9393b9 Use WebpackDevServer for local testing 2019-05-01 17:19:26 +01:00
Ivan Babak cd89c0d75f Clear profiling data for root when the root is unmounted
Fixes https://github.com/bvaughn/react-devtools-experimental/issues/232
2019-05-01 01:46:47 -07:00
Ivan Babak c6c71ef8f9 Fix profiling screenshots data structure to map rootID to commitIndex
Propagate `rootID` throughout the code for `captureScreenshot`.

Rename private profiling maps of `store` to make relations more clear.

Fix missing cleanup for screenshots data in `set importedProfilingData` of `store`.
2019-05-01 01:07:36 -07:00
Ivan Babak d1f6e762e4 Improve Flow coverage by reducing typecasts through `any`
There are many unnecessary typecasts through `any` which
break the Flow of types across the program.

It's more bulletproof to avoid lying to ourselves about types.

Also fixed sketchy null check where zero ID would be skipped:
```diff
-  } else if (selectedElementID) {
+  } else if (selectedElementID !== null) {
```
2019-05-01 00:31:13 -07:00
Brian Vaughn abcb613223 Minor Bridge code tweaks:
1. Renamed a variable
2. Coerced undefined to null
3. Added a couple of console.warn() for unexpected paths
2019-04-30 09:23:11 -07:00
Brian Vaughn 5204ae87bc
Merge pull request #229 from sompylasar/217-workaround-disconnected-port-error
Fix for 'Attempting to use a disconnected port object'
2019-04-30 09:15:52 -07:00
Brian Vaughn b24216a7b1
Merge pull request #234 from gaearon/nested-suspense-test
Add test coverage for nested Suspense
2019-04-30 08:51:58 -07:00
Brian Vaughn 9e1b1e8c91
Merge pull request #233 from gaearon/preset-env
Start using @babel/preset-env
2019-04-30 08:50:17 -07:00
Brian Vaughn da951ec9bb
Merge pull request #243 from sompylasar/rename-profiler-types-to-frontend-backend-to-disambiguate
Rename Profiler types to disambiguate which is Frontend and Backend
2019-04-30 08:47:05 -07:00
Brian Vaughn 44205f16d9
Merge pull request #247 from sompylasar/fix-flow-on-circleci
Fix Flow failure on CircleCI due to the number of workers
2019-04-30 08:32:37 -07:00
Ivan Babak bfbde71657 Fix Flow failure on CircleCI due to the number of workers
https://github.com/flowtype/flow-bin/issues/138#issuecomment-448416874
https://github.com/flowtype/flow-bin/issues/138#issuecomment-450367472

> This will stop flow from trying to consume too many virtual CPUs (which CircleCI doesn't actually provide), letting it run to completion without first running out of memory and killing its sub processes.

The log output in CircleCI was:
https://circleci.com/gh/bvaughn/react-devtools-experimental/201
```
#!/bin/bash -eo pipefail
yarn flow
yarn run v1.10.1
$ /home/circleci/repo/node_modules/.bin/flow
Launching Flow server for /home/circleci/repo
Spawned flow server (pid=259)
Logs will go to /tmp/flow/zShomezScirclecizSrepo.log
Monitor logs will go to /tmp/flow/zShomezScirclecizSrepo.monitor_log
Launching Flow server for /home/circleci/repo
Spawned flow server (pid=361)
Logs will go to /tmp/flow/zShomezScirclecizSrepo.log
Monitor logs will go to /tmp/flow/zShomezScirclecizSrepo.monitor_log
Launching Flow server for /home/circleci/repo
Spawned flow server (pid=464)
Logs will go to /tmp/flow/zShomezScirclecizSrepo.log
Monitor logs will go to /tmp/flow/zShomezScirclecizSrepo.monitor_log
Launching Flow server for /home/circleci/repo
Spawned flow server (pid=567)
Logs will go to /tmp/flow/zShomezScirclecizSrepo.log
Monitor logs will go to /tmp/flow/zShomezScirclecizSrepo.monitor_log
Lost connection to the flow server (0 retries remaining): -Out of retries, exiting!
error Command failed with exit code 7.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Exited with code 1
```
2019-04-29 21:56:53 -07:00
Ivan Babak d35cf80921 Remove Fiber type properties we don't use in DevTools 2019-04-28 12:57:28 -07:00
Dan Abramov d351b46aee
Merge pull request #238 from sompylasar/fix-typo-recursivelyinitializetree
Fix typo `recursivelyIniitliazeTree` -> `recursivelyInitializeTree`
2019-04-28 13:38:49 +01:00
Dan Abramov 7c04883f8d
Merge pull request #239 from sompylasar/remove-agent-addbridge
Remove Agent addBridge: there can only be one bridge, add in constructor
2019-04-28 13:38:34 +01:00
Ivan Babak 1b5f043e01 Fix for 'Attempting to use a disconnected port object'
Fixes https://github.com/bvaughn/react-devtools-experimental/issues/217

The error reproduces with any two React websites, e.g. `https://reactjs.org` and `https://nextjs.org`, by keeping the DevTools Components tab open and switching between these websites in the same browser tab.

There are several issues with the code that contribute to this:
1. `Bridge` leaves behind a dangling timer that fires `_flush` after the bridge has been abandoned ("shutdown").
2. `bridge.send('shutdown')` is asynchronous, so the event handlers do not get unsubscribed in time.
3. `port.onDisconnect` does not trigger on in-tab navigation like new URL or back/forward navigation.
4. State management design of the code that uses shared variables and callbacks makes it hard to handle race conditions originating from the browser.

This commit cleans up some of the lacking symmetry when using `addListener`/`removeListener`, but the code in `shells/browser/shared/src/main.js` is hard to reason about with regards to race conditions, and there are many possible race conditions originating from the browser, so maybe there could be a better design paradigm (like a formal state machine) to manage the state changes in response to sequences of events than plain old event listeners, callbacks, and shared variables.

Unrelated, but clicking Chrome Back/Forward/Back/Forward very fast makes the browser and the DevTools and the DevTools of DevTools stall and become unresponsive for some time, then recovers but the Back/Forward/Stop/Refresh button and favicon loading indicator may remain broken. Looks like a Chrome bug, some kind of a temporary deadlock in handling the browser history.
2019-04-28 04:45:57 -07:00
Ivan Babak d3e5fcd81c Rename Profiler types to disambiguate which is Frontend and Backend
Flow IDE shows the original type, not the file-scoped alias,
so it's confusing to see incompatible variables that have types
with the same name.

This started from `src/devtools/ProfilingCache.js` where
`ProfilingSummary` was incompatible, but I decided to make a bigger
change for consistency and to avoid similar mistakes in the future.
2019-04-28 04:40:39 -07:00
Ivan Babak 9f06bc345f Add Flow types for Fiber
Fixes https://github.com/bvaughn/react-devtools-experimental/issues/165
2019-04-28 04:18:27 -07:00
Ivan Babak 0b817777b4 Remove Agent addBridge: there can only be one bridge, add in constructor
Let's make impossible states truly impossible, and fix Flow types, too.

All three usages of Agent called addBridge right after constructing it.
Agent has one field `_bridge` which is force-typed as not-null despite
there's a temporary zone between the constructor end and addBridge start
where `_bridge` is null.
2019-04-28 04:03:28 -07:00
Ivan Babak 19bfba7943 Fix typo `recursivelyIniitliazeTree` -> `recursivelyInitializeTree` 2019-04-28 03:52:33 -07:00
Dan Abramov d81d74b236 Add test coverage for nested Suspense 2019-04-26 20:04:28 +01:00
Dan Abramov e5ed266873 Start using @babel/preset-env 2019-04-26 19:37:23 +01:00
Dan Abramov 2118b1fe1b
Merge pull request #230 from gaearon/assert-maps
Assert empty maps when there are no roots
2019-04-26 18:15:04 +01:00
Dan Abramov b6a55989f5 Assert empty maps when there are no roots 2019-04-26 17:47:00 +01:00
Brian Vaughn c28acc5d47 Changed owners back button label to say 'Up to <...>' 2019-04-26 09:38:25 -07:00
Ivan Babak 281616f462 Support highlighting of all DOM elements of Fragments, not just first
Fixes https://github.com/bvaughn/react-devtools-experimental/issues/131

Uses the new function `findAllCurrentHostFibers`.

Removes dependency on React's `renderer.findHostInstanceByFiber` function
which used to highlight only the first DOM element of a Fragment.

Reworked `src/backend/views/Overlay` to support highlighting
more than one element rectangle annotated with one tooltip.
Fixed minor issues with the tooltip position calculation.
2019-04-26 01:22:49 -07:00
Brian Vaughn 707b44834f
Merge pull request #213 from wldcordeiro/fix-firefox-perms
fix: correct permissions for Firefox
2019-04-25 19:11:39 -07:00
Brian Vaughn 043b73e0a8
Merge pull request #223 from bvaughn/owners-list-intermediate-components
Owners list view should drill through intermediate components
2019-04-25 15:10:08 -07:00
Brian Vaughn 09029acf00 Refactored owners list to use cached metadata (and added more tests) 2019-04-25 15:06:24 -07:00
Brian Vaughn 15eacae02c Moved owners list calculations into the store and added tests
This is being done to fix a drill-through bug, although the initial fix is perhaps not the most performant one. At least we have test coverage now and a temporary fix.
2019-04-25 15:06:24 -07:00
Brian Vaughn b6d617ac7f Added 'back to owner' button when owners stack is collapsed 2019-04-25 15:05:39 -07:00
Brian Vaughn e88819a22e Reverse direction of menu items within drop-down owners list 2019-04-25 14:10:51 -07:00
Dan Abramov a0b1fb37fb
Merge pull request #227 from gaearon/string-table
Transfer strings in a string table
2019-04-25 17:54:11 +01:00
Dan Abramov 1bea469db0 Remove unneeded variable 2019-04-25 17:46:48 +01:00
Dan Abramov af2d1374c4 Let -> const 2019-04-25 17:39:13 +01:00
Dan Abramov 3920ebd0a1
Clarify encoding in overview 2019-04-25 17:32:46 +01:00
Dan Abramov c8f8943c9a Transfer strings in a string table 2019-04-25 17:11:24 +01:00
Dan Abramov c1363b7e17
Merge pull request #226 from gaearon/mutate-children
Improve performance by mutating the children array
2019-04-25 15:27:36 +01:00
Dan Abramov 2e423c21b0
Merge pull request #221 from gaearon/heuristic
Use a heuristic for locating roots
2019-04-25 15:22:34 +01:00
Dan Abramov e1383c666d Allow to set tracked path multiple times
Fixes #225. This happens when you close and reopen DevTools while on the same page.
2019-04-25 14:57:39 +01:00
Dan Abramov 2993b168e5 Mutate the children array 2019-04-25 14:47:05 +01:00