unstale

npm / shiki

shiki

What changed in shiki 3 to 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-17.

3 breaking20 new APIs and options5 performance8 behavior and defaults35 fixes and other

shiki 429 changes

Breaking changes 2

  • Deprecated APIs were removed and are no longer available to developers.

    4.0.0release notes

  • Node v18 support was dropped, so developers must use a newer Node.js version.

    4.0.0release notes

New APIs and options 7

  • Adds classActiveCode to control the active-code class produced by word highlighting.

    4.5.0release notes

  • Adds a transformer for rendering line numbers.

    4.5.0release notes

  • Adds a type field to ThemedToken.

    4.3.1release notes

  • Added a Svelte renderer for stream output, enabling Shiki stream rendering in Svelte applications.

    4.3.0release notes

  • Adds the @shikijs/magic-move package for Magic Move functionality.

    4.2.0release notes

  • Adds the @shikijs/stream package for stream-based Shiki usage.

    4.2.0release notes

  • A new package, @shikijs/markdown-exit, is available for developers to use.

    4.0.0release notes

Performance 4

  • The React renderer groups tokens by line for more efficient rendering.

    4.5.0release notes

  • Tokenization reuses each regular expression's last search while processing a line.

    4.5.0release notes

  • Token split performance improvements make tokenization faster for developers using Shiki.

    4.4.2release notes

  • The @shikijs/primitive package became leaner, changing the package developers use in their projects.

    4.0.0release notes

Behavior and default changes 2

  • codeToANSI now emits an explicit color level.

    4.5.0release notes

  • Grammars and themes were updated, affecting syntax highlighting behavior and appearance.

    4.4.0release notes

Fixes and other changes 14

  • Twoslash avoids crashing when @errors nodes occur past end of file.

    4.5.0release notes

  • Repeated language loads no longer duplicate grammar injections.

    4.5.0release notes

  • The CLI falls back to text when a file or URL has no extension and no language option.

    4.5.0release notes

  • Wasm memory is disposed for lazily embedded languages.

    4.5.0release notes

  • Notations are preserved on content comment lines.

    4.5.0release notes

  • The rose-pine theme now handles split # and -- comments.

    4.5.0release notes

  • The CLI falls back to plaintext for unknown languages.

    4.5.0release notes

  • Twoslash tooltips now appear after a 200ms delay.

    4.4.3release notes

  • YAML is now guessed from frontmatter segments, improving language detection for those segments.

    4.4.0release notes

  • Correctly handles YAML comment prefixes for v3.

    4.2.0release notes

  • Fixes scroll blocking on mobile viewports.

    3.21.0, 4.2.0release notesrelease notes

  • tsModule is now forwarded to createTwoslasher, ensuring the configured TypeScript module reaches the twoslash implementation.

    4.1.0release notes

  • ANSI language now works with multiple themes.

    4.0.2release notes

  • Fixed the declaration bundle, which may improve the type information available to developers using shiki.

    4.0.1release notes

shiki 342 changes

Breaking changes 1

  • The highlighter factory is renamed from createdBundledHighlighter to createBundledHighlighter.

    3.17.0release notes

New APIs and options 13

  • Code annotations can now use [!code info] notation.

    3.23.0release notes

  • The CLI now provides list commands.

    3.23.0release notes

  • The CLI can now accept input from standard input.

    3.23.0release notes

  • transformerRenderWhitespace now supports the leading position.

    3.23.0release notes

  • Adds a format option for HTML output.

    3.20.0release notes

  • Adds classActiveCode to notation transformers for customizing active code classes.

    3.19.0release notes

  • Adds a context parameter to the twoslash filter option.

    3.19.0release notes

  • Adds a rootStyle option that can be set to false.

    3.19.0release notes

  • Adds a transformer for removing comments from transformed code.

    3.19.0release notes

  • Supports the zeroIndexed option for transformerMetaHighlight.

    3.18.0release notes

  • The embeddedLanguages alias is supported for backwards compatibility.

    3.17.0release notes

  • The CLI supports passing a remote file URL for processing.

    3.17.0release notes

  • Indent guides now support the meta.indent field.

    3.15.0release notes

Performance 1

  • Eliminates a redundant tokenization call, improving tokenization efficiency.

    3.20.0release notes

Behavior and default changes 6

  • Grammar and themes were updated, potentially changing syntax highlighting output.

    3.22.0release notesrelease notes

  • codeToHast now preserves HAST data and properties.

    3.21.0release notes

  • Grammar was updated, potentially changing syntax highlighting behavior.

    3.21.0release notes

  • Monaco theme tokenScopes are normalized, with tighter Monaco type imports.

    3.17.0release notes

  • Grammars were updated, which may change syntax highlighting behavior.

    3.16.0release notes

  • Grammars and themes were updated, potentially changing syntax highlighting output.

    3.14.0release notes

Fixes and other changes 21

  • Top-level declarations in .d.ts files now receive the declare modifier.

    3.23.0release notes

  • CLI language and extension inputs are normalized for casing.

    3.23.0release notes

  • Promise rejections during lazy language loading are now handled.

    3.20.0release notes

  • Popper positions are no longer recomputed too early within VitePress code groups.

    3.20.0release notes

  • Registry dependency checks now account for embeddedLanguages.

    3.19.0release notes

  • Monaco now correctly handles sparse color map updates.

    3.19.0release notes

  • Adds typesVersions to support legacy module resolution.

    3.19.0release notes

  • langAlias can now be used with special languages.

    3.18.0release notes

  • dimColor now correctly parses 4-digit hex colors.

    3.17.1release notes

  • String utilities now handle edge cases more robustly.

    3.17.1release notes

  • The Monaco integration now updates its color map correctly when themes switch.

    3.17.1release notes

  • Markdown font styles are preserved in Monaco output.

    3.17.0release notes

  • The PlainTextLanguage type now includes plain as a valid language.

    3.17.0release notes

  • The rose-pine theme correctly handles multi-token comments.

    3.17.0release notes

  • A typo in twoslash-query-persisted is fixed.

    3.17.0release notes

  • Decorations are enabled for inline structures.

    3.16.0release notes

  • The matcher now supports comment-prefixed [code . highlight] markers.

    3.16.0release notes

  • Missing theme ANSI colors now fall back instead of remaining unavailable.

    3.15.0release notes

  • A singleton highlighter can now recover after an invalid language error.

    3.15.0release notes

  • Dragging no longer triggers popper show or hide behavior.

    3.15.0release notes

  • The default color now works correctly with colorized-brackets.

    3.14.0release notes