Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions packages/devtools-vite/src/app/components/data/AssetDetails.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script setup lang="ts">
import type { Asset as AssetInfo } from '@rolldown/debug'
import type { RolldownAssetInfo, RolldownChunkInfo, SessionContext } from '~~/shared/types'
import { useRoute } from '#app/composables/router'
import { useRpc } from '#imports'
import { useAsyncState } from '@vueuse/core'
import { computed, ref } from 'vue'
Expand All @@ -18,6 +19,7 @@ const props = withDefaults(defineProps<{
})

const rpc = useRpc()
const route = useRoute()
const showSource = ref(false)
const { state } = useAsyncState(
async () => {
Expand Down Expand Up @@ -81,6 +83,7 @@ function openInEditor() {
<div i-ph-file-text />
View source
</button>
<slot />
</div>
</div>

Expand Down Expand Up @@ -110,14 +113,17 @@ function openInEditor() {
<div op50>
Chunks
</div>
<div v-for="chunk of assetChunks" :key="chunk.chunk_id" border="~ base rounded-lg" px2 py1>
<NuxtLink
v-for="chunk of assetChunks" :key="chunk.chunk_id" border="~ base rounded-lg" px2 py1
:to="{ path: route.path, query: { chunk: chunk.chunk_id } }"
>
<DataChunkDetails
:chunk="chunk"
:session="session"
:show-modules="false"
:show-imports="false"
/>
</div>
</NuxtLink>
</div>
<template v-if="_importers?.length || _imports?.length">
<div flex="~ col gap-2">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ const { state } = useAsyncState(
</script>

<template>
<div v-if="state?.asset" p4 relative h-full w-full of-auto pt12 bg-glass z-panel-content>
<DisplayCloseButton
absolute right-2 top-1.5
@click="emit('close')"
/>
<DataAssetDetails :asset="state.asset" :session="session" :chunks="state?.chunks" :importers="state?.importers" :imports="state?.imports" />
<div v-if="state?.asset" p4 relative h-full w-full of-auto bg-glass z-panel-content>
<DataAssetDetails :asset="state.asset" :session="session" :chunks="state?.chunks" :importers="state?.importers" :imports="state?.imports">
<DisplayCloseButton
@click="emit('close')"
/>
</DataAssetDetails>
</div>
</template>
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ withDefaults(defineProps<{
<div i-ph-package-duotone />
{{ chunk.modules.length }}
</div>
<slot />
</div>

<template v-if="showImports && chunk.imports.length > 0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ const { state, isLoading } = useAsyncState(
<template>
<VisualLoading v-if="isLoading" />

<div v-if="state" p4 pt-12 relative h-full w-full of-auto z-panel-content>
<DisplayCloseButton
absolute right-2 top-1.5
@click="emit('close')"
/>
<DataChunkDetails :session="session" :chunk="state" />
<div v-if="state" p4 relative h-full w-full of-auto z-panel-content>
<DataChunkDetails :session="session" :chunk="state">
<DisplayCloseButton
@click="emit('close')"
/>
</DataChunkDetails>
</div>
</template>
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const containerClass = computed(() => {
<template>
<component
:is="link ? NuxtLink : 'div'"
:to="link ? (typeof link === 'string' ? link : { path: route.path, query: { ...route.query, module: id }, hash: location.hash }) : undefined"
:to="link ? (typeof link === 'string' ? link : { path: route.path, query: { ...route.query, module: id, chunk: undefined }, hash: location.hash }) : undefined"
>
<Tooltip
my-auto text-sm font-mono block w-full
Expand Down
Loading