-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/experimental' into supplemental-…
…recordings
- Loading branch information
Showing
22 changed files
with
820 additions
and
146 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
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
4 changes: 4 additions & 0 deletions
4
.../client/debugger/src/components/SecondaryPanes/DependencyGraph/DependencyGraph.module.css
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,4 @@ | ||
.Panel { | ||
display: flex; | ||
flex-direction: column; | ||
} |
75 changes: 75 additions & 0 deletions
75
...evtools/client/debugger/src/components/SecondaryPanes/DependencyGraph/DependencyGraph.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import { ExecutionPoint, Location } from "@replayio/protocol"; | ||
import { Suspense, useContext } from "react"; | ||
|
||
import { PanelLoader } from "replay-next/components/PanelLoader"; | ||
import { sourcesByIdCache, sourcesByUrlCache } from "replay-next/src/suspense/SourcesCache"; | ||
import { getSourceToDisplayForUrl } from "replay-next/src/utils/sources"; | ||
import { suspendInParallel } from "replay-next/src/utils/suspense"; | ||
import { ReplayClientContext } from "shared/client/ReplayClientContext"; | ||
import { DependencyGraphMode } from "shared/client/types"; | ||
import { depGraphCache } from "ui/suspense/depGraphCache"; | ||
|
||
import { Item } from "./Item"; | ||
import styles from "./DependencyGraph.module.css"; | ||
|
||
type Props = { | ||
mode?: DependencyGraphMode; | ||
point: ExecutionPoint | undefined; | ||
}; | ||
|
||
export function DependencyGraph(props: Props) { | ||
return ( | ||
<Suspense fallback={<PanelLoader />}> | ||
<DependencyGraphSuspends {...props} /> | ||
</Suspense> | ||
); | ||
} | ||
|
||
function DependencyGraphSuspends({ mode, point }: Props) { | ||
const replayClient = useContext(ReplayClientContext); | ||
|
||
const [depGraphValue, sourcesById, sourcesByUrl] = suspendInParallel( | ||
() => depGraphCache.read(replayClient, point ?? null, mode ?? null), | ||
() => sourcesByIdCache.read(replayClient), | ||
() => sourcesByUrlCache.read(replayClient) | ||
); | ||
|
||
const valueDescending = depGraphValue?.slice().reverse(); | ||
|
||
return ( | ||
<div className={styles.Panel}> | ||
{valueDescending?.map((entry, index) => { | ||
let location: Location | null = null; | ||
if ("calleeLocation" in entry && entry.calleeLocation != null) { | ||
const source = getSourceToDisplayForUrl( | ||
sourcesById, | ||
sourcesByUrl, | ||
entry.calleeLocation.url | ||
); | ||
if (source) { | ||
location = { | ||
...entry.calleeLocation, | ||
sourceId: source.sourceId, | ||
}; | ||
} | ||
} | ||
|
||
return ( | ||
<Item | ||
key={index} | ||
location={location} | ||
name={entry.code} | ||
timeStampedPoint={ | ||
entry.point != null && entry.time != null | ||
? { | ||
point: entry.point, | ||
time: entry.time, | ||
} | ||
: null | ||
} | ||
/> | ||
); | ||
})} | ||
</div> | ||
); | ||
} |
46 changes: 46 additions & 0 deletions
46
src/devtools/client/debugger/src/components/SecondaryPanes/DependencyGraph/Item.module.css
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,46 @@ | ||
.Item { | ||
padding: 0.25rem 0.5rem; | ||
display: flex; | ||
flex-direction: row; | ||
gap: 0.25rem; | ||
white-space: nowrap; | ||
} | ||
.Item:hover { | ||
background-color: var(--theme-selection-background-hover); | ||
cursor: pointer; | ||
} | ||
.Item[data-disabled] { | ||
color: var(--color-dim); | ||
} | ||
.Item[data-disabled]:hover { | ||
background-color: transparent; | ||
cursor: default; | ||
} | ||
.Item[data-selected], | ||
.Item[data-selected]:hover { | ||
background-color: var(--theme-selection-background); | ||
color: white; | ||
} | ||
|
||
.NameColumn { | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
} | ||
|
||
.TimestampColumn { | ||
flex: 1; | ||
font-size: var(--font-size-small); | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
} | ||
|
||
.LocationColumn { | ||
color: var(--color-dim); | ||
flex-grow: 0; | ||
flex-shrink: 1; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
} | ||
.Item[data-selected] .LocationColumn { | ||
color: white; | ||
} |
Oops, something went wrong.