@shikijs/transformers
4.6.0 · 2 Nov 2026MIT8.4M / weekRepositoryHomepagenpmAtom feed
1.29.2 is the newest release of 1.x.
In short
20 breaking1 deprecated102 new5 faster69 fixed3 internal
- Breaking
Flat lang registration
- Breaking
Shorten
languages/tolangs/ - Breaking
Change
codeToThemedTokensoptions - Breaking
Rename
codeToHtmlDualThemestocodeToHtmlThemes - Breaking
Use hast, unify
codeToHtmlThemestocodeToHtml - Breaking
Rework
hastTransformtotransforms - Breaking
Improve return type of
codeToTokensWithThemes, close #37 - Breaking
Add
unwasmcondition in exports
Release note
Shiki v1.0 is a major rewrite that solves most of the long-lasting issues. Previously known as Shikiji, now it's merged back to Shiki.
Notable Highlights
Full ESM support, no static assets or CDN settings are needed anymore
No filesystem dependencies, platform agnostic, works for Node.js, browsers, and any other modern runtime out-of-box.
Dual themes built-in, to support Light/Dark modes efficiently
Transformers & Decorations API, maximize the customizability
Official rehype and markdown-it plugin
TwoSlash integration is now a Shiki transformer instead of a wrapper
More themes and better language support. Maintained as a standalone repo: github.com/shikijs/textmate-grammars-themes
New docs: shiki.style
Generated Changelog
Breaking Changes
- Breaking
Flat lang registration
- Breaking
Shorten
languages/tolangs/ - Breaking
Change
codeToThemedTokensoptions - Breaking
Rename
codeToHtmlDualThemestocodeToHtmlThemes - Breaking
Use hast, unify
codeToHtmlThemestocodeToHtml - Breaking
Rework
hastTransformtotransforms - Breaking
Improve return type of
codeToTokensWithThemes, close #37 - Breaking
Add
unwasmcondition in exports - Breaking
Remove deprecated APIs
- Breaking
Consistent case of
Twoslash - Breaking
Rename to shiki
- Breaking
Remove renderers
- Breaking
Merge Shikiji back into Shiki for v1.0
- Breaking
Remove all deprecated APIs
- Breaking
Refactor internal context
- Breaking
core: Rename transformer hook
tokentospanto avoid confusion - Deprecated
markdown-it: Deprecate and disable
highlightLinesoption - Deprecated
rehype: Deprecate and disable
highlightLinesoption - Breaking
twoslash: Improve rich renderer
- Breaking
twoslash: Move to
twoslashpackage for better performance and composablity - Breaking
twoslash: Rename renderer hook
nodeCompletionstonodeCompletion - Breaking
twoslash: Support highlight
Features
Rewrite from shiki
Types for each export
Improve types
Auto module
defaultresolutionImprove module resolution
Bundle include embedded languages
Provide singleton shorthands
Add
codeToHtmlDualThemesSupport multiple themes for
renderToHtmlDualThemesSupport no default color for dual themes, #6
Add
codeToTokensWithThemes, fix #7Port back ansi support
Add rehype and markdown-it plugins
Wip
shikiji-compactpackageSupport passing raw theme object on generation
Improve compatibility
Improve compat
Support font-style for multiples themes
Support lang on the meta
Treat
plainas plain text, close #24Support multiple transformers
Introduce transformers package
Add
preprocessandpostprocesshooks to transformerSupport lang alias
Introduce twoslash transformer
Expose more utils
Additional
codeToHastutil in transformer contextAdjust css
New
shikiji-corepackage, improve bundlingIntroduce
shikiji-monacopackageProvide more info for languages and themes
Support grammar injection
Change source from shiki to
tm-grammarsandtm-themesIntroduce web bundle
Introduce lazy embedded, more efficient bundle
Call
preprocesshook incodeToHastIntroduce
shikiji-cliSupport arbitrary colors value in theme, support
colorReplacementsfieldSupport
mergeWhitespaces: neverfor themes are not handling perfectlyUpdate deps, a few new themes
Improve wasm support
Also support wasm import module
Support also passing promises to
loadWasmSupport angular
Introduce
vitepress-plugin-twoslashSupport
unwasmcondition for coreSupport configure
cacheoption for twoslash transformerUpgrade to twoslash v0.1.0
Add a special
nonethemeSupport ansi background color, fix #432
Add fortran support
Export
tokensToHastSupport passing
includeExplanation, close #568Add
codeToTokensAPI, renamecodeToThemedTokenstocodeToTokensBaseAdd
addClassToHastto transformer contextIntroduce Decorations API
Apply full line decoration when possible
compat: Support
lineOptionscore: Provide
offsetinfo in themed tokencore: Introduce
tokenshook to transformershtml: Add
mergeWhitespacesoption, thanks to @dominikgmarkdown-it: Support fine-grain usage
rehype: Custom
parseMetaStringrehype: Support fine-grain integration, close #64
rehype: Add onError option, close #64
rehype-shikiji: Add language class to code element
rehype-shikiji: Add custom cache option
rehype-shikiji: Support metastring from node.properties
transformers: Nations support range
transformers:
render-whitepsacesupportpositionoptiontransformers: Introduce
transformerMetaHighlighttransformertransformers: Two new transformers for word highlighting
transformers: Support word highlighting across multiple tokens
transforms: Add line node element to
tokentransformertwoslash: Support custom renderer
twoslash: Support passing explicit trigger in markdown-it and rehype integration
twoslash: Expose core module, independent from twoslash
twoslash: Expose
twoslasheroption to be overridetwoslash: Add
classExtrato rich renderertwoslash: Allow provide custom trigger
twoslash: Allow lossy custom twoslash implementation
twoslash: Support
errorRenderingto render error in hover styletwoslash: Support extend
popupErrortwoslash: Wrap tokens in a single span for errors
twoslash/rich: Improve styling
twoslash/rich: Renders jsdoc
twoslash/rich: Support overriding
langtwoslash/rich: Support
processHoverInfoandprocessHoverDocshookvitepress: Make classes configurable
vitepress: Improve jsdocs handling
vitepress: Support errorRendering hover
vitepress-twoslash: Support floating-vue for completions
vitepress-twoslash: Support rendering jsdoc tags
Bug Fixes
Oniguruma options
Make cf working
Rename APIs
Add type export
.d.mtsfor allAllow loading multiple langs at once
Subpackages dts in node10
Support language alias
Types
Langs subpackage dts in node10
Do not include any default themes/languages
Improve type exchangeability
Allow to init the highlighter without themes and langs
Remove empty style
Add lang to HtmlRendererOptions
Improve transformers
Improve types
Improve types in
ThemeRegistrationLoad all embedded langs with markdown
Improve
ThemeRegistrationtype, close #63Avoid merge style when visible styles are applied, close #65
Improve css variable handling for background
MergeWhitespaceTokens offset calculation
Improve error handling
Update grammar registry, fix html in markdown highlighting
Stricter types
SplitLines extra new lines, fix #576
compact: Improve types export
compat: Improve
codeToHtmltypecompat: Support
loadThemefrom diskcompat: Support
ansiToThemedTokenscompat: Support
getBackgroundColorandgetForegroundColorcompat: Do not re-export enum
core: GetHighlighter type inference, close #50
core: Dts naming conflicts
core: Sub export types, fix #566
dual-theme: Respect users' explicit options
markdown-it: Prepend builtin transformers, close #40
markdown-it: Improve types compactible with legacy resolution, close #44
monaco: Convert tmTheme to monacoTheme
rehype-shikiji: Lazily initialize promise
transformers: Improve
RenderWhitespacehandlingtransformers: Make transformers works well together
transformers: Improve
boundarymode of rendering spacestransformers: Word highlight support any symbol, fix #110
twoslash: Fix popover offset calculation
twoslash: Avoid deps on typescript runtime
twoslash: Should not throw when
throws: truetwoslash: Split tokens to match the twoslash nodes
twoslash: Support targeting multiple tokens a node, more accurate result
twoslash: Avoid genreate duplicate hovers
twoslash: Respect twoslash output lang
twoslash: Completion on string quotes and literals
twoslash: Completion on multifile
twoslash: Adjust styles
twoslash: Split tokens on completion
twoslash: Improve css variables definition
twoslash: Improve types
twoslash/rich: Improve default css style
types: Allways allow
textlangvitepress: Improve class handing, reduce html payload size
vitepress: Css style
vitepress: Fix types
vitepress: Support custom explicitTrigger
vitepress-plugin-twoslash: Improve tooltip experience
vitepress-plugin-twoslash: Disable triggers for presistented popover
vitepress-plugin-twoslash: Fix floating jump
vitepress-twoslash: Separate CSS deps, close #86
vitepress-twoslash: Popup arrow color
vitepress-twoslash: Escape Vue syntax
vitepress-twoslash: Improve tabs experience
vitepress-twoslash: Fix class override
Performance
Optimize internal logic
Cleanup unused attribute in themes and langs
Skip
setThemeif theme hasn't changedcli: Use Promise.all
vitepress: Add v-pre to docs
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.