Skip to content

Commit 0919074

Browse files
authored
perf(devtools): remove shiki (#399)
1 parent 4a1fea8 commit 0919074

File tree

3 files changed

+9
-78
lines changed

3 files changed

+9
-78
lines changed

client/app.vue

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22
import { onDevtoolsClientConnected } from '@nuxt/devtools-kit/iframe-client'
33
import { registry } from '../src/registry'
44
import { devtools, getScriptSize, humanFriendlyTimestamp, reactive, ref, urlToOrigin } from '#imports'
5-
import { loadShiki } from '~/composables/shiki'
65
import { msToHumanReadable } from '~/utils/formatting'
76
87
const scriptRegistry = registry(s => s)
9-
await loadShiki()
108
119
const scripts = ref({})
1210
const scriptSizes = reactive<Record<string, string>>({})
@@ -73,7 +71,7 @@ function viewDocs(docs: string) {
7371

7472
<template>
7573
<div class="relative n-bg-base flex flex-col">
76-
<header class="sticky top-0 z-2 px-4 pt-4">
74+
<header class="sticky top-0 z-2 px-4 pt-4 bg-background/80 backdrop-blur-lg">
7775
<div class="flex justify-between items-start" mb2>
7876
<div class="flex space-x-5">
7977
<h1 text-xl flex items-center gap-2>
@@ -155,9 +153,9 @@ function viewDocs(docs: string) {
155153
</div>
156154
</div>
157155
</header>
158-
<div class="flex-row flex p4 h-full" style="min-height: calc(100vh - 64px);">
156+
<div class="flex-row flex h-full" style="min-height: calc(100vh - 64px);">
159157
<main class="mx-auto flex flex-col w-full bg-white dark:bg-black dark:bg-dark-700 bg-light-200 ">
160-
<div v-if="tab === 'scripts'" class="h-full relative max-h-full">
158+
<div v-if="tab === 'scripts'" class="h-full relative max-h-full p-4">
161159
<div v-if="!Object.keys(scripts || {}).length">
162160
<div>No scripts loaded.</div>
163161
</div>
@@ -237,12 +235,12 @@ function viewDocs(docs: string) {
237235
{{ event.status }}
238236
</div>
239237
</template>
240-
<template v-else-if="event.type === 'fn-call' && event.args">
241-
<OCodeBlock :code="`${event.fn}(${event.args?.map(a => JSON.stringify(a, null, 2)).join(', ') || ''})`" lang="javascript" />
242-
</template>
243-
<template v-else-if="event.type === 'fn-call' && !event.args">
244-
<OCodeBlock :code="`QUEUED ${event.fn}`" lang="javascript" />
245-
</template>
238+
<div v-else-if="event.type === 'fn-call' && event.args" class="px-2 py-[2px] bg-gray-100 text-gray-700 rounded-lg font-mono">
239+
{{ `${event.fn}(${event.args?.map((a: any) => JSON.stringify(a, null, 2)).join(', ') || ''})` }}
240+
</div>
241+
<div v-else-if="event.type === 'fn-call' && !event.args" class="px-2 py-[2px] bg-gray-100 text-gray-700 rounded-lg font-mono">
242+
QUEUED {{ event.fn }}
243+
</div>
246244
</div>
247245
</div>
248246
</OSectionBlock>

client/components/OCodeBlock.vue

Lines changed: 0 additions & 34 deletions
This file was deleted.

client/composables/shiki.ts

Lines changed: 0 additions & 33 deletions
This file was deleted.

0 commit comments

Comments
 (0)