Skip to content

feat(stream): add svelte renderer#1291

Merged
antfu merged 9 commits into
shikijs:mainfrom
CNSeniorious000:feat/stream-svelte-renderer
Jun 24, 2026
Merged

feat(stream): add svelte renderer#1291
antfu merged 9 commits into
shikijs:mainfrom
CNSeniorious000:feat/stream-svelte-renderer

Conversation

@CNSeniorious000

@CNSeniorious000 CNSeniorious000 commented Jun 23, 2026

Copy link
Copy Markdown
Contributor
  • <- Keep this line and put an x between the brackts.

Description

The archived antfu/shiki-stream repo has moved into this monorepo as @shikijs/stream, and its recall-token contract needs renderers to keep already-final tokens stable while replacing only recalled suffixes.

This PR adds @shikijs/stream/svelte with a Svelte 5 ShikiStreamRenderer: token arrays are reassigned immutably with $state.raw, stream subscription stays inside $effect, and spans use a keyed {#each} block by token identity so stable token objects preserve their DOM nodes. The package build hook mirrors the existing @shikijs/magic-move Svelte mkdist shim.

The smoke test drives a controlled token stream through append, recall, replacement, and suffix updates, then asserts both node identity and outerHTML for already-rendered spans. Docs and playground wiring expose the new Svelte renderer next to the existing stream renderers.

Linked Issues

None.

Additional context

Validated with pnpm exec eslint packages/stream/src/svelte packages/stream/test/svelte-renderer.test.ts packages/stream/playground/src/renderer/svelte.ts packages/stream/vitest.config.ts, pnpm --filter @shikijs/stream exec vitest run test/svelte-renderer.test.ts --config vitest.config.ts --environment happy-dom --reporter verbose, pnpm --filter @shikijs/stream build, existing stream/export tests, pnpm -C packages/stream/playground build, and pnpm typecheck.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@netlify

netlify Bot commented Jun 23, 2026

Copy link
Copy Markdown

Deploy Preview for shiki-matsu ready!

Name Link
🔨 Latest commit 31de96c
🔍 Latest deploy log https://app.netlify.com/projects/shiki-matsu/deploys/6a3b5d99532e710008ab2e9a
😎 Deploy Preview https://deploy-preview-1291--shiki-matsu.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jun 23, 2026

Copy link
Copy Markdown

Deploy Preview for shiki-next ready!

Name Link
🔨 Latest commit 31de96c
🔍 Latest deploy log https://app.netlify.com/projects/shiki-next/deploys/6a3b5d999119510008fbed76
😎 Deploy Preview https://deploy-preview-1291--shiki-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Jun 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.62%. Comparing base (2bd0948) to head (31de96c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1291   +/-   ##
=======================================
  Coverage   89.62%   89.62%           
=======================================
  Files          79       79           
  Lines        3518     3518           
  Branches     1001      999    -2     
=======================================
  Hits         3153     3153           
  Misses        328      328           
  Partials       37       37           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@CNSeniorious000
CNSeniorious000 marked this pull request as draft June 23, 2026 17:39
@CNSeniorious000
CNSeniorious000 marked this pull request as ready for review June 23, 2026 19:03
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Comment thread packages/stream/playground/src/renderer/svelte.ts Outdated
@antfu
antfu merged commit 2d18a66 into shikijs:main Jun 24, 2026
15 checks passed
@CNSeniorious000
CNSeniorious000 deleted the feat/stream-svelte-renderer branch June 24, 2026 04:49
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.

3 participants