11import * as React from 'react'
22import { Link } from '@tanstack/react-router'
3- import {
4- ArrowRightIcon ,
5- CubeIcon ,
6- BracketsCurlyIcon ,
7- CheckIcon ,
8- GaugeIcon ,
9- StackIcon ,
10- PaletteIcon ,
11- ScanIcon ,
12- LightningIcon ,
13- } from '@phosphor-icons/react'
3+ import { ArrowRightIcon , CheckIcon } from '@phosphor-icons/react'
144
155import { LibraryWordmark } from '~/components/LibraryWordmark'
166import { getLibrary } from '~/libraries'
@@ -33,34 +23,34 @@ const bundleProfiles = [
3323 {
3424 name : 'core' ,
3525 detail : 'no languages' ,
36- size : '1.74 KB' ,
26+ size : '1.82 KB' ,
3727 width : 'w-[22%]' ,
3828 } ,
3929 {
4030 name : 'tsx' ,
4131 detail : 'core + TSX' ,
42- size : '3.86 KB' ,
43- width : 'w-[48 %]' ,
32+ size : '4.03 KB' ,
33+ width : 'w-[49 %]' ,
4434 } ,
4535 {
4636 name : 'docs' ,
4737 detail : '9 languages' ,
48- size : '5.83 KB' ,
49- width : 'w-[73 %]' ,
38+ size : '5.97 KB' ,
39+ width : 'w-[72 %]' ,
5040 } ,
5141 {
5242 name : 'all' ,
53- detail : '25 languages' ,
54- size : '7.96 KB' ,
43+ detail : '26 languages' ,
44+ size : '8.29 KB' ,
5545 width : 'w-full' ,
5646 } ,
5747]
5848
5949const languageGroups = [
6050 [ 'Web' , 'TS · TSX · JS · JSX · CSS · HTML' ] ,
61- [ 'Content' , 'Markdown · MDX · JSON · YAML ' ] ,
62- [ 'Shell' , 'Bash · Shell · PowerShell ' ] ,
63- [ 'Frameworks' , 'Vue · Svelte · Astro · EJS ' ] ,
51+ [ 'Content' , 'Markdown · JSON · YAML · TOML ' ] ,
52+ [ 'Shell' , 'Bash · Shell · Zsh ' ] ,
53+ [ 'Frameworks' , 'Vue · Svelte · EJS · TSRX (Octane) ' ] ,
6454]
6555
6656export default function HighlightLanding ( ) {
@@ -83,8 +73,6 @@ export default function HighlightLanding() {
8373 < LandingSection tone = "accent" >
8474 < div className = "grid items-center gap-12 lg:grid-cols-[0.7fr_1.3fr] lg:gap-16" >
8575 < LandingSectionIntro
86- eyebrow = "Selective assembly"
87- icon = { < CubeIcon aria-hidden = "true" size = { 15 } /> }
8876 title = "The registry is the bundle plan."
8977 body = "The core knows no languages. Direct imports make the site’s language set explicit and let the bundler discard everything else."
9078 />
@@ -95,19 +83,15 @@ export default function HighlightLanding() {
9583 < LandingSection tone = "ink" >
9684 < div className = "grid items-center gap-12 lg:grid-cols-[0.76fr_1.24fr] lg:gap-16" >
9785 < LandingSectionIntro
98- eyebrow = "Semantic output"
99- icon = { < PaletteIcon aria-hidden = "true" size = { 15 } /> }
10086 title = "Change the palette. Keep the markup."
10187 body = "Tokens carry stable semantic classes instead of theme colors. CSS variables recolor the same tree without a second highlighting pass."
10288 />
10389 < ThemeContract />
10490 </ div >
10591 < div className = "mt-12 grid items-center gap-12 border-t border-border-subtle pt-12 lg:grid-cols-[0.7fr_1.3fr] lg:gap-16" >
10692 < LandingSectionIntro
107- eyebrow = "Context-aware scanners"
108- icon = { < StackIcon aria-hidden = "true" size = { 15 } /> }
10993 title = "Web languages rarely stay in their lane."
110- body = "HTML, Vue, Svelte, EJS, Markdown, and JavaScript templates delegate embedded regions only when the nested language is registered."
94+ body = "HTML, Vue, Svelte, EJS, and Markdown delegate embedded regions only when the nested language is registered. JavaScript and TypeScript handle their own template interpolation ."
11195 />
11296 < div >
11397 < EmbeddedLanguageMap />
@@ -131,18 +115,14 @@ export default function HighlightLanding() {
131115 < div className = "grid items-center gap-12 lg:grid-cols-[1.2fr_0.8fr] lg:gap-16" >
132116 < AnnotationPanel />
133117 < LandingSectionIntro
134- eyebrow = "Presentation metadata"
135- icon = { < ScanIcon aria-hidden = "true" size = { 15 } /> }
136118 title = "Annotate the lesson, not the token stream."
137119 body = "Highlight lines, exact character ranges, insertions, deletions, focus, errors, and warnings without changing the source or tokenizer."
138120 />
139121 </ div >
140122 < div className = "mt-12 grid items-center gap-12 border-t border-border-subtle pt-12 lg:grid-cols-[0.7fr_1.3fr] lg:gap-16" >
141123 < LandingSectionIntro
142- eyebrow = "Corpus, not toys"
143- icon = { < GaugeIcon aria-hidden = "true" size = { 15 } /> }
144124 title = "Tuned against the docs it will render."
145- body = "The committed corpus samples 333 fixtures from 2,940 TanStack documentation files. Release checks cover fidelity, deterministic HTML, bundle profiles, and runtime throughput ."
125+ body = "Release checks cover source preservation, deterministic HTML, bundle sizes, and throughput across more than 10,000 code blocks, including numbered and decorated blocks ."
146126 />
147127 < BenchmarkTape />
148128 </ div >
@@ -151,8 +131,6 @@ export default function HighlightLanding() {
151131 < LandingSection tone = "accent" >
152132 < div className = "grid items-start gap-12 lg:grid-cols-[0.72fr_1.28fr] lg:gap-16" >
153133 < LandingSectionIntro
154- eyebrow = "Choose by job"
155- icon = { < LightningIcon aria-hidden = "true" size = { 15 } /> }
156134 title = "A docs highlighter is not an editor highlighter."
157135 body = "Highlight is optimized for known web languages and compact page output, not TextMate completeness, automatic detection, or incremental editor state."
158136 />
@@ -173,20 +151,15 @@ export default function HighlightLanding() {
173151 </ div >
174152 < div className = "mt-12 grid items-center gap-12 border-t border-border-subtle pt-12 lg:grid-cols-[1.08fr_0.92fr] lg:gap-16" >
175153 < LandingSectionIntro
176- eyebrow = "Explicit integrations"
177- icon = { < BracketsCurlyIcon aria-hidden = "true" size = { 15 } /> }
178154 title = "Drop it into Markdown without hiding the language set."
179- body = "Every renderer and adapter receives the highlighter you assembled; none imports every language behind your back ."
155+ body = "TanStack Markdown, Remark, Rehype, and Octane MDX adapters all take an explicit highlighter, so you control which languages ship ."
180156 />
181157 < Link
182158 to = "/markdown/$version"
183159 params = { { version : 'latest' } }
184160 className = "group rounded-xl border border-border-subtle bg-background-surface p-6 transition-colors hover:border-border-default focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--landing-accent-bright)]"
185161 >
186- < p className = "font-ds-mono text-ds-mono-caps uppercase text-[var(--landing-accent-bright)]" >
187- Natural companion
188- </ p >
189- < div className = "mt-4 text-ds-heading-4" >
162+ < div className = "text-ds-heading-4" >
190163 < LibraryWordmark library = { markdownLibrary } />
191164 </ div >
192165 < p className = "mt-3 text-ds-body-sm text-text-primary/55" >
@@ -219,7 +192,7 @@ function CodeLab({
219192 < div className = "library-landing-graphic min-w-0 overflow-hidden rounded-xl border border-[color:rgb(var(--landing-glow)/0.45)] bg-[#11151b] shadow-[0_24px_70px_-28px_rgb(var(--landing-glow)/0.45)]" >
220193 < div className = "flex flex-wrap items-center justify-between gap-3 border-b border-white/10 px-4 py-3" >
221194 < div className = "flex items-center gap-2 font-mono text-[11px] font-bold uppercase tracking-widest text-zinc-500" >
222- < span className = "h-2 w-2 rounded-full bg-fuchsia-400" /> live output
195+ example.tsx
223196 </ div >
224197 < div className = "flex border border-white/10 p-0.5 font-mono text-[10px] font-bold uppercase" >
225198 < button
@@ -261,12 +234,12 @@ function CodeLab({
261234 < Token color = "fuchsia" isLightTheme = { isLightTheme } >
262235 import
263236 </ Token > { ' ' }
264- { '{ tsx, css }' } { ' ' }
237+ { '{ tsx }' } { ' ' }
265238 < Token color = "fuchsia" isLightTheme = { isLightTheme } >
266239 from
267240 </ Token > { ' ' }
268241 < Token color = "green" isLightTheme = { isLightTheme } >
269- './ languages'
242+ '@tanstack/highlight/ languages/tsx '
270243 </ Token >
271244 </ CodeLine >
272245 < div className = "opacity-45" > 04</ div >
@@ -275,24 +248,24 @@ function CodeLab({
275248 const
276249 </ Token > { ' ' }
277250 < Token color = "amber" isLightTheme = { isLightTheme } >
278- highlight
251+ highlighter
279252 </ Token > { ' ' }
280253 ={ ' ' }
281254 < Token color = "cyan" isLightTheme = { isLightTheme } >
282255 createHighlighter
283256 </ Token >
284- ({ '{ languages: [tsx, css ] }' } )
257+ ({ '{ languages: [tsx] }' } )
285258 </ CodeLine >
286259 < div className = "opacity-45" > 06</ div >
287260 < CodeLine number = "07" isLightTheme = { isLightTheme } state = "insert" >
288261 < Token color = "blue" isLightTheme = { isLightTheme } >
289262 const
290263 </ Token > { ' ' }
291- html ={ ' ' }
264+ { '{ html }' } ={ ' ' }
292265 < Token color = "amber" isLightTheme = { isLightTheme } >
293- highlight
266+ highlighter
294267 </ Token >
295- (code , { '{' }
268+ .highlight('<Button />' , { '{' }
296269 </ CodeLine >
297270 < CodeLine number = "08" isLightTheme = { isLightTheme } state = "insert" >
298271 { ' ' } lang:{ ' ' }
@@ -302,7 +275,7 @@ function CodeLab({
302275 ,
303276 </ CodeLine >
304277 < CodeLine number = "09" isLightTheme = { isLightTheme } state = "insert" >
305- { ' ' } highlight: [2, 4, 5] ,
278+ { ' ' } lineNumbers: true ,
306279 </ CodeLine >
307280 < CodeLine number = "10" isLightTheme = { isLightTheme } state = "insert" >
308281 { '}' } )
@@ -386,8 +359,7 @@ function BundleDial() {
386359 return (
387360 < div className = "rounded-xl border border-border-subtle bg-background-surface p-5 sm:p-6" >
388361 < div className = "flex items-center justify-between gap-4 border-b border-border-subtle pb-3 font-ds-mono text-ds-mono-caps-xs uppercase text-text-primary/45" >
389- < span > gzip profile</ span >
390- < span > add only what is used →</ span >
362+ < span > 0.0.11 · gzip · KB = 1,000 bytes</ span >
391363 </ div >
392364 < div className = "mt-5 space-y-5" >
393365 { bundleProfiles . map ( ( profile ) => (
@@ -468,7 +440,7 @@ function EmbeddedLanguageMap() {
468440 < div className = "overflow-hidden rounded-xl border border-border-subtle bg-[#11151b] p-4 font-ds-mono text-ds-mono-xs text-zinc-300 sm:p-5" >
469441 < div className = "flex items-center justify-between border-b border-white/10 pb-3 text-[10px] font-bold uppercase tracking-widest text-zinc-500" >
470442 < span > component.vue</ span >
471- < span > registered: html · ts · css</ span >
443+ < span > registered: vue · js · ts · css</ span >
472444 </ div >
473445 < div className = "mt-4 space-y-2" >
474446 < LanguageBand
@@ -478,7 +450,7 @@ function EmbeddedLanguageMap() {
478450 <section class="result">
479451 </ LanguageBand >
480452 < LanguageBand
481- label = "Vue expression → TS "
453+ label = "Vue expression → JS "
482454 color = "border-fuchsia-400/50 bg-fuchsia-400/10 text-fuchsia-200"
483455 >
484456 { ' {{ score.toFixed(2) }}' }
@@ -534,7 +506,7 @@ function AnnotationPanel() {
534506 < div className = "overflow-hidden rounded-xl border border-border-subtle bg-[#11151b] font-ds-mono text-ds-mono-xs leading-7 sm:text-ds-mono-sm" >
535507 < div className = "flex items-center justify-between border-b border-white/10 px-4 py-3 text-[10px] font-bold uppercase tracking-widest text-zinc-500" >
536508 < span > cache.ts</ span >
537- < span > { '{2,4-5} ins=5 ' } </ span >
509+ < span > { '{2,4-5} ins={5} ' } </ span >
538510 </ div >
539511 < div className = "overflow-x-auto py-4 text-zinc-300" >
540512 < AnnotatedLine number = "1" > const cache = new Map()</ AnnotatedLine >
@@ -583,38 +555,38 @@ function BenchmarkTape() {
583555 return (
584556 < div className = "overflow-hidden rounded-xl border border-border-subtle bg-background-surface" >
585557 < div className = "grid grid-cols-[1fr_auto_auto] gap-4 border-b border-border-subtle px-4 py-3 font-ds-mono text-ds-mono-caps-xs uppercase text-text-primary/45" >
586- < span > TanStack docs corpus </ span >
587- < span > time</ span >
558+ < span > 334 docs fixtures </ span >
559+ < span > warmed time</ span >
588560 < span > HTML</ span >
589561 </ div >
590562 < BenchmarkRow
591563 name = "TanStack Highlight"
592- time = "20 ms"
593- output = "364 KiB"
564+ time = "4.6 ms"
565+ output = "365 KiB"
594566 emphasis
595567 />
596568 < BenchmarkRow
597- name = "Shiki"
598- time = "~1.2 s "
599- output = "1,252 KiB"
569+ name = "Shiki 4.3.1 "
570+ time = "182 ms "
571+ output = "1,257 KiB"
600572 emphasis = { false }
601573 />
602- < div className = "grid gap-3 border-t border-border-subtle bg-background-subtle px-4 py-4 font-ds-mono text-ds-mono-xs text-text-primary/55 sm:grid-cols-3" >
603- < span >
604- < strong className = "text-text-primary" > 2,940</ strong > docs files
605- scanned
606- </ span >
607- < span >
608- < strong className = "text-text-primary" > 333</ strong > committed fixtures
609- </ span >
610- < span >
611- < strong className = "text-text-primary" > 10,000+</ strong > blocks per gate
612- </ span >
613- </ div >
614574 < p className = "border-t border-border-subtle px-4 py-3 text-ds-body-xs text-text-primary/45" >
615- Project benchmark report. This measures the tested corpus and output
616- shape, not equivalent grammar accuracy; Shiki targets deeper TextMate
617- fidelity.
575+ Local measurements from the{ ' ' }
576+ < Link
577+ to = "/$libraryId/$version/docs/$"
578+ params = { {
579+ libraryId : 'highlight' ,
580+ version : 'latest' ,
581+ _splat : 'comparison' ,
582+ } }
583+ className = "underline"
584+ >
585+ project benchmark report
586+ </ Link >
587+ . Shiki initialization and language loading are measured separately;
588+ EJS, ENV, and TSRX use its plaintext fallback. Timings vary by machine,
589+ and the tools don’t provide equivalent grammar accuracy.
618590 </ p >
619591 </ div >
620592 )
0 commit comments