feat(stream): add svelte renderer#1291
Merged
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
✅ Deploy Preview for shiki-matsu ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for shiki-next ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
CNSeniorious000
marked this pull request as draft
June 23, 2026 17:39
Trim the repeated first-span identity assertions, document the flush helper, and add cases for mid-stream unmount and source errors.
CNSeniorious000
marked this pull request as ready for review
June 23, 2026 19:03
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
antfu
reviewed
Jun 24, 2026
antfu
approved these changes
Jun 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
xbetween 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/sveltewith a Svelte 5ShikiStreamRenderer: 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-moveSvelte mkdist shim.The smoke test drives a controlled token stream through append, recall, replacement, and suffix updates, then asserts both node identity and
outerHTMLfor 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, andpnpm typecheck.