-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Component stack and dependency graphs work more like Call Stack
- Loading branch information
Showing
8 changed files
with
121 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 16 additions & 17 deletions
33
src/devtools/client/debugger/src/components/SecondaryPanes/DependencyGraph/Item.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...lient/debugger/src/components/SecondaryPanes/DependencyGraph/selectDependencyGraphNode.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { Location, TimeStampedPoint } from "@replayio/protocol"; | ||
|
||
import { selectLocation } from "devtools/client/debugger/src/actions/sources"; | ||
import { frameSelected, getThreadContext } from "devtools/client/debugger/src/selectors"; | ||
import { pauseIdCache } from "replay-next/src/suspense/PauseCache"; | ||
import { UIThunkAction } from "ui/actions"; | ||
|
||
export function selectDependencyGraphNode( | ||
location: Location, | ||
timeStampedPoint: TimeStampedPoint | ||
): UIThunkAction { | ||
return async (dispatch, getState, { replayClient }) => { | ||
const pauseId = await pauseIdCache.readAsync( | ||
replayClient, | ||
timeStampedPoint.point, | ||
timeStampedPoint.time | ||
); | ||
|
||
const context = getThreadContext(getState()); | ||
|
||
// TODO Is this legit? | ||
const frameId = "0"; | ||
|
||
dispatch(frameSelected({ cx: context, pauseId, frameId })); | ||
dispatch(selectLocation(context, location)); | ||
}; | ||
} |
24 changes: 24 additions & 0 deletions
24
...evtools/client/debugger/src/components/SecondaryPanes/DependencyGraph/useIsCurrentItem.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Location, TimeStampedPoint } from "@replayio/protocol"; | ||
|
||
import { getSelectedFrameId } from "devtools/client/debugger/src/selectors"; | ||
import { comparePosition } from "devtools/client/debugger/src/utils/location"; | ||
import { getPointAndTimeForPauseId } from "replay-next/src/suspense/PauseCache"; | ||
import { getSelectedLocation } from "ui/reducers/sources"; | ||
import { useAppSelector } from "ui/setup/hooks"; | ||
|
||
export function useIsCurrentItem( | ||
timeStampedPoint: TimeStampedPoint | null, | ||
location: Location | null | ||
) { | ||
const { pauseId } = useAppSelector(getSelectedFrameId) ?? {}; | ||
const selectedLocation = useAppSelector(getSelectedLocation); | ||
|
||
const [selectedExecutionPoint] = pauseId ? getPointAndTimeForPauseId(pauseId) : []; | ||
|
||
const isMatchingExecutionPoint = | ||
selectedExecutionPoint != null && timeStampedPoint?.point === selectedExecutionPoint; | ||
const isMatchingLocation = | ||
location && selectedLocation && comparePosition(location, selectedLocation); | ||
|
||
return isMatchingExecutionPoint && isMatchingLocation; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters