unstale

npm / shiki

shiki

What changed in shiki 1 to 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.

26 breaking2 deprecations50 new APIs and options7 performance15 behavior and defaults1 tooling47 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

shiki 436 changes

Breaking changes 2

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

    3.0.0, 4.0.0release notesrelease 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 6

  • Rendering many decorations now takes linear time.

    4.6.0release notes

  • The Wasm binary is gzip-compressed and loaded asynchronously.

    4.6.0release notes

  • 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 19

  • The rehype integration avoids cache key collisions between code blocks.

    4.6.0release notes

  • The vitepress-twoslash drag guard continues to work with floating-vue 5.4.

    4.6.0release notes

  • Injections loaded after their target grammar are now applied.

    4.6.0release notes

  • Single-theme inline token styles are now also converted to classes.

    4.6.0release notes

  • Tokenizer offsets and CRLF handling now align with codeToTokens.

    4.6.0release notes

  • 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 347 changes

Breaking changes 3

  • The highlighter factory is renamed from createdBundledHighlighter to createBundledHighlighter.

    3.17.0release notes

  • The default twoslash moduleResolution changed to bundler.

    3.0.0release notes

  • TypeScript resolution support for node10 was removed.

    3.0.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 24

  • 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

  • Transformers now support matching comments in comments.

    3.0.0release notes

  • Transformers also remove the extra newline token.

    3.0.0release notes

  • Matching indices for word-highlight were fixed.

    3.0.0release notes

shiki 214 changes

Breaking changes 8

  • The function now requires a single object-style argument.

    2.0.0upgrade guide

  • createHighlighterCore now requires an engine field, replacing the loadWasm field.

    2.0.0upgrade guide

  • Import FontStyle from @shikijs/vscode-textmate instead of @shikijs/core.

    2.0.0upgrade guide

  • The loadWasm field in createHighlighterCore is replaced with the engine field; WASM engine imports are available from dedicated engine paths.

    2.0.0upgrade guide

  • Import loadWasm and createOnigurumaEngine from the engine-specific path instead of the main package or @shikijs/core.

    2.0.0upgrade guide

  • The regex engine APIs are no longer included; import them from their engine packages instead.

    2.0.0upgrade guide

  • The WASM inline import path is replaced by @shikijs/engine-oniguruma/wasm-inline.

    2.0.0upgrade guide

  • Import StackElementMetadata from @shikijs/vscode-textmate instead of @shikijs/core.

    2.0.0upgrade guide

Deprecations 2

  • The API is deprecated in favor of createHighlighter, a naming correction with no functional change.

    2.0.0upgrade guide

  • The compatibility package for v0.14 is deprecated; migrate to the main package before it is removed in v3.0.

    2.0.0upgrade guide

New APIs and options 1

  • The JavaScript engine is re-exported from an engine-specific import path.

    2.0.0upgrade guide

Behavior and default changes 2

  • Shiki now emits runtime warnings for deprecated APIs by default, helping developers prepare for their removal in v3.0.

    2.0.0upgrade guide

  • The option lets transformer users choose the matching algorithm; its default is planned to change from v1 to v3 in v3.0.0, so set it explicitly to avoid a future breaking change.

    2.0.0upgrade guide

Tooling 1

  • Run the community codemod to automate most API changes when migrating from v1 to v2.

    2.0.0upgrade guide

shiki 151 changes

Breaking changes 13

  • Unifies codeToHtmlThemes with codeToHtml, using hast.

    1.0.0release notes

  • Renames codeToHtmlDualThemes and is then unified into codeToHtml.

    1.0.0release notes

  • The options accepted by codeToThemedTokens change.

    1.0.0release notes

  • Replaces the codeToThemedTokens API.

    1.0.0release notes

  • Default themes and languages are no longer included.

    1.0.0release notes

  • The hastTransform hook is reworked as transforms.

    1.0.0release notes

  • The deprecated highlightLines option is disabled in the rehype and markdown-it integrations.

    1.0.0release notes

  • Language registration is flattened, and the languages/ path is shortened to langs/.

    1.0.0release notes

  • The highlightLines option is deprecated and disabled.

    1.0.0release notes

  • Renames the renderer hook nodeCompletions to nodeCompletion.

    1.0.0release notes

  • The highlightLines option is deprecated and disabled.

    1.0.0release notes

  • Renderers are removed.

    1.0.0release notes

  • The transformer hook is renamed to span.

    1.0.0release notes

New APIs and options 29

  • Adds addClassToHast to transformer context.

    1.0.0release notes

  • The compat package supports ansiToThemedTokens.

    1.0.0release notes

  • The TwoSlash transformer supports configuring its cache option.

    1.0.0release notes

  • Adds codeToHast as a utility in transformer context.

    1.0.0release notes

  • Adds an API for converting code to tokens.

    1.0.0release notes

  • Supports passing includeExplanation.

    1.0.0release notes

  • Theme objects support arbitrary color values and a colorReplacements field.

    1.0.0release notes

  • Introduces an API for decorating highlighted code, applying full-line decorations when possible.

    1.0.0release notes

  • VitePress supports a custom explicitTrigger.

    1.0.0release notes

  • The compat package supports getBackgroundColor.

    1.0.0release notes

  • The compat package supports getForegroundColor.

    1.0.0release notes

  • Supports grammar injection.

    1.0.0release notes

  • The highlighter can be initialized without themes or languages.

    1.0.0release notes

  • Adds lang to HtmlRendererOptions.

    1.0.0release notes

  • Language aliases are supported.

    1.0.0release notes

  • Language aliases are supported.

    1.0.0release notes

  • The compat API supports loading a theme from disk.

    1.0.0release notes

  • Adds a mergeWhitespaces option for HTML and supports the value never for themes that do not handle whitespace perfectly.

    1.0.0release notes

  • Languages can be loaded multiple at once.

    1.0.0release notes

  • Adds a special none theme.

    1.0.0release notes

  • Themed tokens now provide offset information.

    1.0.0release notes

  • Adds preprocess and postprocess hooks to transformers; preprocess is also called in codeToHast.

    1.0.0release notes

  • Adds an onError option.

    1.0.0release notes

  • Supports a custom parseMetaString function.

    1.0.0release notes

  • The render-whitespace transformer supports a position option.

    1.0.0release notes

  • Adds a tokens hook to transformers.

    1.0.0release notes

  • Exports tokensToHast.

    1.0.0release notes

  • Introduces a transformer for metadata-based highlighting.

    1.0.0release notes

  • Adds two transformers for word highlighting, including highlighting across multiple tokens.

    1.0.0release notes

Behavior and default changes 5

  • Its return type is improved.

    1.0.0release notes

  • Twoslash adds completion on string quotes and literals, and on multifile input.

    1.0.0release notes

  • Twoslash completion supports multifile input.

    1.0.0release notes

  • Shiki no longer depends on the filesystem and works across Node.js, browsers, and other modern runtimes.

    1.0.0release notes

  • Provides full ESM support and no longer needs static assets or CDN settings.

    1.0.0release notes

Fixes and other changes 4