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
12 changes: 8 additions & 4 deletions client/app/components/ElementInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ const onClick = () => {
<template>
<div
border
border-gray-200
border-neutral-200
dark:border-neutral-700
rounded
p-2
bg-gray-50
:class="element ? 'cursor-pointer hover:bg-gray-100 transition-colors' : ''"
bg-neutral-50
dark:bg-neutral-800
:class="element ? 'cursor-pointer hover:bg-neutral-100 dark:hover:bg-neutral-700 transition-colors' : ''"
@mouseenter="onEnter"
@mouseleave="onLeave"
@click="onClick"
Expand All @@ -38,12 +40,14 @@ const onClick = () => {
>
<div
text-xs
text-gray-500
text-neutral-500
dark:text-neutral-400
>
{{ label }}
<span
v-if="element"
text-blue-600
dark:text-blue-400
ml-1
>(hover to highlight, click to inspect)</span>
</div>
Expand Down
17 changes: 10 additions & 7 deletions client/app/components/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,21 @@ const pageTitle = computed(() => {
<header
flex
px-4
py-2
border="b base"
text-2xl
font-bold
text-gray-800
h-49px
items-center
font-semibold
text-neutral-800
dark:text-white
gap-4
gap-1
n-border-base
>
<NuxtLink to="/">@nuxt/hints</NuxtLink>
<NuxtLink
to="/"
:class="pageTitle ? 'text-neutral-500 dark:text-neutral-400' : 'text-neutral-800 dark:text-white'"
>Hints</NuxtLink>
<template v-if="pageTitle">
-
<Icon name="carbon:chevron-right" />
<div>
{{ pageTitle }}
</div>
Expand Down
6 changes: 3 additions & 3 deletions client/app/components/HydrationIssue.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
<div class="text-sm font-semibold">
{{ componentName }}
</div>
<div class="text-xs text-gray-500 truncate">
<div class="text-xs text-neutral-500 truncate">
{{ filePath }}
</div>
<div class="mt-1 flex flex-wrap gap-2 text-[11px]">
Expand Down Expand Up @@ -148,21 +148,21 @@

<div class="grid mt-3 gap-2 grid-cols-2">
<div>
<div class="text-xs text-gray-500 mb-1">
<div class="text-xs text-neutral-500 mb-1">
Pre Hydration
</div>
<div
class="w-full overflow-auto"
v-html="preHtml"

Check warning on line 156 in client/app/components/HydrationIssue.vue

View workflow job for this annotation

GitHub Actions / ci

'v-html' directive can lead to XSS attack
/>
</div>
<div>
<div class="text-xs text-gray-500 mb-1">
<div class="text-xs text-neutral-500 mb-1">
Post Hydration
</div>
<div
class="w-full overflow-auto"
v-html="postHtml"

Check warning on line 165 in client/app/components/HydrationIssue.vue

View workflow job for this annotation

GitHub Actions / ci

'v-html' directive can lead to XSS attack
/>
</div>
</div>
Expand Down
19 changes: 12 additions & 7 deletions client/app/components/WebVitals/CLSMetric.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,15 @@ const formatTime = (time: number) => `${time.toFixed(0)}ms`
>
<div
border
border-gray-200
border-neutral-200
dark:border-neutral-800
rounded
p-2
>
<div
text-xs
text-gray-500
text-neutral-500
dark:text-neutral-400
>
Largest Shift Score
</div>
Expand All @@ -91,13 +93,15 @@ const formatTime = (time: number) => `${time.toFixed(0)}ms`
<div
v-if="metric.attribution.largestShiftTime !== undefined"
border
border-gray-200
border-neutral-200
dark:border-neutral-800
rounded
p-2
>
<div
text-xs
text-gray-500
text-neutral-500
dark:text-neutral-400
>
Shift Time
</div>
Expand All @@ -115,14 +119,14 @@ const formatTime = (time: number) => `${time.toFixed(0)}ms`
<div
v-if="metric.entries.length"
border
border-blue-200
rounded
p-2
bg-blue-50
class="bg-blue-50 dark:bg-blue-800/10 border-blue-200 dark:border-blue-800"
>
<div
text-xs
text-blue-700
dark:text-blue-400
font-semibold
>
Total Layout Shifts: {{ metric.entries.length }}
Expand All @@ -135,7 +139,8 @@ const formatTime = (time: number) => `${time.toFixed(0)}ms`
items-center
justify-between
text-xs
text-gray-400
text-neutral-500
dark:text-neutral-400
>
<span v-if="metric.attribution.loadState">Load State: {{ metric.attribution.loadState }}</span>
<span>ID: {{ metric.id }}</span>
Expand Down
26 changes: 13 additions & 13 deletions client/app/components/WebVitals/INPMetric.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ const formatTime = (time: number) => `${time.toFixed(0)}ms`
>
<div
border
border-gray-200
border-neutral-200
rounded
p-2
>
<div
text-xs
text-gray-500
text-neutral-500
>
Input Delay
</div>
Expand All @@ -98,13 +98,13 @@ const formatTime = (time: number) => `${time.toFixed(0)}ms`

<div
border
border-gray-200
border-neutral-200
rounded
p-2
>
<div
text-xs
text-gray-500
text-neutral-500
>
Processing
</div>
Expand All @@ -119,13 +119,13 @@ const formatTime = (time: number) => `${time.toFixed(0)}ms`

<div
border
border-gray-200
border-neutral-200
rounded
p-2
>
<div
text-xs
text-gray-500
text-neutral-500
>
Presentation
</div>
Expand Down Expand Up @@ -158,7 +158,7 @@ const formatTime = (time: number) => `${time.toFixed(0)}ms`
</div>
<div
text-xs
text-gray-600
text-neutral-600
>
{{ metric.attribution.longAnimationFrameEntries.length }} frame(s)
</div>
Expand All @@ -168,7 +168,7 @@ const formatTime = (time: number) => `${time.toFixed(0)}ms`
text-xs
>
<div
text-gray-500
text-neutral-500
mb-1
>
Longest Script ({{ metric.attribution.longestScript.subpart }})
Expand All @@ -192,7 +192,7 @@ const formatTime = (time: number) => `${time.toFixed(0)}ms`
>
<div>
<span
text-gray-500
text-neutral-500
>Total Script:</span>
<span
font-mono
Expand All @@ -201,7 +201,7 @@ const formatTime = (time: number) => `${time.toFixed(0)}ms`
</div>
<div>
<span
text-gray-500
text-neutral-500
>Style & Layout:</span>
<span
font-mono
Expand All @@ -210,7 +210,7 @@ const formatTime = (time: number) => `${time.toFixed(0)}ms`
</div>
<div v-if="metric.attribution.totalPaintDuration !== undefined">
<span
text-gray-500
text-neutral-500
>Paint:</span>
<span
font-mono
Expand All @@ -219,7 +219,7 @@ const formatTime = (time: number) => `${time.toFixed(0)}ms`
</div>
<div v-if="metric.attribution.totalUnattributedDuration !== undefined">
<span
text-gray-500
text-neutral-500
>Unattributed:</span>
<span
font-mono
Expand All @@ -234,7 +234,7 @@ const formatTime = (time: number) => `${time.toFixed(0)}ms`
items-center
justify-between
text-xs
text-gray-400
text-neutral-400
>
<span>Load State: {{ metric.attribution.loadState }}</span>
<span>ID: {{ metric.id }}</span>
Expand Down
20 changes: 10 additions & 10 deletions client/app/components/WebVitals/LCPMetric.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const formatTime = (time: number) => `${time.toFixed(0)}ms`
<div
v-if="metric.attribution.url"
text-xs
text-gray-600
text-neutral-600
mt-1
break-all
>
Expand All @@ -79,13 +79,13 @@ const formatTime = (time: number) => `${time.toFixed(0)}ms`
>
<div
border
border-gray-200
border-neutral-200
rounded
p-2
>
<div
text-xs
text-gray-500
text-neutral-500
>
Time to First Byte
</div>
Expand All @@ -100,13 +100,13 @@ const formatTime = (time: number) => `${time.toFixed(0)}ms`

<div
border
border-gray-200
border-neutral-200
rounded
p-2
>
<div
text-xs
text-gray-500
text-neutral-500
>
Resource Load Delay
</div>
Expand All @@ -121,13 +121,13 @@ const formatTime = (time: number) => `${time.toFixed(0)}ms`

<div
border
border-gray-200
border-neutral-200
rounded
p-2
>
<div
text-xs
text-gray-500
text-neutral-500
>
Resource Load Duration
</div>
Expand All @@ -142,13 +142,13 @@ const formatTime = (time: number) => `${time.toFixed(0)}ms`

<div
border
border-gray-200
border-neutral-200
rounded
p-2
>
<div
text-xs
text-gray-500
text-neutral-500
>
Element Render Delay
</div>
Expand All @@ -165,7 +165,7 @@ const formatTime = (time: number) => `${time.toFixed(0)}ms`
<!-- ID -->
<div
text-xs
text-gray-400
text-neutral-400
>
ID: {{ metric.id }}
</div>
Expand Down
16 changes: 12 additions & 4 deletions client/app/pages/hydration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,17 @@ const { hydration } = useHostHydration()
gap-4
p-4
>
<HydrationIssue
v-for="issue in hydration"
:issue="issue"
/>
<template v-if="hydration.length">
<HydrationIssue
v-for="issue in hydration"
:issue="issue"
/>
</template>
<div
v-else
class="text-neutral-500 dark:text-neutral-400"
>
No hydration issues found
</div>
</div>
</template>
Loading
Loading