Skip to content

chore(assistant): remove unused highlighter and @shikijs dependencies - #1492

Merged
larbish merged 1 commit into
mainfrom
chore/remove-assistant-highlighter
Nov 19, 2026
Merged

larbish merged 1 commit into
mainfrom
chore/remove-assistant-highlighter

Conversation

@larbish

@larbish larbish commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

Why

AssistantPreStream.vue and useHighlighter.ts have had no importer since #1284, which moved the assistant's code blocks to AssistantComark (@comark/vue/plugins/shiki). The layer still shipped both files and five @shikijs/* dependencies that only they import.

What changed

  • Assistant module: delete AssistantPreStream.vue and useHighlighter.ts.
  • Dependencies: remove @shikijs/core, @shikijs/engine-javascript, @shikijs/langs, @shikijs/stream and @shikijs/themes from layer/package.json. Only @shikijs/stream leaves the lockfile, the other four stay as transitive dependencies.
  • README: drop the useHighlighter section and replace shiki-stream with @comark/vue in the install line.

Evidence

Importers on main before the change, only the two files and the README:

$ rg -n -i "AssistantPreStream|useHighlighter|PreStream" --hidden --glob '!.git' --glob '!pnpm-lock.yaml' .
./layer/modules/assistant/runtime/composables/useHighlighter.ts:8:export const useHighlighter = async () => {
./layer/modules/assistant/runtime/components/AssistantPreStream.vue:4:import { useHighlighter } from '../composables/useHighlighter'
./layer/modules/assistant/runtime/components/AssistantPreStream.vue:7:const highlighter = await useHighlighter()
./layer/modules/assistant/README.md:203:### `useHighlighter`

Docs bundle, nuxt-bundle-analyzer@0.2.0 with the URLs of the bundle-size workflow, measured on 352819c (before #1491):

Client 806.8 kB (no change)

In that comparison, all 456 files in docs/.output/public/_nuxt outside builds/ have the same SHA-256 before and after.

shiki still resolves for @comark/vue/plugins/shiki. The lockfile keeps @comark/vue@0.9.2(…)(shiki@4.6.0), and the npm starter builds with the assistant enabled (AI_GATEWAY_API_KEY=dummy) and emits the shiki theme chunks.

Run locally on b5e5f08: lint, typecheck, unit tests (184 passed), CLI build, docs on the vercel, static and node-server presets with the smoke tests (18 passed, 2 skipped), and both starters.

Notes

  • shiki is not added to the layer. It reaches @comark/vue through @nuxtjs/mdc and @nuxt/content, as it did before.
  • The starters job does not bundle AssistantComark, because the assistant is disabled without an AI Gateway key. The check above sets a dummy key for that reason.

ELI5

The assistant used to colour code blocks with its own helper. A later change switched to another tool and left the old helper behind, along with the packages it needed. This removes the leftovers, and the site people download stays exactly the same.

🤖 Generated with Amp, reviewed by @larbish before opening.

@vercel

vercel Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docus Ready Ready Preview Nov 19, 2026 8:03pm UTC

@pkg-pr-new

pkg-pr-new Bot commented Nov 19, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/create-docus@1492
npm i https://pkg.pr.new/docus@1492

commit: 54c915e

@docus-bundle-report

Copy link
Copy Markdown

Bundle size

Explore the comparison →

Client 806.5 kB (no change) · Server 1.67 MB $\color{red}\textsf{(+90 B, +0.0}\%\textsf{)}$

No route loads 100 B more or less before it renders.

No prerendered URL's initial load or HTML changes by 100 B or more.

Brotli sizes. Changes under 100 B are left out of the tables. Measured by nuxt-bundle-analyzer for 54c915e.

@larbish
larbish merged commit f6adb2d into main Nov 19, 2026
13 checks passed
@larbish
larbish deleted the chore/remove-assistant-highlighter branch November 19, 2026 20:10

This branch was successfully deployed

1 active deployment
Preview — 54c915e2 Deployed Nov 19, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant