1import{g,P,B,f,ue,L,pe,J,me,S,a,I,T,r,s,i,qe,o,e,t,n,ut,Z,Ke,Ge,q,pt,y,E,mt}from"./chunk-e7xk0yn7.js";import{N,ct}from"./chunk-as3fpxpb.js";import{O,F,dt}from"./chunk-sk34g2c4.js";var Yr=B(function(co,Wr){var da='server-only module "./bunInRust" was used in the browser bundle',xt=function(){throw Error(da)};Wr.exports=new Proxy(xt,{get:function(l,d){return d==="__esModule"?!0:d==="then"?void 0:new Proxy(xt,this)},apply:xt,construct:xt})});i();var ca="mono rounded bg-subtle px-1 py-px text-[0.86em]";function ce({headings:l,className:d}){let[m,k]=s(null),v=r(!1);a(()=>{let u=l.map((Y)=>document.getElementById(Y.id)).filter((Y)=>!!Y);if(u.length===0)return;let C=()=>{if(v.current)return;let Y=120,M=null;for(let V of u)if(V.getBoundingClientRect().top-Y<=0)M=V.id;else break;k(M??u[0].id)};C();let W=0,ee=()=>{cancelAnimationFrame(W),W=requestAnimationFrame(C)};return window.addEventListener("scroll",ee,{passive:!0}),()=>window.removeEventListener("scroll",ee)},[l]);let R=r(null);a(()=>{if(!m||!R.current)return;let u=R.current.querySelector(`[data-heading-id="${CSS.escape(m)}"]`);if(!u)return;let C=R.current,W=u.offsetTop-C.offsetTop;if(W<C.scrollTop+24||W>C.scrollTop+C.clientHeight-48)C.scrollTo({top:W-C.clientHeight/3,behavior:"smooth"})},[m]);let H=l.reduce((u,C)=>{if(C.level===2||u.length===0)u.push({parent:C,children:[]});else u[u.length-1].children.push(C);return u},[]),j=(u)=>{k(u),v.current=!0,setTimeout(()=>v.current=!1,900)},x=(u,C)=>e("a",{href:`#${u.id}`,"data-heading-id":u.id,onClick:()=>j(u.id),className:n("relative -ml-px block border-l py-1 text-[13px] leading-snug transition-colors",C===0?"pl-4":"pl-7",m===u.id?"border-accent text-fg":"border-transparent text-fg-faint hover:border-line-strong hover:text-fg-muted"),children:e(N,{content:u.content,codeClassName:ca})});if(l.length<2)return null;return t("nav",{"aria-label":"On this page",className:d,children:[e("p",{className:"mono mb-3 text-[11px] font-medium uppercase tracking-[0.14em] text-fg-faint",children:"On this page"}),e("ul",{id:"toc-container",ref:R,className:"max-h-[calc(100vh-11rem)] overflow-y-auto border-l border-line scroll-none",children:H.map(({parent:u,children:C})=>t("li",{children:[x(u,0),C.length>0&&e("ul",{children:C.map((W)=>e("li",{children:x(W,1)},W.id))})]},u.id))})]})}i();var h={};f(h,{Avoid:()=>Qs,BackpressureTank:()=>Br,BarrelPrune:()=>Mr,BinaryShrink:()=>_r,BunDevServerTerminal:()=>Zs,BunReplDemo:()=>Lr,BunRunParallelDemo:()=>Sr,Callout:()=>zs,ChangedGraph:()=>Hr,Code:()=>Js,CodeTabs:()=>Ks,DepsVanish:()=>Rr,Details:()=>Oe,Expandable:()=>qt,Fence:()=>Fs,Image:()=>Ws,ImagePipeline:()=>Ar,JscBumpReplay:()=>jr,LazyVideo:()=>Dt,Link:()=>Ys,ListItem:()=>Us,NodeCompatBoard:()=>Ir,Note:()=>ra,Paragraph:()=>Fe,Prefer:()=>eo,Raw:()=>Gs,ServerHtml:()=>De,Since:()=>to,StringWidthRuler:()=>Pr,Table:()=>Ve,TestParallelLanes:()=>$r,WebViewFilmstrip:()=>Cr});i();var Or={};f(Or,{renderReactNodeToInnerText:()=>Q});function Q(l){if(l===null||l===void 0||typeof l==="boolean")return"";if(typeof l==="string"||typeof l==="number")return String(l);if(Array.isArray(l))return l.map(Q).join("");if(me(l)){let{children:d}=l.props;return Q(d)}return""}g(h,P(Yr()));var Zn={};f(Zn,{BackpressureTank:()=>Br,BarrelPrune:()=>Mr,BinaryShrink:()=>_r,BunReplDemo:()=>Lr,BunRunParallelDemo:()=>Sr,ChangedGraph:()=>Hr,DepsVanish:()=>Rr,ImagePipeline:()=>Ar,JscBumpReplay:()=>jr,NodeCompatBoard:()=>Ir,StringWidthRuler:()=>Pr,TestParallelLanes:()=>$r,WebViewFilmstrip:()=>Cr});i();var Vr=["text-pink-700 dark:text-pink-400","text-sky-700 dark:text-sky-400","text-amber-700 dark:text-amber-400","text-emerald-700 dark:text-emerald-400","text-violet-700 dark:text-violet-400","text-rose-700 dark:text-rose-400"];function gt(l){let{command:d,lines:m,rows:k=16,speed:v=1}=l,[R,H]=y(),[j,x]=s(-1),u=r([]),C=typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;function W(){if(u.current.forEach(clearTimeout),u.current=[],C){x(m.length);return}x(0),m.forEach((M,V)=>{u.current.push(setTimeout(()=>x((K)=>Math.max(K,V+1)),M.t/v))})}a(()=>{if(!H)return;return W(),()=>u.current.forEach(clearTimeout)},[H]);let ee=new Map;for(let M of m)if(M.prefix&&!ee.has(M.prefix))ee.set(M.prefix,Vr[ee.size%Vr.length]);let Y=j<0?void 0:j<m.length?"playing":"done";return t("div",{ref:R,className:`term-replay group not-prose relative my-6 overflow-hidden rounded-xl border border-line bg-code-bg font-mono text-[13px] leading-[1.5] text-fg dark:border-neutral-800 dark:bg-[#0d0d0d] dark:text-neutral-200 ${l.className??""}`,"data-state":Y,children:[t("div",{className:"flex items-center gap-2 border-b border-line bg-subtle px-4 py-2 text-fg-muted dark:border-neutral-800 dark:bg-neutral-900/60 dark:text-neutral-400",children:[e("span",{className:"text-accent-strong dark:text-pink-400",children:"â¯"}),e("span",{className:"text-fg dark:text-neutral-300",children:d}),e("button",{type:"button",onClick:W,className:"ml-auto rounded border border-line px-2 py-0.5 text-xs text-fg-muted transition hover:border-line-strong hover:text-fg dark:border-neutral-700 dark:text-neutral-400 dark:hover:border-neutral-700 dark:hover:bg-neutral-800 dark:hover:text-neutral-100","aria-label":"Replay",children:"â» replay"})]}),e("div",{className:"px-4 py-3",style:{minHeight:`${k*1.5+1}em`},children:m.map((M,V)=>t("div",{className:`term-line whitespace-pre${j<0||V<j?" term-shown":""}`,children:[M.prefix&&t("span",{className:`${ee.get(M.prefix)} pr-1`,children:[M.prefix.padEnd(14),"|"]})," ",e("span",{className:M.cls,children:M.text})]},V))})]})}i();var he=[{pkg:"sharp",api:"Bun.Image",note:"image processing"},{pkg:"puppeteer",api:"Bun.WebView",note:"headless browser"},{pkg:"marked",api:"Bun.markdown",note:"markdown rendering"},{pkg:"node-cron",api:"Bun.cron",note:"scheduled jobs"},{pkg:"node-pty",api:"Bun.Terminal",note:"native PTY"},{pkg:"concurrently",api:"bun run --parallel",note:"parallel scripts"},{pkg:"npm-run-all",api:"bun run --parallel",note:"parallel scripts"},{pkg:"serve-static",api:"Bun.serve routes",note:"static files"},{pkg:"json5",api:"Bun.JSON5",note:"JSON5 parsing"},{pkg:"fast-xml-parser",api:"Bun.XML",note:"XML parsing"},{pkg:"tar",api:"Bun.Archive",note:"tarballs"}
1,{pkg:"string-width",api:"Bun.stringWidth",note:"terminal columns"},{pkg:"slice-ansi",api:"Bun.sliceAnsi",note:"ANSI-aware slicing"},{pkg:"cli-truncate",api:"Bun.sliceAnsi",note:"ANSI-aware truncation"},{pkg:"wrap-ansi",api:"Bun.wrapAnsi",note:"ANSI-aware wrapping"}],nt=30,zr=260,Gr="rgb(var(--c-fg-faint))",Xr="#6b7280",pa=` 2.dv-pkg { color: var(--dv-l, inherit); } 3@media (prefers-color-scheme: dark) { .dv-pkg { color: var(--dv-d, inherit); } } 4`,ht="â¼ playingâ¦",Ft="â» replay",Kr="â¶ play",ua=[Kr,Ft,ht];function Ot(){let[l,d]=s(he.length),[m,k]=s(Kr),[v,R]=y(),H=r(null),j=r([]),x=r(!1),u=r(!1),C=(b,A)=>{j.current.push(setTimeout(A,b))},W=()=>{for(let b of j.current)clearTimeout(b);j.current=[]},ee=(b)=>H.current?Array.from(H.current.querySelectorAll(b)):[];function Y(b){let A=ee(`.dv-pkg[data-i="${b}"]`)[0],te=ee(`.dv-bar[data-i="${b}"]`)[0],re=ee(`.dv-api[data-i="${b}"]`)[0];if(A)A.style.opacity="1",A.style.removeProperty("--dv-l"),A.style.removeProperty("--dv-d");if(te)te.style.transform="scaleX(0)";if(re)re.style.opacity="0",re.style.transform="translateX(-6px)"}function M(b){let A=ee(`.dv-pkg[data-i="${b}"]`)[0],te=ee(`.dv-bar[data-i="${b}"]`)[0],re=ee(`.dv-api[data-i="${b}"]`)[0];if(te)te.style.transform="scaleX(1)";if(A)A.style.opacity="0.3",A.style.setProperty("--dv-l",Gr),A.style.setProperty("--dv-d",Xr);if(re)re.style.opacity="1",re.style.transform="translateX(0)";d(b+1)}function V(){if(!H.current)return;W(),x.current=!0,k(ht);for(let b=0;b<he.length;b++)Y(b);if(d(0),u.current){for(let b=0;b<he.length;b++)M(b);x.current=!1,k(Ft);return}for(let b=0;b<he.length;b++)C(260+b*zr,()=>M(b));C(260+he.length*zr+200,()=>{x.current=!1,k(Ft)})}function K(){if(x.current)return;V()}a(()=>{if(!R)return;return u.current=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1,V(),W},[R]);let z=l===he.length;return t("section",{ref:v,className:"not-prose relative my-10 -mx-4 overflow-hidden border-y border-line bg-code-bg text-fg sm:mx-0 sm:rounded-2xl sm:border lg:-mx-8 xl:-mx-24 dark:border-neutral-800 dark:bg-[#0b0c10] dark:text-neutral-300",style:{overflowAnchor:"none"},children:[e("style",{children:pa}),t("div",{className:"px-5 pb-3 pt-5 sm:px-7",children:[t("div",{className:"font-mono text-[11px] uppercase tracking-[0.18em] text-fg-faint dark:text-neutral-500",children:[he.length," dependencies · now built in"]}),t("div",{className:"mt-3 flex flex-wrap items-center justify-between gap-x-4 gap-y-2",children:[t("span",{"aria-live":"polite",className:"font-mono text-[13px] tabular-nums text-fg-muted dark:text-neutral-400",children:[e("span",{className:`text-[20px] font-semibold ${z?"text-success dark:text-[#4ade80]":"text-accent dark:text-[#f472b6]"}`,children:he.length-l})," ","dependencies left"]}),t("button",{type:"button",onClick:K,"aria-disabled":m===ht,className:`grid rounded-md border border-line bg-subtle px-3 py-1.5 text-left font-mono text-[13px] transition-colors dark:border-neutral-700 dark:bg-neutral-800/60 ${m===ht?"cursor-default text-fg-faint dark:text-neutral-500":"cursor-pointer text-fg hover:border-line-strong hover:text-fg dark:text-neutral-200 dark:hover:border-neutral-500 dark:hover:text-white"}`,children:[ua.map((b)=>e("span",{"aria-hidden":!0,className:"invisible col-start-1 row-start-1 whitespace-nowrap",children:b},b)),e("span",{className:"col-start-1 row-start-1 whitespace-nowrap",children:m})]})]})]}),e("div",{ref:H,className:"px-5 pb-5 sm:px-7",children:t("div",{className:"grid grid-cols-1 gap-x-6 gap-y-0 sm:grid-cols-2",children:[t("div",{className:"min-w-0",children:[e("div",{className:"mb-2 font-mono text-[11px] text-fg-faint dark:text-neutral-500",children:"package.json · dependencies"}),e("div",{className:"relative rounded-lg border border-line bg-surface px-3 py-2 font-mono text-[13px] dark:border-neutral-800 dark:bg-black/40",style:{height:he.length*nt+16},children:he.map((b,A)=>t("div",{className:"relative flex items-center",style:{height:nt},children:[e("span",{"data-i":A,className:"dv-pkg truncate",style:{opacity:0.3,"--dv-l":Gr,"--dv-d":Xr,transition:"opacity .3s ease-out, color .3s ease-out"},children:b.pkg}
4),e("span",{"data-i":A,"aria-hidden":!0,className:"dv-bar pointer-events-none absolute left-0 h-[1.5px] bg-accent dark:bg-[#f472b6]",style:{top:nt/2,width:`${b.pkg.length}ch`,transformOrigin:"left center",transform:"scaleX(1)",transition:"transform .28s ease-out",willChange:"transform"}})]},b.pkg))})]}),t("div",{className:"min-w-0",children:[e("div",{className:"mb-2 font-mono text-[11px] text-fg-faint dark:text-neutral-500",children:"built into Bun 1.4"}),e("div",{className:"rounded-lg border border-line bg-surface px-3 py-2 font-mono text-[13px] dark:border-neutral-800 dark:bg-black/40",style:{height:he.length*nt+16},children:he.map((b,A)=>e("div",{className:"flex items-center gap-2",style:{height:nt},children:t("span",{"data-i":A,className:"dv-api flex min-w-0 items-baseline gap-2",style:{opacity:1,transform:"translateX(0)",transition:"opacity .3s ease-out, transform .3s ease-out",willChange:"transform, opacity"},children:[e("span",{className:"text-success dark:text-[#4ade80]",children:"â"}),e("span",{className:"truncate text-fg dark:text-neutral-200",children:b.api}),e("span",{className:"hidden truncate text-[11px] text-fg-faint dark:text-neutral-500 md:inline",children:b.note})]})},b.api))})]})]})}),e("div",{className:"border-t border-line px-5 py-3 text-[12px] leading-relaxed text-fg-faint sm:px-7 dark:border-neutral-800/80 dark:text-neutral-500",children:"Every one of these ships in the Bun binary â no install step, no native build, no lockfile entry. Each is covered in its own section below."})]})}i();var ge={without:{modules:312,ms:480},with:{modules:4,ms:6},pr:26892,note:"Transcribed from the benchmark table in oven-sh/bun#26892 (import { Button } from 'antd', antd@5). Regenerate with `bun scripts/bench-barrel-prune.ts` on Bun >=1.4 to refresh from a local Bun.build() run."};var an=["Affix","Alert","Anchor","App","AutoComplete","Avatar","BackTop","Badge","Breadcrumb","Button","Calendar","Card","Carousel","Cascader","Checkbox","Col","Collapse","ColorPicker","ConfigProvider","DatePicker","Descriptions","Divider","Drawer","Dropdown","Empty","Flex","FloatButton","Form","Grid","Image","Input","InputNumber","Layout","List","Mentions","Menu","Modal","Pagination","Popconfirm","Popover","Progress","QRCode","Radio","Rate","Result","Row","Segmented","Select","Skeleton","Slider","Space","Spin","Statistic","Steps","Switch","Table","Tabs","Tag","Timeline","Tooltip"],Ae=an.length,Se=9,Gt=[Se-1,Se,Se+1,Se+2],Wt=new Set(Gt),fa={[Se-1]:"button/style",[Se+1]:"_util/wave",[Se+2]:"config-provider"},ba=new Set([...Gt,19,27,36,47,55]),Ur=(l)=>fa[l]??an[l],Jr=760,Yt=340,sn=380,zt=86,Zr=210,Qr=196,Vt=Array.from({length:Ae},(l,d)=>{let m=(-Qr/2+d*Qr/(Ae-1))*Math.PI/180,k=Math.sin(m),v=sn+Zr*k,R=zt+Zr*Math.cos(m),H=k<-0.15?"end":k>0.15?"start":"middle",j=H==="end"?v-8:H==="start"?v+8:v;return{lx:v,ly:R,anchor:H,tx:j}}),en=(Ae-1)/2,yt={l:"rgb(var(--c-fg-muted))",d:"#3a3d47"},tn={l:"rgb(var(--c-warning))",d:"#fbbf24"},vt={l:"rgb(var(--c-success))",d:"#4ade80"},rn=(l)=>({"--l":l.l,"--d":l.d}),xa=` 5.brp .brp-edge { stroke: var(--l); } 6.brp .brp-dot { fill: var(--l); } 7@media (prefers-color-scheme: dark) { 8 .brp .brp-edge { stroke: var(--d); } 9 .brp .brp-dot { fill: var(--d); } 10} 11`,nn=["Bun 1.3 · barrel not detected","Bun 1.4 · optimizeImports"],ga=["text-warning dark:text-amber-300","text-success dark:text-emerald-400"],kt="· playing ·",ha=["â¶ play",kt,"â¶ with optimizeImports","â» replay"],ya=(l)=>`https://github.com/oven-sh/bun/pull/${l}`,Xe=(l)=>l.toLocaleString("en-US");function Xt(){let[l,d]=s(1),[m,k]=s("â¶ play"),[v,R]=y(),H=r([]),j=r([]),x=r(null),u=r(null),C=r([]),W=r(0),ee=r(!1),Y=r(1),M=r(!1),V=r(!1),K=(p,c)=>{C.current.push(setTimeout(c,p))},z=()=>{for(let p of C.current)clearTimeout(p);C.current=[],W.current++};function b(p,c,_){if(!p)return;let w=W.current,ae=performance.now(),U=(ie)=>1-Math.pow(1-ie,3),oe=(ie)=>{if(w!==W.current)return;let X=Math.min(1,(ie-ae)/_);if(p.textContent=Xe(Math.round(U(X)*c)),X<1)requestAnimationFrame(oe)};requestAnimationFrame(oe)}function A(p,c,_,w){let ae=H.current[p],U=j.current[p];if(ae)ae.style.setProperty("--l",c.l),ae.style.setProperty("--d",c.d),ae.style.strokeOpacity=String(_);if(U)U.style.setProperty("--l",c.l),U.style.setProperty("--d",c.d),U.style.fillOpacity=String(w)}function te(p){for(let c=0;c<Ae;c++)if(p===0)A(c,tn,0.55,1);else if(Wt.has(c))A(c,vt,0.9,1);else A(c,yt,0.18,0.35);if(x.current)x.current.textContent=Xe(p===0?ge.without.modules:ge.with.modules);if(u.current)u.current.textContent=Xe(p===0?ge.without.ms:ge.with.ms)}function re(p){ee.current=!1,k(p===0?"â¶ with optimizeImports":"â» replay")}function D(p){if(ee.current)return;z(),ee.current=!0,M.current=!0,Y.current=p,k(kt),d(p);for(let c=0;c<Ae;c++)A(c,yt,0.12,0.22);if(x.current)x.current.textContent="0";if(u.current)u.current.textContent="0";if(V.current){te(p),re(p);return}if(p===0){for(let c=0;c<Ae;c++){let _=120+Math.abs(c-en)/en*1200;K(_,()=>A(c,tn,0.55,1))}K(120,()=>b(x.current,ge.without.modules,1300)),K(120,()=>b(u.current,ge.without.ms,1300)),K(1650,()=>re(0))}else{let c=[250,420,590,760];Gt.forEach((_,w)=>K(c[w],()=>A(_,vt,0.9,1))),K(250,()=>b(x.current,ge.with.modules,600)),K(250,()=>b(u.current,ge.with.ms,600)),K(1000,()=>re(1))}}function ne(){if(ee.current)return;D(M.current?1-Y.current:0)}return a(()=>
11{if(!R)return;V.current=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1;for(let p of H.current)if(p)p.style.transition="stroke-opacity .35s ease-out";for(let p of j.current)if(p)p.style.transition="fill-opacity .35s ease-out";return D(0),z},[R]),t("section",{ref:v,className:"brp not-prose relative my-10 -mx-4 overflow-hidden border-y border-line bg-surface text-fg dark:border-neutral-800 dark:bg-[#0b0c10] dark:text-neutral-300 sm:mx-0 sm:rounded-2xl sm:border lg:-mx-8 xl:-mx-24",style:{overflowAnchor:"none"},children:[e("style",{children:xa}),t("div",{className:"px-5 pb-3 pt-5 sm:px-7",children:[t("div",{className:"font-mono text-[11px] uppercase tracking-[0.18em] text-fg-faint dark:text-neutral-500",children:["barrel import optimization · import ","{"," Button ","}",' from "antd"']}),t("div",{className:"mt-3 flex flex-wrap items-center justify-between gap-x-4 gap-y-2",children:[t("span",{"aria-live":"polite",className:`inline-grid font-mono text-[12px] tabular-nums ${ga[l]}`,children:[nn.map((p)=>e("span",{"aria-hidden":!0,className:"invisible col-start-1 row-start-1 whitespace-nowrap",children:p},p)),e("span",{className:"col-start-1 row-start-1 whitespace-nowrap",children:nn[l]})]}),t("span",{className:"font-mono text-[13px] text-fg-muted dark:text-neutral-400",children:["modules parsed:"," ",e("span",{ref:x,className:"inline-block min-w-[4ch] text-right text-[18px] font-bold tabular-nums text-fg dark:text-white",children:Xe(ge.with.modules)})," · ",e("span",{ref:u,className:"inline-block min-w-[5ch] text-right tabular-nums",children:Xe(ge.with.ms)})," ","ms"]}),t("button",{type:"button",onClick:ne,"aria-disabled":m===kt,className:`grid rounded-md border border-line bg-subtle px-3 py-1.5 text-left font-mono text-[13px] transition-colors dark:border-neutral-700 dark:bg-neutral-800/60 ${m===kt?"cursor-default text-fg-faint dark:text-neutral-500":"cursor-pointer text-fg hover:border-line-strong dark:text-neutral-200 dark:hover:border-neutral-500 dark:hover:text-white"}`,children:[ha.map((p)=>e("span",{"aria-hidden":!0,className:"invisible col-start-1 row-start-1 whitespace-nowrap",children:p},p)),e("span",{className:"col-start-1 row-start-1 whitespace-nowrap",children:m})]})]})]}),e("div",{className:"px-5 pb-5 sm:px-7",children:t("div",{className:"relative",children:[t("svg",{viewBox:`0 0 ${Jr} ${Yt}`,className:"block w-full",style:{aspectRatio:`${Jr}/${Yt}`},"aria-hidden":!0,children:[Vt.map((p,c)=>{let _=Wt.has(c);return e("line",{ref:(w)=>{H.current[c]=w},x1:sn,y1:zt+10,x2:p.lx,y2:p.ly,strokeWidth:1.25,className:"brp-edge",style:{...rn(_?vt:yt),strokeOpacity:_?0.9:0.18,pointerEvents:"none"}},`e${c}`)}),Vt.map((p,c)=>{let _=Wt.has(c);return e("circle",{ref:(w)=>{j.current[c]=w},cx:p.lx,cy:p.ly,r:4.5,className:"brp-dot",style:{...rn(_?vt:yt),fillOpacity:_?1:0.35},children:e("title",{children:Ur(c)})},`d${c}`)}),Vt.map((p,c)=>{if(!ba.has(c))return null;let _=c===Se;return e("text",{x:p.tx,y:p.ly+14,textAnchor:p.anchor,fontSize:9,fontFamily:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",fontWeight:_?600:400,className:_?"fill-accent-strong dark:fill-[#f472b6]":"fill-fg-faint dark:fill-[#6b7280]",style:{pointerEvents:"none"},children:Ur(c)},`t${c}`)})]}),t("div",{className:"absolute left-1/2 top-0 hidden -translate-x-1/2 rounded-md border border-line bg-code-bg px-3 py-1.5 font-mono text-[12.5px] dark:border-neutral-800 dark:bg-black/40 sm:block",children:[e("span",{className:"text-purple-700 dark:text-[#c792ea]",children:"import"})," ",e("span",{className:"text-fg-muted dark:text-neutral-400",children:"{"})," ",e("span",{className:"text-accent-strong dark:text-[#f472b6]",children:"Button"})," ",e("span",{className:"text-fg-muted dark:text-neutral-400",children:"}"})," ",e("span",{className:"text-purple-700 dark:text-[#c792ea]",children:"from"})," ",e("span",{className:"text-green-700 dark:text-[#c3e88d]",children:'"antd"'})]}),t("div",{className:"absolute left-1/2 -translate-x-1/2 -translate-y-1/2 rounded border border-line bg-surface px-2.5 py-1 text-center dark:border-neutral-700 dark:bg-neutral-900/80",style:{to
11p:`${(zt/Yt*100).toFixed(2)}%`},children:[e("div",{className:"font-mono text-[11.5px] text-fg dark:text-[#fbf0df]",children:"antd/es/index.js"}),t("div",{className:"text-[10px] text-fg-faint dark:text-neutral-500",children:["barrel · ",Xe(ge.without.modules)," re-exports"]})]})]})}),t("div",{className:"border-t border-line px-5 py-3 text-[12px] leading-relaxed text-fg-faint dark:border-neutral-800/80 dark:text-neutral-500 sm:px-7",children:[Ae," of antdâs ~70 top-level exports shown. Module count and timing measured with Bun.build() on this exact import â"," ",t("a",{href:ya(ge.pr),className:"text-fg-muted underline decoration-line-strong/30 hover:text-fg dark:text-neutral-400 dark:decoration-neutral-700 dark:hover:text-neutral-200",children:["#",ge.pr]}),"."]})]})}i();var ve={note:"Hand-curated for {% jscBumpReplay /%}. Endpoint values (912ms, 6ms, 44.98Ã, 1.47Ã, interpâJIT) are the measured numbers cited in pages/blog/bun-v1.4.md. Per-bump attribution is APPROXIMATE: subjects[] lists which cited WebKit commits first shipped in that Bun WebKit-pin bump, and each metric's series[] steps at those bumps â the intermediate curve shape is illustrative, not benchmarked at every bump. Regenerate from real checkouts with scripts/bun-v1.4-jsc-data.ts (needs BUN_REPO + WEBKIT_REPO).",bumps:[{date:"2025-11-03",pr:27214,subjects:[]},{date:"2025-11-10",pr:27298,subjects:[]},{date:"2025-11-17",pr:27401,subjects:["using / await using declarations","Wasm SIMD runs in the interpreter"]},{date:"2025-11-25",pr:27533,subjects:[]},{date:"2025-12-02",pr:27690,subjects:["Promise.resolve / reject â C++"]},{date:"2025-12-09",pr:27812,subjects:[]},{date:"2025-12-16",pr:27951,subjects:["Yarr: JIT fixed-count parens (?:abc){n}"]},{date:"2025-12-22",pr:28088,subjects:[]},{date:"2025-12-30",pr:28204,subjects:["Promise.all / allSettled / any â C++"]},{date:"2026-01-06",pr:28371,subjects:["AsyncGenerator microtask queue â C++"]},{date:"2026-01-13",pr:28502,subjects:["Inline zero-await async function bodies"]},{date:"2026-01-20",pr:28644,subjects:["Yarr: SIMD literal-prefix scan (ARM64)"]},{date:"2026-01-27",pr:28791,subjects:["Yarr: SIMD literal-prefix scan (x64)"]},{date:"2026-02-03",pr:28930,subjects:[]},{date:"2026-02-10",pr:29087,subjects:["Yarr: SIMD character-class scan [abc]"]},{date:"2026-02-17",pr:29241,subjects:["Yarr: JIT variable-count parens {m,n}","WebAssembly JSPI enabled by default"]},{date:"2026-02-24",pr:29393,subjects:[]},{date:"2026-03-03",pr:29562,subjects:["String#replace / replaceAll â C++"]},{date:"2026-03-10",pr:29718,subjects:["ES module loader rewritten in C++"]},{date:"2026-03-17",pr:29874,subjects:["for (using â¦) continue disposal fix"]},{date:"2026-03-24",pr:30041,subjects:[]},{date:"2026-03-31",pr:30207,subjects:["String#indexOf 1-char on ropes: skip resolve","String#split â C++ + DFG node"]},{date:"2026-04-07",pr:30388,subjects:[]},{date:"2026-04-14",pr:30552,subjects:["Yarr: auto-possession (kill a*b backtracking)"]},{date:"2026-04-20",pr:30719,subjects:[]},{date:"2026-04-27",pr:30891,subjects:["Array.from(Set / Map iterator) fast path"]},{date:"2026-05-04",pr:31068,subjects:["[...set] walks hash table directly"]},{date:"2026-05-11",pr:31247,subjects:[]},{date:"2026-05-18",pr:31429,subjects:["Yarr: dedicated line-break split fast path"]},{date:"2026-05-25",pr:31614,subjects:["Skip allocation for single-await async fn"]},{date:"2026-06-01",pr:31802,subjects:["Promise .then microtask: no separate object"]},{date:"2026-06-05",pr:31976,subjects:["Promise combinators: no per-element context"]},{date:"2026-06-09",pr:32158,subjects:[]},{date:"2026-06-13",pr:32341,subjects:["RegExp#lastIndex fast access (2.03Ã)","Promise combinators: skip intermediate promise"]},{date:"2026-06-17",pr:32526,subjects:[]},{date:"2026-06-21",pr:32714,subjects:["String#endsWith constant JIT-inlined (10.5Ã)"]},{date:"2026-06-25",pr:32907,subjects:["Yarr: capturing (abc){n} JIT path","Yarr: faster paren state save/restore"]},{date:"2026-06-28",pr:33042,subjects:[]},{date:"2026-06-30",pr:33133,subjects:["import defer static form"]}],metrics:{marked:{label:"marked.parse()",unit:"ms",from:912,to:6,series:[912,912,912,912,912,912,850,850,850,850,850,720,720,720,560,48,48,48,48,48,48,48,48,32,32,32,32,32,18,18,18,18,18,10,10,10,6,6,6]}
11,indexof:{label:"String#indexOf (rope)",unit:"Ã",from:1,to:44.98,series:[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,44.98,44.98,44.98,44.98,44.98,44.98,44.98,44.98,44.98,44.98,44.98,44.98,44.98,44.98,44.98,44.98,44.98,44.98]},promise:{label:"Promise.all",unit:"Ã",from:1,to:1.47,series:[1,1,1,1,1,1,1,1,1.12,1.12,1.12,1.12,1.12,1.12,1.12,1.12,1.12,1.12,1.12,1.12,1.12,1.12,1.12,1.12,1.12,1.12,1.12,1.12,1.12,1.12,1.12,1.31,1.31,1.47,1.47,1.47,1.47,1.47,1.47]},regex:{label:"/(â¦){m,n}/",from:"interp",to:"JIT",flipAt:15}}};var ka="text-pink-700 dark:text-[#f472b6]",wa="text-violet-700 dark:text-[#a78bfa]",Na="text-cyan-700 dark:text-[#22d3ee]",Ta="text-emerald-700 dark:text-[#34d399]",Ea=12000,Kt=0.18,at=760,Ut=64,Zt=6,wt=40,Le=ve.bumps.length,{marked:Ue,indexof:Je,promise:Ze,regex:on}=ve.metrics,Tt=ve.bumps.flatMap((l,d)=>l.subjects.map((m)=>[d,m])),Sa=Tt.slice(-3).map(([,l])=>l),ln="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),Nt=(l)=>{let[,d,m]=l.split("-").map(Number);return`${ln[d-1]} ${m}`},cn=(l)=>Zt+l/(Le-1)*(at-2*Zt),La=["2025-11","2026-01","2026-03","2026-05"].flatMap((l)=>{let d=ve.bumps.findIndex((m)=>m.date.startsWith(l));return d<0?[]:[{x:cn(d),label:ln[+l.slice(5)-1]}]}),dn="â¶ replay 8 months in 12s",pn="â» replay",Ra=[dn,pn],Ma=(l)=>`https://github.com/oven-sh/bun/pull/${l}`;function Qt(){let[l,d]=s(dn),[m,k]=y(),v=r(null),R=r(0),H=r(!1);function j(){let x=m.current,u=v.current;if(!x||!u)return;cancelAnimationFrame(R.current);let C=(oe)=>x.querySelector(oe),W=C(".jb-head"),ee=C(".jb-date"),Y=C(".jb-marked"),M=C(".jb-indexof"),V=C(".jb-promise"),K=C(".jb-interp"),z=C(".jb-jit"),b=x.querySelectorAll(".jb-tick"),A=x.querySelectorAll(".jb-log"),te=-1,re=!1,D=-1,ne=Ue.from,p=Je.from,c=Ze.from,_=u.clientWidth;W.style.transform="translateX(0)",ee.textContent=Nt(ve.bumps[0].date),Y.textContent=`${Ue.from} ms`,M.textContent=`${Je.from.toFixed(2)}Ã`,V.textContent=`${Ze.from.toFixed(2)}Ã`,K.style.transition="none",z.style.transition="none",K.style.opacity="1",z.style.opacity="0",x.offsetHeight,K.style.transition=z.style.transition="opacity .25s";for(let oe of b)oe.style.opacity="0.35";for(let oe of A)oe.textContent="";d(pn);let w=(oe)=>{W.style.transform=`translateX(${(oe*(_-2)).toFixed(1)}px)`;let ie=Math.max(0,Math.min(Le-1,Math.floor(oe*Le)));while(te<ie)b[++te].style.opacity="1";if(ee.textContent=Nt(ve.bumps[ie].date),oe>=1)ne=Ue.to,p=Je.to,c=Ze.to;else ne+=(Ue.series[ie]-ne)*Kt,p+=(Je.series[ie]-p)*Kt,c+=(Ze.series[ie]-c)*Kt;if(Y.textContent=`${Math.round(ne)} ms`,M.textContent=`${p.toFixed(2)}Ã`,V.textContent=`${c.toFixed(2)}Ã`,ie>=on.flipAt&&!re)re=!0,K.style.opacity="0",z.style.opacity="1";let X=D;while(X+1<Tt.length&&Tt[X+1][0]<=ie)X++;if(X!==D){D=X;for(let G=0;G<A.length;G++){let le=X-(A.length-1-G);A[G].textContent=le>=0?`· ${Tt[le][1]}`:""}}};if(H.current){w(1);return}let ae=performance.now(),U=(oe)=>{let ie=Math.max(0,Math.min(1,(oe-ae)/Ea));if(w(ie),ie<1)R.current=requestAnimationFrame(U)};R.current=requestAnimationFrame(U)}return a(()=>{if(!k)return;if(H.current=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1,!H.current)j();return()=>cancelAnimationFrame(R.current)},[k]),t("section",{ref:m,"aria-label":"39 WebKit upgrades replayed",className:"not-prose relative my-10 -mx-4 overflow-hidden border-y border-line bg-surface text-fg dark:border-neutral-800 dark:bg-[#0b0c10] dark:text-neutral-300 sm:mx-0 sm:rounded-2xl sm:border lg:-mx-8 xl:-mx-24",style:{overflowAnchor:"none"},children:[t("div",{className:"px-5 pb-3 pt-5 sm:px-7",children:[t("div",{className:"font-mono text-[11px] uppercase tracking-[0.18em] text-fg-faint",children:["javascriptcore · ",Le," webkit bumps"]}),t("div",{className:"mt-3 flex items-center justify-between gap-4",children:[e("span",{"aria-live":"polite",className:"jb-date min-w-[8ch] font-mono text-[13px] tabular-nums text-accent dark:text-[#fbf0df]",children:Nt(ve.bumps[Le-1].date)}),t("button",{type:"button",onClick:j,className:"grid cursor-pointer rounded-md border border-line bg-subtle px-3 py-1.5 text-left font-mono text-[13px] text-fg transition-colors hover:border-line-strong dark:border-neutral-700 dark:bg-neutral-800/60 dark:text-neutral-200 dark:hover:border-neutral-500 dark:hover:text-white",children:[Ra.map((x)=>
11e("span",{"aria-hidden":!0,className:"invisible col-start-1 row-start-1 whitespace-nowrap",children:x},x)),e("span",{className:"col-start-1 row-start-1 whitespace-nowrap",children:l})]})]})]}),t("div",{role:"status","aria-live":"off",className:"grid grid-cols-2 gap-x-8 gap-y-4 px-5 pb-5 sm:grid-cols-4 sm:px-7",children:[t(Jt,{cls:"jb-marked",color:ka,label:Ue.label,children:[Ue.to," ms"]}),t(Jt,{cls:"jb-indexof",color:wa,label:Je.label,children:[Je.to.toFixed(2),"Ã"]}),t(Jt,{cls:"jb-promise",color:Na,label:Ze.label,children:[Ze.to.toFixed(2),"Ã"]}),t("div",{className:"h-[72px]",children:[t("span",{className:"relative inline-block min-w-[7ch] text-right font-mono text-3xl font-bold leading-none tabular-nums sm:text-[40px]",children:[e("span",{className:"jb-interp absolute inset-0 text-fg-faint dark:text-[#9ca3af]",style:{opacity:0,transition:"opacity .25s"},children:"interp"}),e("span",{className:`jb-jit absolute inset-0 ${Ta}`,style:{opacity:1,transition:"opacity .25s"},children:"JIT"}),e("span",{className:"invisible",children:"interp"})]}),e("div",{className:"mt-1.5 font-mono text-[11px] uppercase tracking-widest text-fg-faint",children:on.label})]})]}),e("div",{className:"px-5 sm:px-7",children:t("div",{ref:v,className:"relative",children:[t("svg",{viewBox:`0 0 ${at} ${Ut}`,className:"block w-full","aria-hidden":!0,children:[e("line",{x1:0,y1:wt,x2:at,y2:wt,className:"stroke-line dark:stroke-[#3f3f46]"}),ve.bumps.map((x,u)=>{let C=cn(u),W=(at-2*Zt)/(Le-1);return t("g",{children:[e("line",{className:"jb-tick stroke-fg dark:stroke-[#e5e5e5]",x1:C,y1:28,x2:C,y2:wt,strokeWidth:1.5,style:{opacity:1}}),e("rect",{x:C-W/2,y:0,width:W,height:Ut,fill:"transparent",className:"cursor-help"}),e("title",{children:`${Nt(x.date)} · Bun PR #${x.pr}`})]},x.pr)}),La.map((x)=>e("text",{x:x.x,y:58,fontSize:10,textAnchor:x.x<14?"start":x.x>at-14?"end":"middle",className:"fill-fg-faint select-none dark:fill-[#6b7280]",children:x.label},x.label))]}),e("div",{className:"jb-head pointer-events-none absolute inset-0",style:{transform:"translateX(calc(100% - 2px))",willChange:"transform"},children:e("div",{className:"absolute left-0 top-0 w-[2px] bg-accent dark:bg-[#fbf0df] dark:shadow-[0_0_8px_#fbf0dfcc]",style:{bottom:`${(1-wt/Ut)*100}%`}})})]})}),e("div",{className:"mx-5 mb-5 mt-3 rounded-lg border border-line bg-code-bg px-4 py-3 font-mono text-[12px] leading-5 dark:border-neutral-800 dark:bg-black/40 sm:mx-7",children:["text-fg-faint","text-fg-muted","text-fg dark:text-neutral-200"].map((x,u)=>e("div",{className:`jb-log h-5 truncate ${x}`,children:`· ${Sa[u]??""}`},u))}),t("div",{className:"border-t border-line px-5 py-3 text-[12px] leading-relaxed text-fg-faint dark:border-neutral-800/80 sm:px-7",children:["Eight months of upstream JavaScriptCore, replayed. Tick marks are the ",Le," ","Bun PRs that bumped the WebKit pin between 1.3 and 1.4; hover a tick for its date and"," ",e("a",{href:Ma(ve.bumps[Le-1].pr),className:"text-fg-muted underline decoration-fg-faint/50 hover:text-fg dark:text-neutral-400 dark:decoration-neutral-700 dark:hover:text-neutral-200",children:"PR"}),". Endpoint values are the measured numbers from the tables below â the per-bump curve is approximate, showing which upgrade first shipped each cited commit."]})]})}function Jt({cls:l,color:d,label:m,children:k}){return t("div",{className:"h-[72px]",children:[e("span",{className:`${l} ${d} inline-block min-w-[7ch] text-right font-mono text-3xl font-bold leading-none tabular-nums sm:text-[40px]`,children:k}),e("div",{className:"mt-1.5 font-mono text-[11px] uppercase tracking-widest text-fg-faint",children:m})]})}i();var tr=26,mn=14,ke=1100,Re="opacity .3s, transform .35s cubic-bezier(.22,1,.36,1)",Ca="border-accent dark:border-[#f472b6]",Ba="text-accent dark:text-[#f472b6]",$e=(l)=>
11mn+l*tr,Et="â¼ playingâ¦",Aa=["â¶ play",Et,"â» replay"],$a="Bun â Documentation",Te="text-[#c41a68] dark:text-[#c792ea]",un="text-[#0b7d8c] dark:text-[#ffcb6b]",st="text-[#2f5fd0] dark:text-[#82aaff]",ot="text-[#4d7c1b] dark:text-[#c3e88d]",we="text-fg dark:text-neutral-200",be="text-fg-faint dark:text-neutral-500",se=(l,d)=>({t:l,cls:d}),Ia=[[se("await ",Te),se("using ",Te),se("view",we),se(" = ",be),se("new ",Te),se("Bun.WebView",un),se("({ ",be),se("width",we),se(": ",be),se("800",we),se(", ",be),se("height",we),se(": ",be),se("600",we),se(" });",be)],[se("await ",Te),se("view",we),se(".navigate",st),se("(",be),se('"https://bun.sh"',ot),se(");",be)],[se("await ",Te),se("view",we),se(".click",st),se("(",be),se(`"a[href='/docs']"`,ot),se(");",be)],[se("const ",Te),se("title",we),se(" = ",be),se("await ",Te),se("view",we),se(".evaluate",st),se("(",be),se('"document.title"',ot),se(");",be)],[se("await ",Te),se("Bun",un),se(".write",st),se("(",be),se('"page.png"',ot),se(", ",be),se("await ",Te),se("view",we),se(".screenshot",st),se("());",be)]];function rr(){let[l,d]=s("â¶ play"),[m,k]=y(),v=r(null),R=r([]),H=r(void 0),j=r(!1),x=r(!1),u=(M,V)=>{R.current.push(setTimeout(V,M))},C=()=>{for(let M of R.current)clearTimeout(M);R.current=[]};function W(){let M=v.current;if(!M)return;M.style.minHeight="",M.style.minHeight=`${M.offsetHeight}px`}function ee(){let M=v.current;if(!M)return;C(),j.current=!0,d(Et);let V=(U)=>M.querySelector(U),K=V(".wv-hl"),z=V(".wv-frame"),b=V(".wv-url0"),A=V(".wv-url1"),te=V(".wv-url2"),re=V(".wv-pg-home"),D=V(".wv-pg-docs"),ne=V(".wv-ripple"),p=V(".wv-flash"),c=V(".wv-res"),_=V(".wv-thumb"),w=(U,oe)=>Object.assign(U.style,oe);if(x.current){let U={transition:"none"};w(K,{...U,opacity:"1",transform:`translateY(${$e(4)}px)`}),w(z,{...U,opacity:"1",transform:"scale(1)"}),w(b,{...U,opacity:"0"}),w(A,{...U,opacity:"0"}),w(te,{...U,opacity:"1"}),w(re,{...U,opacity:"0"}),w(D,{...U,opacity:"1"}),w(ne,{...U,opacity:"0"}),w(p,{...U,opacity:"0"}),w(c,{...U,opacity:"1",transform:"translateY(0)"}),w(_,{...U,opacity:"1",transform:"translateY(0)"}),j.current=!1,d("â» replay");return}let ae=[K,z,b,A,te,re,D,ne,p,c,_];for(let U of ae)U.style.transition="none";w(K,{opacity:"0",transform:"translateY(-40px)"}),w(z,{opacity:"0.35",transform:"scale(0.97)"}),w(b,{opacity:"1"}),w(A,{opacity:"0"}),w(te,{opacity:"0"}),w(re,{opacity:"0"}),w(D,{opacity:"0"}),w(ne,{opacity:"0",transform:"scale(0.3)"}),w(p,{opacity:"0"}),w(c,{opacity:"0",transform:"translateY(4px)"}),w(_,{opacity:"0",transform:"translateY(8px)"}),M.offsetHeight,u(100,()=>{w(K,{transition:Re,opacity:"1",transform:`translateY(${$e(0)}px)`}),w(z,{transition:Re,opacity:"1",transform:"scale(1)"})}),u(100+ke,()=>{w(K,{transform:`translateY(${$e(1)}px)`}),w(b,{transition:"opacity .25s",opacity:"0"}),w(A,{transition:"opacity .25s",opacity:"1"})}),u(100+ke+400,()=>{w(re,{transition:"opacity .3s",opacity:"1"})}),u(100+2*ke,()=>{w(K,{transform:`translateY(${$e(2)}px)`}),w(ne,{transition:"transform .35s ease-out, opacity .35s",opacity:"0.7",transform:"scale(1)"})}),u(100+2*ke+350,()=>{w(ne,{opacity:"0"})}),u(100+2*ke+450,()=>{w(re,{transition:"opacity .3s",opacity:"0"}),w(D,{transition:"opacity .3s",opacity:"1"}),w(A,{transition:"opacity .25s",opacity:"0"}),w(te,{transition:"opacity .25s",opacity:"1"})}),u(100+3*ke,()=>{w(K,{transform:`translateY(${$e(3)}px)`}),w(c,{transition:Re,opacity:"1",transform:"translateY(0)"})}),u(100+4*ke,()=>{w(K,{transform:`translateY(${$e(4)}px)`}),w(p,{transition:"opacity .09s",opacity:"0.85"})}),u(100+4*ke+110,()=>{w(p,{transition:"opacity .18s",opacity:"0"})}),u(100+4*ke+300,()=>{w(_,{transition:Re,opacity:"1",transform:"translateY(0)"})}),u(100+4*ke+800,()=>{j.current=!1,d("â» replay")})}function Y(){if(j.current)return;ee()}return a(()=>{if(!k)return;x.current=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1,W();let M=()=>{clearTimeout(H.current),H.current=setTimeout(W,150)};return window.addEventListener("resize",M),ee(),()=>{C(),clearTimeout(H.current),window.removeEventListener("resize",M)}},[k]),t("section",{ref:m,className:"not-prose relative my-10 -mx-4 overflow-hidden border-y border-line bg-surface text-fg-muted dark:border-neutral-800 dark:bg-[#0b0c10] dark:text-neutral-300 sm:mx-0 sm:rounded-2xl sm:border lg:-mx-8 xl:-mx-24",style:{overflowAnchor:"none"},children:[t("div",{className:"flex items-start justify-between gap-4 px-5 pb-3 pt-5 sm:px-7",children:[e("div",{className:"font-mono text-[11px] uppercase tracking-[0.18em] text-fg-faint dark:text-neutral-500",children:"Bun.WebView · headless browser in 5 lines"}),t("button",{type:"button",onClick:Y,"aria-disabled":l===Et,className:`grid shrink-0 rounded-md border border-line bg-subtle px-3 py-1.5 text-left font-mono text-[13px] transition-colors dark:border-neutral-700 dark:bg-neutral-800/60 ${l===Et?"curs
11or-default text-fg-faint dark:text-neutral-500":"cursor-pointer text-fg hover:border-line-strong hover:text-fg dark:text-neutral-200 dark:hover:border-neutral-500 dark:hover:text-white"}`,children:[Aa.map((M)=>e("span",{"aria-hidden":!0,className:"invisible col-start-1 row-start-1 whitespace-nowrap",children:M},M)),e("span",{className:"col-start-1 row-start-1 whitespace-nowrap",children:l})]})]}),t("div",{ref:v,className:"wv-stage grid gap-4 px-5 pb-5 sm:px-7",children:[t("div",{className:"relative min-w-0 rounded-lg border border-line bg-code-bg font-mono text-[13px] dark:border-neutral-800 dark:bg-black/40",style:{lineHeight:`${tr}px`,paddingBlock:mn},children:[e("div",{className:"wv-hl absolute left-0 right-0 rounded bg-accent-soft shadow-[inset_2px_0_0_rgb(var(--c-accent))] dark:bg-[#fbf0df]/[0.07] dark:shadow-[inset_2px_0_0_#f472b6]",style:{top:0,height:tr,opacity:1,transform:`translateY(${$e(4)}px)`,transition:Re,willChange:"transform"}}),e("div",{className:"relative overflow-x-auto px-4",children:Ia.map((M,V)=>e("div",{className:"whitespace-pre",children:M.map((K,z)=>e("span",{className:K.cls,children:K.t},z))},V))})]}),t("div",{className:"min-w-0",children:[t("div",{className:"wv-frame rounded-lg border border-line bg-surface dark:border-neutral-800 dark:bg-[#111216] dark:shadow-[0_0_0_1px_#00000040]",style:{opacity:1,transform:"scale(1)",transition:Re,willChange:"transform"},children:[t("div",{className:"flex items-center gap-1.5 border-b border-line px-3 py-2 dark:border-neutral-800",children:[e("span",{className:"h-2.5 w-2.5 rounded-full bg-[#ff5f57]"}),e("span",{className:"h-2.5 w-2.5 rounded-full bg-[#febc2e]"}),e("span",{className:"h-2.5 w-2.5 rounded-full bg-[#28c840]"}),e("div",{className:"ml-2 min-w-0 flex-1 truncate rounded bg-subtle px-2 py-1 font-mono text-[11px] text-fg-muted dark:bg-neutral-900/80 dark:text-neutral-400",children:t("span",{className:"relative inline-block align-top",children:[e("span",{className:"invisible",children:"https://bun.sh/docs"}),e(er,{cls:"wv-url0",text:" ",ssrOpacity:0}),e(er,{cls:"wv-url1",text:"https://bun.sh",ssrOpacity:0}),e(er,{cls:"wv-url2",text:"https://bun.sh/docs",ssrOpacity:1})]})})]}),t("div",{className:"relative h-[168px] w-full overflow-hidden bg-surface dark:bg-[#0d0d0d] sm:h-[188px]",children:[e("div",{className:"wv-pg-home absolute inset-0",style:{opacity:0,transition:"opacity .3s"},children:e(Ha,{})}),e("div",{className:"wv-pg-docs absolute inset-0",style:{opacity:1,transition:"opacity .3s"},children:e(Pa,{})}),e("div",{className:`wv-ripple pointer-events-none absolute h-7 w-7 rounded-full border-2 ${Ca}`,style:{top:6,left:58,opacity:0,transform:"scale(0.3)",willChange:"transform"}}),e("div",{className:"wv-flash pointer-events-none absolute inset-0 bg-fg dark:bg-white",style:{opacity:0}})]})]}),t("div",{className:"relative mt-3 h-[56px]",children:[t("div",{className:"wv-res absolute left-0 top-0 rounded-md border border-line bg-subtle px-2.5 py-1.5 font-mono text-[11px] dark:border-neutral-700 dark:bg-neutral-900/70",style:{opacity:1,transform:"translateY(0)",transition:Re,willChange:"transform"},children:[e("span",{className:be,children:"title â "}),t("span",{className:ot,children:['"',$a,'"']})]}),t("div",{className:"wv-thumb absolute right-0 top-0 flex items-center gap-2",style:{opacity:1,transform:"translateY(0)",transition:Re,willChange:"transform"},children:[e("div",{className:"h-[33px] w-[44px] rounded border border-line bg-gradient-to-br from-subtle to-line dark:border-neutral-700 dark:from-neutral-800 dark:to-neutral-900"}),e("span",{className:"font-mono text-[11px] text-success",children:"â page.png"})]})]})]})]}),t("div",{className:"border-t border-line px-5 py-3 text-[12px] leading-relaxed text-fg-faint dark:border-neutral-800/80 dark:text-neutral-500 sm:px-7",children:["No Puppeteer, no Playwright, no"," ",e("code",{className:"text-fg-muted dark:text-neutral-400",children:"npm install"})," â a real browser (WebKit on macOS, or an installed Chrome/Edge via CDP) driven by five awaits. Clicks arrive as trusted input (",e("code",{className:"text-fg-muted dark:text-neutral-400",children:"event.isTrusted === true"}),"). Illustrative render â see the"," ",e("a",{href:"/docs/api/webview",className:"text-fg-muted underline decoration-fg-faint/50 hover:text-fg dark:text-neutral-400 dark:decoration-neutral-700 dark:hover:text-neutral-200",children:"docs"}),"."]})]})}function er({cls:l,text:d,ssrOpacity:m}){return e("span",{className:`${l} absolute inset-0 whitespace-nowrap`,style:{opacity:m,transition:"opacity .25s"},children:d})}function Ha(){return t(o,{children:[t("div",{className:"flex items-center gap-3 px-3.5 pt-3",children:[e("img",{src:"/logo.svg",alt:"",className:"h-4 object-contain",style:{width:34}}),e("span",{className:`wv-link text-[12px] font-medium ${Ba}`,children:"Docs"}),e("span",{className:"text-[12px] text-fg-muted dark:text-neutral-400",children:"Guides"}),e("span",{className:"text-[12px] text-fg-muted dark:text-neutral-400",children:"Blog"})]}),t("div",{className:"flex gap-8 px-3.5 pt-6",children:[t("div",{children:[t("div",{className:"text-[13px] font-semibold leading-snug text-fg dark:text-neutral-200",children:["Bun is a fast JavaScript",e("br",{}),"all-in-one toolkit"]}),e("div",{className:"mt-2.5 h-1.5 w-36 rounded bg-line dark:bg-neutral-700/40"}),e("div",{className:"mt-1.5 h-1.5 w-28 rounded bg-line dark:bg-neutral-700/40"}),e("div",{className:"mt-4 h-5 w-40 rounded border border-line dark:border-neutral-700/60"})]}),t("div",{className:"hidden flex-1 flex-col gap-1.5 pt-1 sm:flex",children:[e("div",{className:"h-1.5 w-[70%] rounded bg-line dark:bg-neutral-700/40"}),e("div",{className:"h-1.5 w-[55%] rounded bg-line dark:bg-neutral-700/40"}),e("div",{className:"h-1.5 w-[64%] rounded bg-line dark:bg-neutral-700/40"}),e("div",{className:"h-1.5 w-[40%] rounded bg-line dark:bg-neutral-700/40"})]})]})]})}function Pa(){return t("div",{className:"flex h-full gap-3.5 px-3.5 pt-3.5",children:[t("div",{className:"flex shrink-0 flex-col gap-1.5",children:[e("div",{className:"h-1.5 w-16 rounded bg-line dark:bg-neutral-700/40"}),e("div",{className:"h-1.5 w-12 rounded bg-line dark:bg-neutral-700/40"}
11),e("div",{className:"h-1.5 w-14 rounded bg-line dark:bg-neutral-700/40"}),e("div",{className:"h-1.5 w-10 rounded bg-line dark:bg-neutral-700/40"}),e("div",{className:"h-1.5 w-14 rounded bg-line dark:bg-neutral-700/40"}),e("div",{className:"h-1.5 w-12 rounded bg-line dark:bg-neutral-700/40"})]}),t("div",{className:"min-w-0 flex-1",children:[e("div",{className:"text-[13px] font-semibold text-fg dark:text-neutral-200",children:"Documentation"}),e("div",{className:"mt-2 h-1.5 w-full rounded bg-line dark:bg-neutral-700/40"}),e("div",{className:"mt-1.5 h-1.5 w-[85%] rounded bg-line dark:bg-neutral-700/40"}),e("div",{className:"mt-1.5 h-1.5 w-[92%] rounded bg-line dark:bg-neutral-700/40"}),e("div",{className:"mt-1.5 h-1.5 w-[70%] rounded bg-line dark:bg-neutral-700/40"}),e("div",{className:"mt-3.5 h-9 w-[80%] rounded border border-line dark:border-neutral-800"}),e("div",{className:"mt-3 h-1.5 w-[88%] rounded bg-line dark:bg-neutral-700/40"}),e("div",{className:"mt-1.5 h-1.5 w-[60%] rounded bg-line dark:bg-neutral-700/40"})]})]})}i();var fn={note:"Generated by scripts/bun-v1.4-node-compat-data.ts â same method as bun.com/node-test-suite: baseline = Node.js v26.3.0 test/{parallel,sequential} + N-API test list shipped in public/node-test-suite.html; a test passes when its file is vendored in oven-sh/bun test/js/node/test at the ref. Modules with fewer than 5 tests are hidden like on the page; the top 24 by delta are kept, pre-sorted. totalDelta/pass14 are overridden to match the CI 'files passing on every commit' count used in the post's chart (2,226 â 3,743, +1,517); per-module tiles keep the vendored-file counts.",suite:"Node.js v26.3.0",excludeInternals:!1,from:{ref:"bun-v1.3.0",sha:"b0a6feca57"},to:{ref:"origin/main",sha:"39fde480e9"},total:4608,pass13:2226,pass14:3743,pct13:48.3,pct14:81.2,totalDelta:1517,modules:[{name:"quic",pass13:0,pass14:235,total:237,anchor:"node-quic"},{name:"http",pass13:210,pass14:403,total:415,rewritten:!0,anchor:"node-http-client"},{name:"fs",pass13:216,pass14:349,total:358,anchor:"node-fs"},{name:"tls",pass13:85,pass14:191,total:224,anchor:"node-net-and-node-tls"},{name:"http2",pass13:159,pass14:261,total:280,rewritten:!0,anchor:"node-http2"},{name:"repl",pass13:5,pass14:82,total:109,anchor:"node-repl"},{name:"stream",pass13:193,pass14:254,total:262,anchor:"node-stream"},{name:"worker",pass13:59,pass14:116,total:157,anchor:"node-worker-threads"},{name:"process",pass13:115,pass14:160,total:190,anchor:"process"},{name:"net",pass13:132,pass14:171,total:191,anchor:"node-net-and-node-tls"},{name:"https",pass13:22,pass14:61,total:65},{name:"internal",pass13:33,pass14:68,total:108},{name:"cluster",pass13:54,pass14:85,total:88,anchor:"node-cluster"},{name:"trace_events",pass13:0,pass14:30,total:30,anchor:"node-trace-events"},{name:"webcrypto",pass13:11,pass14:39,total:50},{name:"crypto",pass13:96,pass14:123,total:135},{name:"vm",pass13:73,pass14:98,total:101,anchor:"node-vm"},{name:"webstreams",pass13:5,pass14:28,total:38},{name:"test_runner",pass13:7,pass14:28,total:81,anchor:"node-test"},{name:"module",pass13:49,pass14:68,total:93},{name:"diagnostics_channel",pass13:17,pass14:36,total:69},{name:"sqlite",pass13:0,pass14:18,total:18,anchor:"node-sqlite"},{name:"child_process",pass13:90,pass14:105,total:116,anchor:"uid-and-gid-for-child-processes"},{name:"inspector",pass13:8,pass14:22,total:110}]};var{suite:ja,totalDelta:bn,modules:St}=fn,nr=4000,xn=St.length,Da=["â¶ play","â» replay"],gn=new Intl.NumberFormat("en-US"),qa=(l)=>1-Math.pow(1-l,3),Fa=` 12[data-nc-rewind] * { transition: none !important; } 13.nc-fill { background: rgb(var(--c-accent)); } 14@media (prefers-color-scheme: dark) { 15 .nc-counter { text-shadow: 0 0 24px rgba(251,112,186,0.35); } 16 .nc-fill { background: linear-gradient(90deg,#fdf8ec,#efe2c7); box-shadow: 0 0 12px rgba(251,242,225,0.25); } 17} 18`;function ar(){let[l,d]=s(!1),[m,k]=y(),v=r(null),R=r([]),H=r([]),j=r(0),x=r(!1),u=(Y,M)=>{H.current.push(setTimeout(M,Y))},C=()=>{for(let Y of H.current)clearTimeout(Y);H.current=[],cancelAnimationFrame(j.current)};function W(){if(v.current)v.current.textContent="+0";St.forEach((Y,M)=>{let V=R.current[M];if(!V)return;V.style.setProperty("--op","0"),V.style.setProperty("--sx",String(Y.pass13/Math.max(Y.pass14,1)));let K=V.querySelector(".nc-n");if(K)K.textContent=String(Y.pass13)})}function ee(){if(C(),x.current){d(!0);return}let Y=m.current;Y?.setAttribute("data-nc-rewind",""),W(),j.current=requestAnimationFrame(()=>{j.current=requestAnimationFrame(()=>{Y?.removeAttribute("data-nc-rewind");let M=performance.now(),V=(K)=>{let z=Math.min(1,(K-M)/nr);if(v.current)v.current.textContent="+"+gn.format(Math.round(qa(z)*bn));if(z<1)j.current=requestAnimationFrame(V)};j.current=requestAnimationFrame(V),St.forEach((K,z)=>{u(xn>1?z/(xn-1)*nr:0,()=>{let b=R.current[z];if(!b)return;b.style.setProperty("--op","1"),b.style.setProperty("--sx","1");let A=b.querySelector(".nc-n");if(A)A.textContent=String(K.pass14)})}),u(nr,()=>d(!0))})})}return a(()=>
18{if(!k)return;return x.current=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1,ee(),C},[k]),t("figure",{ref:m,className:"not-prose relative my-8 overflow-hidden rounded-2xl border border-line bg-surface px-5 pb-6 pt-5 sm:px-7 sm:pb-7 dark:border-transparent dark:bg-[#0c0b0a]",style:{overflowAnchor:"none"},children:[e("style",{children:Fa}),t("div",{className:"flex flex-wrap items-end justify-between gap-x-6 gap-y-3",children:[t("div",{children:[t("div",{className:"font-mono text-[11px] uppercase tracking-[0.18em] text-fg-faint dark:text-white/40",children:[ja," test suite · passing on every commit"]}),t("div",{className:"mt-2 flex items-baseline gap-3",children:[t("span",{ref:v,className:"nc-counter inline-block min-w-[7ch] text-left font-mono text-4xl font-bold tabular-nums text-fg dark:text-white sm:text-5xl",children:["+",gn.format(bn)]}),e("span",{className:"text-sm font-medium text-fg-muted dark:text-white/55",children:"newly passing tests"})]})]}),t("button",{type:"button",onClick:ee,"aria-label":"Replay animation",className:"grid rounded-md border border-line bg-subtle px-3 py-1.5 text-left font-mono text-[12px] text-fg-muted transition hover:border-line-strong hover:text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/60 dark:border-white/15 dark:bg-white/[0.04] dark:text-white/70 dark:hover:border-white/30 dark:hover:text-white dark:focus-visible:ring-pink-400/60",children:[Da.map((Y)=>e("span",{"aria-hidden":!0,className:"invisible col-start-1 row-start-1 whitespace-nowrap",children:Y},Y)),e("span",{className:"col-start-1 row-start-1 whitespace-nowrap",children:l?"â» replay":"â¶ play"})]})]}),e("div",{className:"mt-5 grid grid-cols-2 gap-2.5 sm:grid-cols-3 lg:grid-cols-4",children:St.map((Y,M)=>e(Oa,{m:Y,ref:(V)=>{R.current[M]=V}},Y.name))}),t("figcaption",{className:"mt-5 border-t border-line pt-3 text-[11px] leading-relaxed text-fg-faint dark:border-white/8 dark:text-white/40",children:["Per-module pass counts from Bunâs vendored copy of Nodeâs"," ",e("code",{className:"text-fg-muted dark:text-neutral-400",children:"test/parallel"})," suite, Bun 1.3 â 1.4. The tick marks the 1.3 baseline."]})]})}var Oa=J(function({m:d},m){let k=d.pass14-d.pass13,v=`node:${d.name} â Bun 1.3: ${d.pass13} â Bun 1.4: ${d.pass14} of ${d.total} tests (+${k})${d.rewritten?" · rewritten from scratch":""}`;return t("div",{ref:m,title:v,className:"flex h-[72px] cursor-default flex-col justify-between rounded-lg border border-line bg-surface px-3 py-2.5 dark:border-white/8 dark:bg-white/[0.02]",style:{opacity:"var(--op, 1)",transition:"opacity 400ms ease-out, border-color .15s, background-color .15s"},children:[t("div",{className:"flex min-w-0 items-center justify-between gap-2",children:[e("span",{className:"truncate font-mono text-[13px] font-medium text-fg dark:text-white",children:d.name}),d.rewritten?e("span",{className:"shrink-0 rounded-full border border-accent/40 bg-accent-soft px-1.5 py-px font-mono text-[8.5px] font-bold uppercase tracking-[0.1em] text-accent-strong dark:border-pink-400/40 dark:bg-pink-400/10 dark:text-pink-300",children:"rewritten"}):null]}),t("div",{className:"relative h-1.5 overflow-hidden rounded-full bg-line dark:bg-white/8",children:[e("div",{className:"nc-fill absolute inset-y-0 left-0 origin-left will-change-transform",style:{width:`${d.pass14/d.total*100}%`,transform:"scaleX(var(--sx, 1))",transition:"transform 700ms cubic-bezier(.2,.7,.2,1)"}}),e("div",{className:"absolute inset-y-0 w-px bg-fg/25 dark:bg-white/25",style:{left:`${d.pass13/d.total*100}%`}})]}),t("div",{className:"flex items-baseline font-mono text-[11px] tabular-nums",children:[e("span",{className:"nc-n inline-block min-w-[3ch] text-right text-fg dark:text-white/80",children:d.pass14}),t("span",{className:"text-fg-faint dark:text-white/35",children:[" / ",d.total]}),t("span",{className:"ml-1.5 text-accent-strong dark:text-pink-300/90",children:["+",k]})]})]})});i();var ir="#0b0c10",wn={fill:{l:"rgb(var(--c-subtle))",d:"#1a1d24"},stroke:{l:"rgb(var(--c-line))",d:"#2a2f3a"},text:{l:"rgb(var(--c-fg))",d:"#d1d5db"}},Nn={fill:{l:"rgb(var(--c-accent-soft))",d:"#f472b6"},stroke:{l:"rgb(var(--c-accent))",d:"#f472b6"},text:{l:"rgb(var(--c-accent-strong))",d:ir}},lr={fill:{l:"#ede9fe",d:"#a78bfa"},stroke:{l:"#7c3aed",d:"#a78bfa"},text:{l:"#5b21b6",d:ir}},Tn={fill:{l:"#dcfce7",d:"#4ade80"},stroke:{l:"rgb(var(--c-success))",d:"#4ade80"},text:{l:"#166534",d:ir}},hn=lr.stroke,yn={l:"rgb(var(--c-fg-muted))",d:"#2a2f3a"},Wa=` 19.cg .cg-node { fill: var(--fl); stroke: var(--sl); } 20.cg .cg-label { fill: var(--l); } 21.cg .cg-edge { stroke: var(--l); } 22@media (prefers-color-scheme: dark) { 23 .cg .cg-node { fill: var(--fd); stroke: var(--sd); } 24 .cg .cg-label { fill: var(--d); } 25 .cg .cg-edge { stroke: var(--d); } 26} 27`,En=[{id:"aT",label:"date.test",x:150,y:40,test:!0},{id:"bT",label:"auth.test",x:350,y:40,test:!0},{id:"cT",label:"cli.test",x:610,y:40,test:!0},{id:"date",label:"date.ts",x:150,y:145},{id:"auth",label:"auth.ts",x:350,y:145},{id:"cli",label:"cli.ts",x:610,y:145},{id:"utils",label:"utils.ts",x:250,y:250},{id:"readme",label:"README.md",x:610,y:250}],Ya=[["aT","date"],["bT","auth"],["cT","cli"],["date","utils"],["auth","utils"]],Me=[{file:"src/lib/utils.ts",changed:"utils",hops:[{edges:["date>utils","auth>utils"],nodes:["date","auth"]},{edges:["aT>date","bT>auth"],nodes:["aT","bT"]}],tests:["aT","bT"],stat:"â running 2 of 3 test files"},{file:"src/cli.ts",changed:"cli",hops:[{edges:["cT>cli"],nodes:["cT"]}],tests:["cT"],stat:"â running 1 of 3 test files"},{file:"README.md",changed:"readme",hops:[],tests:[],stat:"â 0 test files ·
27nothing to run"}],sr=Object.fromEntries(En.map((l)=>[l.id,l])),Va=(l)=>`${l[0]}>${l[1]}`,za=(l)=>Math.round(l.length*6.6+18),Ga=(l)=>l.slice(l.lastIndexOf("/")+1),or=(l)=>l+1<Me.length?`â¶ next · edit ${Ga(Me[l+1].file)}`:"â» replay",Xa=Me.map((l,d)=>or(d)),Lt=Me[0],Ka=new Set(Lt.hops.flatMap((l)=>l.edges)),Ua=new Set(Lt.hops.flatMap((l)=>l.nodes)),Ja=(l)=>l.id===Lt.changed?Nn:Ua.has(l.id)?l.test?Tn:lr:wn,Za=(l)=>({"--fl":l.fill.l,"--fd":l.fill.d,"--sl":l.stroke.l,"--sd":l.stroke.d}),vn=(l)=>({"--l":l.l,"--d":l.d}),Sn="text-accent-strong dark:text-[#f472b6]",Qa="text-success dark:text-[#4ade80]",es=(l)=>t(o,{children:["git diff â ",e("span",{className:Sn,children:l})]}),kn=(l)=>l.tests.length===0?l.stat:t(o,{children:["â running"," ",t("span",{className:Qa,children:[l.tests.length," of 3"]})," test files"]}),ts=` 28@keyframes cgPulse{0%{transform:scale(1)}45%{transform:scale(1.15)}100%{transform:scale(1)}} 29.cg-pulse{animation:cgPulse 480ms ease-out;transform-box:fill-box;transform-origin:center} 30${Wa}`;function cr(){let[l,d]=s(0),[m,k]=s(()=>or(0)),[v,R]=s(()=>kn(Lt)),[H,j]=y(),x=r(null),u=r({rects:new Map,lines:new Map}),C=r([]),W=r(0),ee=r(!1),Y=(p,c)=>{C.current.push(setTimeout(c,p))},M=()=>{for(let p of C.current)clearTimeout(p);C.current=[]},V=(p,c)=>{let _=u.current.rects.get(p);if(!_)return;_.style.setProperty("--fl",c.fill.l),_.style.setProperty("--fd",c.fill.d),_.style.setProperty("--sl",c.stroke.l),_.style.setProperty("--sd",c.stroke.d);let w=_.parentElement?.querySelector(".cg-label");if(w)w.style.setProperty("--l",c.text.l),w.style.setProperty("--d",c.text.d)},K=(p,c,_)=>{p.style.setProperty("--l",c.l),p.style.setProperty("--d",c.d),p.style.strokeOpacity=_},z=(p)=>{let c=u.current.lines.get(p);if(c)K(c,hn,"1")};function b(){for(let[p]of u.current.rects)V(p,wn);for(let[,p]of u.current.rects)p.classList.remove("cg-pulse");for(let[,p]of u.current.lines)K(p,yn,"0.18")}function A(p){M(),W.current=p;let c=Me[p];d(p),k(or(p)),R(es(c.file)),b();let _=(oe)=>{for(let ie of oe.edges)z(ie);for(let ie of oe.nodes)V(ie,sr[ie]?.test?Tn:lr)},w=()=>R(kn(c));V(c.changed,Nn);let ae=u.current.rects.get(c.changed);if(ee.current){for(let oe of c.hops)_(oe);w();return}if(ae)ae.getBoundingClientRect(),ae.classList.add("cg-pulse");c.hops.forEach((oe,ie)=>Y(400+ie*350,()=>_(oe)));let U=Math.max(400+c.hops.length*350,550);Y(U,w)}function te(){A((W.current+1)%Me.length)}function re(p){if(p.target!==p.currentTarget)return;if(p.key==="ArrowRight"||p.key==="Enter")p.preventDefault(),te()}a(()=>{if(!j)return;ee.current=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1;let p=x.current;if(p){for(let c of p.querySelectorAll("[data-n]"))u.current.rects.set(c.dataset.n,c);for(let c of p.querySelectorAll("[data-e]"))u.current.lines.set(c.dataset.e,c)}return A(0),M},[j]);let D=T(()=>t("svg",{ref:x,viewBox:"0 0 760 290",className:"block h-auto w-full",role:"img","aria-label":"Import graph: four test files at the top, source files below, edges are imports.",children:[e("g",{children:Ya.map((p)=>{let c=Va(p),_=sr[p[0]],w=sr[p[1]],ae=Ka.has(c);return e("line",{"data-e":c,x1:_.x,y1:_.y,x2:w.x,y2:w.y,strokeWidth:1.5,strokeLinecap:"round",className:"cg-edge",style:{...vn(ae?hn:yn),strokeOpacity:ae?1:0.18,transition:"stroke .3s ease-out, stroke-opacity .3s ease-out"}},c)})}),e("g",{children:En.map((p)=>{let c=za(p.label),_=Ja(p);return t("g",{transform:`translate(${p.x},${p.y})`,children:[e("rect",{"data-n":p.id,x:-c/2,y:-11,width:c,height:22,rx:5,strokeWidth:1.5,className:"cg-node",style:{...Za(_),transition:"fill .3s ease-out, stroke .3s ease-out"}}),p.test?e("text",{textAnchor:"middle",dy:-16,fontSize:8,className:"fill-fg-faint font-mono dark:fill-gray-500",children:"TEST"}):null,e("text",{textAnchor:"middle",dy:4,fontSize:11,className:"cg-label font-mono",style:{...vn(_.text),transition:"fill .3s ease-out"},children:p.label})]},p.id)})})]}),[]),ne=Me[l];return t("section",{ref:H,tabIndex:0,onKeyDown:re,className:"cg not-prose my-8 overflow-hidden rounded-xl border border-line bg-surface text-fg focus:outline-none focus-visible:ring-2 focus-visible:ring-violet-500/60 dark:border-neutral-800 dark:bg-[#0b0c10] dark:text-gray-300",style:{overflowAnchor:"none"},children:[e("style",{dangerouslySetInnerHTML:{__html:ts}}),t("div",{className:"flex items-center justify-between gap-4 px-5 pb-1 pt-4",children:[e("span",{className:"font-mono text-[11px] uppercase tracking-[0.18em] text-fg-faint dark:text-gray-500",children:"bun test --ch
30anged"}),t("button",{type:"button",onClick:te,"aria-label":"Play next scenario",className:"grid rounded-md border border-line bg-subtle px-3 py-1.5 text-left font-mono text-[12px] text-fg transition hover:border-line-strong dark:border-gray-700 dark:bg-gray-800/60 dark:text-gray-200 dark:hover:border-gray-500 dark:hover:text-white",children:[Xa.map((p)=>e("span",{"aria-hidden":!0,className:"invisible col-start-1 row-start-1 whitespace-nowrap",children:p},p)),e("span",{className:"col-start-1 row-start-1 whitespace-nowrap",children:m})]})]}),t("div",{className:"space-y-0.5 px-5 pb-2",children:[t("span",{"aria-live":"polite",className:"block h-5 truncate font-mono text-[12px] tabular-nums text-fg-muted dark:text-gray-400",children:[l+1," of ",Me.length," · you edit"," ",e("span",{className:Sn,children:ne.file})]}),e("span",{className:"block h-6 font-mono text-[12px] tabular-nums text-fg dark:text-gray-300",children:v})]}),e("div",{className:"px-5 pb-4",children:D}),t("div",{className:"border-t border-line px-5 py-3 text-[12px] leading-relaxed text-fg-faint dark:border-gray-800/80 dark:text-gray-500",children:["Same graph, three edits. Bun resolves the import graph once (skipping"," ",e("code",{children:"node_modules"}),"), then walks it backwards from whatever"," ",e("code",{children:"git diff"})," reports."]})]})}i();var Ln={note:"bun-linux-x64 stripped. Deltas from the four PRs cited in the '~20% smaller' section; end_mb from the #31200 measurement (72.2). start_mb = end_mb + Σdelta = 90.2 (prose: '~18 MB Linux x64 reduction'). rewrite delta = 18.0 â 11.6 â 2.0 â 0.8 = 3.6 (prose gives '3â8 MB depending on platform'). Windows #30219 omitted â different binary.",platform:"bun-linux-x64",start_mb:90.2,end_mb:72.2,beats:[{id:"icu",label:"zstd-compress ICU locale data",delta:11.6,pr:31200,color:"#f472b6"},{id:"rewrite",label:"Rust rewrite code size",delta:3.6,pr:30412,color:"#a78bfa"},{id:"trims",label:"six native-dep build trims",delta:2,pr:30098,color:"#fbbf24"},{id:"polyfills",label:"zstd-compress browser polyfills",delta:0.8,pr:31456,color:"#22d3ee"}]};var{start_mb:Ne,end_mb:Ie,beats:Ce,platform:Rn}=Ln,Hn=[],it=[];{let l=0;for(let d of Ce)Hn.push(Ie+l),l+=d.delta,it.push(l)}var pr=it[it.length-1],ns=Math.round(pr/Ne*100),as="cubic-bezier(0.22, 1, 0.36, 1)",Mn=500,Cn=850,Bn=250,ss={icu:"#ec4899",rewrite:"#8b5cf6",trims:"#f59e0b",polyfills:"#06b6d4"},os={icu:"#be185d",rewrite:"#6d28d9",trims:"#b45309",polyfills:"#0e7490"},An="â¶ play",dr="â» replay",$n=(l)=>`https://github.com/oven-sh/bun/pull/${l}`,In="text-fg-muted underline decoration-fg-faint hover:text-fg dark:decoration-neutral-700",is=` 31.bs-root .bs-cut { fill: var(--l); } 32.bs-root .bs-dot { color: var(--l); } 33@media (prefers-color-scheme: dark) { 34 .bs-root .bs-cut { fill: var(--d); } 35 .bs-root .bs-dot { color: var(--d); } 36} 37`;function ur(){let[l,d]=s(dr),[m,k]=y(),v=r(null),R=r(null),H=r(null),j=r(null),x=r(null),u=r(null),C=r([]),W=r([]),ee=r([]),Y=r(0),M=r(Ie),V=r(!1),K=r(!1),z=(D,ne)=>{ee.current.push(setTimeout(ne,D))},b=()=>{for(let D of ee.current)clearTimeout(D);ee.current=[],cancelAnimationFrame(Y.current)};function A(D,ne){let p=R.current;if(!p)return;cancelAnimationFrame(Y.current);let c=M.current,_=performance.now(),w=(ae)=>{let U=Math.min(1,(ae-_)/ne),oe=c+(D-c)*(1-Math.pow(1-U,3));if(M.current=oe,p.textContent=`${oe.toFixed(1)} MB`,U<1)Y.current=requestAnimationFrame(w)};Y.current=requestAnimationFrame(w)}function te(){let D=v.current;if(!D)return;for(let p of W.current)p.style.transition="none",p.style.transform="scaleX(1)";for(let p of C.current)p.style.transition="none",p.style.transform="translateX(0)";if(M.current=Ne,R.current)R.current.textContent=`${Ne.toFixed(1)} MB`;if(u.current)u.current.style.opacity="0";if(H.current)H.current.style.transition="none",H.current.style.opacity="0";D.getBoundingClientRect();let ne=`transform ${Mn}ms ${as}`;for(let p of W.current)p.style.transition=ne;for(let p of C.current)p.style.transition=ne;d(An)}function re(){if(K.current)return;b(),V.current=!0,te();for(let D=0;D<Ce.length;D++){let ne=Ce[D],p=Bn+D*Cn;z(p,()=>{let c=H.current,_=j.current,w=x.current;if(!c||!_||!w)return;c.style.transition="none",c.style.opacity="0",c.offsetHeight,_.style.setProperty("--l",os[ne.id]??ne.color),_.style.setProperty("--d",ne.color),w.textContent=`#${ne.pr} · ${ne.label} â${ne.delta.toFixed(1)} MB`,c.style.transition="opacity 200ms",c.style.opacity="1"}),z(p+150,()=>{let c=W.current[D];if(c)c.style.transform="scaleX(0)";for(let _=D+1;_<Ce.length;_++){let w=C.current[_];if(w)w.style.transform=`translateX(${-it[D]}px)`}A(Ne-it[D],Mn)})}z(Bn+Ce.length*Cn,()=>{if(H.current)H.current.style.opacity="0";let D=u.current;if(D)D.style.transition="opacity 300ms",D.style.opacity="1";d(dr),V.current=!1})}return a(()=>
37{if(!k)return;K.current=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1;let D=v.current;if(D)C.current=Array.from(D.querySelectorAll(".bs-seg")),W.current=Array.from(D.querySelectorAll(".bs-cut"));if(!K.current)re();return b},[k]),t("section",{ref:m,className:"bs-root not-prose relative my-10 -mx-4 overflow-hidden border-y border-line bg-surface text-fg sm:mx-0 sm:rounded-2xl sm:border dark:border-neutral-800 dark:bg-[#0b0c10] dark:text-neutral-300 lg:-mx-8 xl:-mx-24",style:{overflowAnchor:"none"},children:[e("style",{children:is}),t("div",{className:"px-5 pb-3 pt-5 sm:px-7",children:[t("div",{className:"font-mono text-[11px] uppercase tracking-[0.18em] text-fg-faint",children:[Rn," · stripped binary size"]}),t("div",{className:"mt-3 flex items-center justify-between gap-4",children:[e("span",{className:"font-mono text-[12px] text-fg-muted",children:"Bun 1.3 â 1.4"}),t("span",{ref:R,className:"inline-block min-w-[8ch] text-right font-mono text-[22px] font-bold tabular-nums text-accent dark:text-[#f472b6]",children:[Ie.toFixed(1)," MB"]}),t("button",{type:"button",onClick:()=>{if(!V.current)re()},className:"grid cursor-pointer rounded-md border border-line bg-subtle px-3 py-1.5 text-left font-mono text-[13px] text-fg transition-colors hover:border-line-strong hover:text-fg dark:border-neutral-700 dark:bg-neutral-800/60 dark:text-neutral-200 dark:hover:border-neutral-500 dark:hover:text-white",children:[e("span",{"aria-hidden":!0,className:"invisible col-start-1 row-start-1 whitespace-nowrap",children:An}),e("span",{"aria-hidden":!0,className:"invisible col-start-1 row-start-1 whitespace-nowrap",children:dr}),e("span",{className:"col-start-1 row-start-1 whitespace-nowrap",children:l})]})]})]}),e("div",{className:"px-5 pb-5 sm:px-7",children:t("div",{className:"relative h-[124px]",children:[e("div",{className:"relative h-7 font-mono text-[13px]",children:t("span",{ref:H,className:"absolute left-0 top-0 whitespace-nowrap text-fg dark:text-neutral-300",style:{opacity:0,transition:"opacity 200ms"},children:[e("span",{ref:j,className:"bs-dot mr-2",children:"â"}),e("span",{ref:x})]})}),t("svg",{ref:v,viewBox:`0 0 ${Ne} 14`,preserveAspectRatio:"none",className:"mt-3 block h-14 w-full rounded-md bg-subtle dark:bg-black",children:[e("rect",{className:"stroke-fg-faint dark:stroke-[#52525b]",x:0,y:1,width:Ne,height:12,rx:1,fill:"none",strokeWidth:0.3,strokeDasharray:"0.8 0.6",vectorEffect:"non-scaling-stroke"}),e("rect",{className:"bs-base fill-bar dark:fill-[#3f3f46]",x:0,y:1,width:Ie,height:12,rx:1,children:e("title",{children:`${Rn} v1.4 38${Ie.toFixed(1)} MB`})}),Ce.map((D,ne)=>e("g",{className:"bs-seg",style:{willChange:"transform",transform:`translateX(${-pr}px)`},children:e("rect",{className:"bs-cut",x:Hn[ne],y:1,width:D.delta,height:12,style:{"--l":ss[D.id]??D.color,"--d":D.color,transformBox:"fill-box",transformOrigin:"0 50%",willChange:"transform",transform:"scaleX(0)"},children:e("title",{children:`${D.label} 39â${D.delta.toFixed(1)} MB · PR #${D.pr}`})})},D.id)),e("line",{x1:Ne,y1:0,x2:Ne,y2:14,className:"stroke-fg-faint dark:stroke-[#71717a]",strokeWidth:0.15,vectorEffect:"non-scaling-stroke"})]}),t("div",{className:"relative mt-2 h-5 font-mono text-[11px] text-fg-faint",children:[t("span",{className:"absolute",style:{left:`${(Ie/Ne*100).toFixed(3)}%`,transform:"translateX(-50%)"},children:["â² ",Ie.toFixed(1)]}),t("span",{className:"absolute right-0 text-fg-muted",children:["â² ",Ne.toFixed(1)," · Bun 1.3"]})]}),t("span",{ref:u,className:"bs-coda absolute flex h-14 items-center font-mono text-[12px] font-semibold text-success dark:text-emerald-400",style:{right:0,top:40,opacity:1,transition:"opacity 300ms"},children:["â",pr.toFixed(1)," MB · ",ns,"% smaller"]})]})}),t("div",{className:"border-t border-line px-5 py-3 text-[12px] leading-relaxed text-fg-faint dark:border-neutral-800/80 sm:px-7",children:["Where the ~18 MB went, biggest first. ICU locale data alone is 11.6 MB â two-thirds of the win. Windows gets a further â4.8 MB from on-demand path buffers (",e("a",{href:$n(30219),className:In,children:"#30219"}),"), not shown here."," ",Ce.map((D,ne)=>t("span",{children:[t("a",{href:$n(D.pr),className:In,children:["#",D.pr]}),ne<Ce.length-1?" · ":"."]},D.id))]})]})}i();var ls={cli:"#f472b6",bundler:"#a78bfa",js:"#38bdf8",install:"#fbbf24",sql:"#f87171",napi:"#34d399"},cs={cli:"#ec4899",bundler:"#8b5cf6",js:"#0ea5e9",install:"#f59e0b",sql:"#ef4444",napi:"#10b981"},jn=[{name:"cli/run.test.ts",ms:320,dir:"cli"},{name:"cli/hot.test.ts",ms:480,dir:"cli"},{name:"cli/install.test.ts",ms:260,dir:"cli"},{name:"bundler/css.test.ts",ms:210,dir:"bundler"},{name:"sql/postgres.test.ts",ms:1820,dir:"sql"},{name:"bundler/esbuild.test.ts",ms:860,dir:"bundler"},{name:"bundler/loader.test.ts",ms:240,dir:"bundler"},{name:"bundler/splitting.test.ts",ms:410,dir:"bundler"},{name:"js/fetch.test.ts",ms:500,dir:"js"},{name:"js/streams.test.ts",ms:380,dir:"js"},{name:"js/buffer.test.ts",ms:170,dir:"js"},{name:"js/url.test.ts",ms:150,dir:"js"},{name:"js/timers.test.ts",ms:190,dir:"js"},{name:"js/crypto.test.ts",ms:300,dir:"js"},{name:"js/websocket.test.ts",ms:440,dir:"js"},{name:"install/registry.test.ts",ms:720,dir:"install"},{name:"install/lockfile.test.ts",ms:260,dir:"install"},{name:"install/lifecycle.test.ts",ms:180,dir:"install"},{name:"sql/sqlite.test.ts",ms:230,dir:"sql"},{name:"napi/basic.test.ts",ms:160,dir:"napi"},{name:"cli/test-runner.test.ts",ms:340,dir:"cli"},{name:"napi/threadsafe.test.ts",ms:290,dir:"napi"}
39,{name:"bundler/minify.test.ts",ms:370,dir:"bundler"},{name:"js/console.test.ts",ms:140,dir:"js"}],ft=4,Mt=420,ds=6000,Rt="var(--tp-done)",ps=` 40.tp-notrans * { transition: none !important; } 41.tp-root { --tp-done: rgb(var(--c-success)); } 42.tp-root .tp-chip { background: var(--l); } 43.tp-root .tp-head { background: rgb(var(--c-accent)); } 44.tp-root .tp-idle { background: repeating-linear-gradient(135deg, rgb(var(--c-fg) / 0.1) 0 6px, transparent 6px 12px); } 45@media (prefers-color-scheme: dark) { 46 .tp-root { --tp-done: #34d399; } 47 .tp-root .tp-chip { background: var(--d); } 48 .tp-root .tp-head { background: #fbf0df; box-shadow: 0 0 6px #fbf0df80; } 49 .tp-root .tp-idle { background: repeating-linear-gradient(135deg, #1c1f26 0 6px, transparent 6px 12px); } 50} 51`,fr=0,us=jn.map((l)=>{let d=fr;return fr+=l.ms,{...l,start:d}}),et=fr,lt=Array(ft).fill(0),ms=jn.map((l)=>{let d=0;for(let k=1;k<ft;k++)if(lt[k]<lt[d])d=k;let m=lt[d];return lt[d]=m+l.ms,{...l,lane:d,start:m}}),He=Math.max(...lt),fs=et/He,Dn=Mt/et,Ct=(l)=>l*Dn,bs=(l)=>Math.max(3,l*Dn-1),Qe=(l)=>(l/1000).toFixed(1)+"s",mr=["ⶠplay","⻠replay"];function Pn({f:l}){return e("div",{className:`tp-chip absolute left-0.5 right-0.5 rounded-sm ${l.ms>1000?"ring-1 ring-fg/25 dark:ring-white/25":""}`,style:{top:Ct(l.start),height:bs(l.ms),"--l":cs[l.dir],"--d":ls[l.dir],opacity:1,transition:"opacity .15s ease-out"},"data-t":l.start,title:`${l.name} · ${l.ms}ms`})}var _n=J(function({top:d,children:m,...k},v){return e("div",{ref:v,...k,className:"pointer-events-none absolute left-1/2 -translate-x-1/2 whitespace-nowrap rounded-md border border-emerald-200 bg-emerald-50/90 px-2 py-0.5 font-mono text-[11px] text-emerald-800 backdrop-blur-[2px] dark:border-emerald-400/40 dark:bg-emerald-950/70 dark:text-emerald-300",style:{to
51p:d,opacity:1,transition:"opacity .3s"},children:m})});function br(){let[l,d]=s(mr[0]),[m,k]=y(),v=r(null),R=r(null),H=r(null),j=r(null),x=r(null),u=r(null),C=r(null),W=r(null),ee=r(0),Y=r([]),M=r(!1);function V(b,A){R.current.style.transform=`translateY(${Ct(b)}px)`;for(let re of Y.current)re.style.opacity=+re.dataset.t<=b?"1":"0.12";H.current.textContent=Qe(b),j.current.textContent=Qe(Math.min(b,He));let te=b>=He;j.current.style.color=te?Rt:"",C.current.style.opacity=te?"1":"0",W.current.style.opacity=te?"0.5":"0",x.current.style.opacity=te?"1":"0",u.current.style.opacity=A?"1":"0",H.current.style.color=A?Rt:""}function K(){if(cancelAnimationFrame(ee.current),d(mr[1]),M.current)return V(et,!0);let b=performance.now(),A=(te)=>{let re=Math.min(1,(te-b)/ds);if(V(re*et,re>=1),re<1)ee.current=requestAnimationFrame(A)};ee.current=requestAnimationFrame(A)}function z(){if(!M.current){let b=m.current;b.classList.add("tp-notrans"),V(0,!1),b.offsetHeight,b.classList.remove("tp-notrans")}K()}return a(()=>{if(!k)return;return M.current=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1,Y.current=Array.from(v.current.querySelectorAll(".tp-chip")),z(),()=>cancelAnimationFrame(ee.current)},[k]),t("section",{ref:m,className:"tp-root not-prose relative my-10 -mx-4 overflow-hidden border-y border-line bg-surface text-fg sm:mx-0 sm:rounded-2xl sm:border dark:border-neutral-800 dark:bg-[#0b0c10] dark:text-neutral-300 lg:-mx-8 xl:-mx-24",style:{overflowAnchor:"none"},children:[e("style",{children:ps}),t("div",{className:"flex items-start justify-between gap-4 px-5 pt-5 sm:px-7",children:[e("span",{className:"font-mono text-[11px] uppercase tracking-[0.18em] text-fg-faint",children:"bun test --parallel · files go to whichever worker frees up"}),t("button",{type:"button",onClick:z,className:"grid rounded-md border border-line bg-subtle px-3 py-1.5 text-left font-mono text-[13px] text-fg transition-colors hover:border-line-strong hover:text-fg dark:border-neutral-700 dark:bg-neutral-800/60 dark:text-neutral-200 dark:hover:border-neutral-500 dark:hover:text-white",children:[mr.map((b)=>e("span",{"aria-hidden":!0,className:"invisible col-start-1 row-start-1 whitespace-nowrap",children:b},b)),e("span",{className:"col-start-1 row-start-1 whitespace-nowrap",children:l})]})]}),t("div",{className:"grid grid-cols-[3fr_5fr] gap-6 px-5 pb-4 pt-3 sm:px-7",children:[t("div",{children:[e("div",{className:"font-mono text-[11px] text-fg-faint",children:"bun test"}),e("span",{ref:H,className:"font-mono text-3xl font-bold tabular-nums sm:text-4xl",style:{minWidth:"5ch",display:"inline-block",color:Rt},children:Qe(et)})]}),t("div",{children:[t("div",{className:"font-mono text-[11px] text-fg-faint",children:["bun test --parallel=",ft]}),e("span",{ref:j,className:"font-mono text-3xl font-bold tabular-nums sm:text-4xl",style:{minWidth:"5ch",display:"inline-block",color:Rt},children:Qe(He)}),t("span",{ref:x,className:"ml-3 rounded-full border border-emerald-200 bg-emerald-50 px-2.5 py-0.5 font-mono text-[12px] text-emerald-800 dark:border-emerald-400/40 dark:bg-emerald-400/10 dark:text-emerald-300",style:{opacity:1,transition:"opacity .3s"},children:[fs.toFixed(1),"à faster"]})]})]}),t("div",{ref:v,className:"relative mx-5 mb-5 grid grid-cols-[3fr_5fr] gap-6 sm:mx-7",style:{height:Mt},children:[e("div",{ref:R,className:"tp-head pointer-events-none absolute left-0 right-0 top-0 z-10 h-[2px]",style:{willChange:"transform",transform:`translateY(${Mt}px)`}}),t("div",{className:"relative rounded-lg border border-line bg-subtle dark:border-neutral-800 dark:bg-black/40",children:[us.map((b,A)=>e(Pn,{f:b},A)),t(_n,{ref:u,top:Mt-22,children:["â done · ",Qe(et)]})]}),t("div",{className:"relative grid grid-cols-4 gap-1.5",children:[Array.from({length:ft},(b,A)=>t("div",{className:"relative rounded-lg border border-line bg-subtle dark:border-neutral-800 dark:bg-black/40",children:[ms.filter((te)=>te.lane===A).map((te,re)=>e(Pn,{f:te},re)),t("span",{className:"pointer-events-none absolute left-1/2 top-1 -translate-x-1/2 font-mono text-[9px] text-fg-faint dark:text-neutral-600",children:["w",A+1]})]},A)),e("div",{ref:W,className:"tp-idle pointer-events-none absolute inset-x-0",style:{to
51p:Ct(He),bottom:0,opacity:0.5,transition:"opacity .3s"}}),t(_n,{ref:C,top:Ct(He)+6,"aria-live":"polite",children:["â done · ",Qe(He)," · workers idle"]})]})]}),t("div",{className:"border-t border-line px-5 py-3 text-[12px] leading-relaxed text-fg-faint dark:border-neutral-800/80 sm:px-7",children:["Same 24 test files, same durations, one wall-clock."," ",t("code",{children:["--parallel=",ft]})," hands each file to whichever workerâs queue is shortest â so the 1.8s ",e("code",{children:"sql/postgres.test.ts"})," ","outlier ties up one lane while the other three keep going, and all four finish within ~7% of each other. Durations illustrative."," ",e("a",{href:"https://github.com/oven-sh/bun/pull/29354",className:"text-fg-muted underline decoration-fg-faint hover:text-fg dark:decoration-neutral-700",children:"#29354"})]})]})}i();var qn=160,xr=480,Bt=280,Fn=20,On=18,At=3,xs=1,gs=58,Wn=32553,hs="#f87171",ys=` 52.bp-root .bp-rss { color: var(--l, rgb(var(--c-fg))); } 53.bp-root .bp-fill { background: rgb(var(--c-accent)); } 54.bp-root .bp-chip { background: rgb(var(--c-fg)); } 55@media (prefers-color-scheme: dark) { 56 .bp-root .bp-rss { color: var(--d, #fbf0df); } 57 .bp-root .bp-fill { background: linear-gradient(to top, #a78bfa, #f472b6); } 58 .bp-root .bp-chip { background: #fbf0df; box-shadow: 0 0 8px #fbf0df88; } 59} 60`,$t="â¼ playingâ¦",Vn="â¶ Bun 1.4: see the fix",hr="â» replay",vs=["â¶ play",$t,Vn,hr],Yn="absolute max-w-[90%] rounded-md border px-2 py-1 font-mono text-[11px] leading-tight backdrop-blur-[2px]",gr=(l)=>{let d=64+l*gs;return d>=1000?`${(d/1000).toFixed(2)} GB`:`${d} MB`};function yr(){let[l,d]=s("â¶ play"),[m,k]=y(),v=r(null),R=r([]),H=r(void 0),j=r(!1),x=r("before"),u=r(0),C=r(!1),W=r(!1),ee=r(0),Y=r(0),M=r(!1),V=r([0,0]),K=r([0,0]),z=r([0,0]),b=r([0,0]),A=r(null),te=(X,G)=>{R.current.push(setTimeout(G,X))},re=()=>{for(let X of R.current)clearTimeout(X);R.current=[]};function D(){let X=m.current,G=(fe)=>X.querySelector(fe),le=(fe)=>Array.from(X.querySelectorAll(fe));A.current={fillEl:G(".bp-fill"),rss:G(".bp-rss"),v13:G(".bp-v13"),v14:G(".bp-v14"),hwm:G(".bp-hwm-line"),boom:G(".bp-boom"),pause:G(".bp-pause"),prod:G(".bp-prod"),cons:G(".bp-cons"),tank:G(".bp-tank"),pChips:le(".bp-chip-p"),cChips:le(".bp-chip-c")}}function ne(){let X=v.current,G=A.current;if(!X||!G)return;let le=X.getBoundingClientRect(),fe=(We)=>{let Ye=We.getBoundingClientRect();return{x:Ye.left-le.left,y:Ye.top-le.top,w:Ye.width,h:Ye.height}},je=fe(G.prod),xe=fe(G.tank),Ee=fe(G.cons);V.current=[je.x+je.w,je.y+je.h/2],K.current=[xe.x+xe.w/2,xe.y],z.current=[xe.x+xe.w/2,xe.y+xe.h],b.current=[Ee.x,Ee.y+Ee.h/2]}function p(X,[G,le],fe){X.style.transition=fe?`transform ${fe}ms cubic-bezier(0.4, 0, 0.3, 1)`:"none",X.style.transform=`translate(${G-5}px, ${le-5}px)`}let c=()=>{A.current.fillEl.style.transform=`scaleY(${u.current/Fn})`},_=()=>{A.current.rss.textContent=gr(u.current)};function w(){j.current=!1;let X=A.current;X.rss.style.setProperty("--l","rgb(var(--c-danger))"),X.rss.style.setProperty("--d",hs),X.boom.style.opacity="1",X.prod.style.opacity="0.3",X.cons.style.opacity="0.3",d(Vn)}function ae(){if(!j.current)return;let X=A.current;if(x.current==="after"&&u.current>=At){C.current=!0,X.prod.style.opacity="0.45",X.pause.style.opacity="1";return}let G=X.pChips[ee.current++%X.pChips.length];p(G,V.current,0),G.style.opacity="1",te(20,()=>p(G,K.current,Bt)),te(Bt,()=>{if(G.style.opacity="0",u.current++,c(),_(),x.current==="before"&&u.current>=On)w()}),te(qn,ae)}function U(){if(!j.current)return;let X=A.current;if(u.current>0){u.current--,c(),_();let G=X.cChips[Y.current++%X.cChips.length];p(G,z.current,0),G.style.opacity="1",te(20,()=>p(G,b.current,Bt)),te(Bt,()=>{G.style.opacity="0"})}if(x.current==="after"&&C.current&&u.current<=xs){if(C.current=!1,X.prod.style.opacity="1",X.pause.style.opacity="0",te(qn,ae),!W.current)W.current=!0,d(hr)}te(xr,U)}function oe(X){let G=A.current;if(!G)return;re(),j.current=!0,x.current=X,u.current=0,C.current=!1,W.current=!1,ee.current=0,Y.current=0,G.fillEl.style.transform="scaleY(0)";for(let le of G.pChips)le.style.opacity="0";for(let le of G.cChips)le.style.opacity="0";if(G.boom.style.opacity="0",G.pause.style.opacity="0",G.prod.style.opacity="1",G.cons.style.opacity="1",G.rss.textContent=gr(0),G.rss.style.removeProperty("--l"),G.rss.style.removeProperty("--d"),G.v13.style.opacity=X==="before"?"1":"0",G.v14.style.opacity=X==="before"?"0":"1",G.hwm.style.opacity=X==="after"?"1":"0",d($t),ne(),M.current){if(X==="before")u.current=On,c(),_(),w();else u.current=At,c(),_(),C.current=!0,G.prod.style.opacity="0.45",G.pause.style.opacity="1",j.current=!1,d(hr);return}te(200,ae),te(200+xr,U)}function ie(){if(j.current)return;oe(x.current==="before"?"after":"before")}return a(()=>
60{if(!k)return;M.current=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1,D(),ne();let X=()=>{clearTimeout(H.current),H.current=setTimeout(ne,150)};return window.addEventListener("resize",X),oe("before"),()=>{re(),clearTimeout(H.current),window.removeEventListener("resize",X)}},[k]),t("section",{ref:m,className:"bp-root not-prose relative my-10 -mx-4 overflow-hidden border-y border-line bg-surface text-fg-muted dark:border-neutral-800 dark:bg-[#0b0c10] dark:text-neutral-300 sm:mx-0 sm:rounded-2xl sm:border lg:-mx-8 xl:-mx-24",style:{overflowAnchor:"none"},children:[e("style",{children:ys}),t("div",{className:"px-5 pb-3 pt-5 sm:px-7",children:[e("div",{className:"font-mono text-[11px] uppercase tracking-[0.18em] text-fg-faint dark:text-neutral-500",children:"backpressure · Bun.serve ReadableStream"}),t("div",{className:"mt-3 flex flex-wrap items-center justify-between gap-x-6 gap-y-2",children:[t("span",{className:"font-mono text-[12px] font-semibold text-fg dark:text-neutral-300",children:["Bun"," ",t("span",{className:"relative inline-block w-[4ch] tabular-nums text-accent dark:text-[#f472b6]",children:[e("span",{className:"bp-v13 absolute inset-0",style:{opacity:0,transition:"opacity .25s"},children:"1.3"}),e("span",{className:"bp-v14 absolute inset-0",style:{opacity:1,transition:"opacity .25s"},children:"1.4"}),e("span",{className:"invisible",children:"1.4"})]})]}),t("span",{className:"font-mono text-[12px] text-fg-muted dark:text-neutral-400",children:["RSS"," ",e("span",{"aria-live":"polite",className:"bp-rss inline-block min-w-[8ch] text-right font-mono text-xl font-bold tabular-nums",style:{transition:"color .3s"},children:gr(At)})]}),t("button",{type:"button",onClick:ie,"aria-disabled":l===$t,className:`grid rounded-md border border-line bg-subtle px-3 py-1.5 text-left font-mono text-[13px] transition-colors dark:border-neutral-700 dark:bg-neutral-800/60 ${l===$t?"cursor-default text-fg-faint dark:text-neutral-500":"cursor-pointer text-fg hover:border-line-strong hover:text-fg dark:text-neutral-200 dark:hover:border-neutral-500 dark:hover:text-white"}`,children:[vs.map((X)=>e("span",{"aria-hidden":!0,className:"invisible col-start-1 row-start-1 whitespace-nowrap",children:X},X)),e("span",{className:"col-start-1 row-start-1 whitespace-nowrap",children:l})]})]})]}),t("div",{ref:v,className:"bp-flow relative flex items-center gap-3 px-5 pb-5 sm:gap-6 sm:px-7",style:{height:300},children:[t("div",{className:"relative min-w-0 flex-1",children:[t("div",{className:"bp-prod overflow-hidden rounded-lg border border-line bg-subtle px-3 py-3 dark:border-neutral-800 dark:bg-black/40",style:{transition:"opacity .25s"},children:[e("div",{className:"mb-2 font-mono text-[12px] font-semibold text-fg dark:text-neutral-300",children:"ReadableStream"}),t("div",{className:"overflow-hidden whitespace-pre font-mono text-[11px] leading-[1.7] text-fg-muted dark:text-neutral-500",children:[t("div",{children:["pull(controller) ","{"]}),t("div",{children:[" ","controller.enqueue(â¦65536)"]}),e("div",{children:"}"})]})]}),e("div",{className:`bp-pause ${Yn} inset-x-2 top-1/2 -translate-y-1/2 border-cyan-200 bg-cyan-50 text-cyan-800 dark:border-cyan-400/40 dark:bg-cyan-950/60 dark:text-cyan-200`,style:{opacity:1,transition:"opacity .3s"},children:"⸠waiting for socket to drain"})]}),e("span",{className:"shrink-0 text-fg-faint dark:text-neutral-600",children:"â"}),t("div",{className:"flex shrink-0 flex-col items-center gap-1.5",children:[e("span",{className:"font-mono text-[10px] uppercase tracking-[0.12em] text-fg-faint dark:text-neutral-500",children:"server heap"}),t("div",{className:"bp-tank relative h-[240px] w-[90px] overflow-hidden rounded-lg border border-line bg-subtle dark:border-neutral-700 dark:bg-black/50 sm:w-[110px]",children:[e("div",{className:"bp-fill absolute inset-0",style:{transformOrigin:"bottom",transform:`scaleY(${At/Fn})`,transition:"transform 180ms linear",willChange:"transform"}}),e("div",{className:"bp-oom-line absolute inset-x-0 border-t border-dashed border-danger dark:border-red-400/70",style:{to
60p:"10%"},children:e("span",{className:"absolute right-1 top-0.5 font-mono text-[9px] text-danger dark:text-red-300/80",children:"OOM"})}),e("div",{className:"bp-hwm-line absolute inset-x-0 border-t border-dashed border-info dark:border-cyan-400/70",style:{top:"85%",opacity:1,transition:"opacity .3s"},children:e("span",{className:"absolute right-1 top-0.5 font-mono text-[9px] text-info dark:text-cyan-300/80",children:"pause"})}),e("div",{className:`bp-boom ${Yn} inset-x-2 top-1/2 -translate-y-1/2 border-red-200 bg-red-50 text-center text-red-800 dark:border-red-400/50 dark:bg-red-950/70 dark:text-red-200`,style:{opacity:0,transition:"opacity .3s"},children:"\uD83D\uDCA5 process killed (OOM)"})]})]}),e("span",{className:"shrink-0 text-fg-faint dark:text-neutral-600",children:"â"}),t("div",{className:"bp-cons min-w-0 flex-1 overflow-hidden rounded-lg border border-line bg-subtle px-3 py-3 dark:border-neutral-800 dark:bg-black/40",style:{transition:"opacity .25s"},children:[e("div",{className:"mb-2 font-mono text-[12px] font-semibold text-fg dark:text-neutral-300",children:"slow client \uD83D\uDC0C"}),t("div",{className:"overflow-hidden font-mono text-[11px] leading-[1.7] text-fg-muted dark:text-neutral-500",children:[e("div",{className:"whitespace-pre",children:"for await (chunk of res.body)"}),t("div",{className:"mt-1 text-[10px] text-fg-faint dark:text-neutral-600",children:["reads every ",xr,"ms"]})]})]}),Array.from({length:6},(X,G)=>e("span",{className:"bp-chip bp-chip-p",style:{position:"absolute",left:0,top:0,width:10,height:10,borderRadius:3,opacity:0,willChange:"transform",pointerEvents:"none",zIndex:3}},`p${G}`)),Array.from({length:3},(X,G)=>e("span",{className:"bp-chip bp-chip-c",style:{position:"absolute",left:0,top:0,width:10,height:10,borderRadius:3,opacity:0,willChange:"transform",pointerEvents:"none",zIndex:3}},`c${G}`))]}),t("div",{className:"border-t border-line px-5 py-3 text-[12px] leading-relaxed text-fg-muted dark:border-neutral-800/80 dark:text-neutral-500 sm:px-7",children:["The streamâs ",e("code",{children:"pull()"})," outpaces a slow client 3:1. In Bun 1.3 the server buffered every unsent chunk on the heap until the process ran out of memory; in 1.4 ",e("code",{children:"pull()"})," pauses when the socketâs send buffer fills and resumes when it drains. Illustrative â each chip is a batch of 64 KB chunks; the ~1 GiB/s figure is from the"," ",t("a",{href:`https://github.com/oven-sh/bun/pull/${Wn}`,className:"text-fg-muted underline decoration-fg-faint hover:text-fg dark:text-neutral-400 dark:decoration-neutral-700 dark:hover:text-neutral-200",children:["#",Wn]})," ","repro."]})]})}i();var tt=[{id:"plain",label:"ascii",code:'"hello"',chips:[{label:"h",kind:"char",landCol:1},{label:"e",kind:"char",landCol:2},{label:"l",kind:"char",landCol:3},{label:"l",kind:"char",landCol:4},{label:"o",kind:"char",landCol:5}],shelf:{text:"hello",cols:5},codepoints:5,bytes:5,columns:5,note:"the easy case â one byte, one codepoint, one column each"},{id:"ansi",label:"ANSI color",code:'"\\x1b[31mhello\\x1b[0m"',chips:[{label:"â[31m",kind:"zero",absorbInto:1,cp:"CSI 31 m"},{label:"h",kind:"char",landCol:1},{label:"e",kind:"char",landCol:2},{label:"l",kind:"char",landCol:3},{label:"l",kind:"char",landCol:4},{label:"o",kind:"char",landCol:5},{label:"â[0m",kind:"zero",absorbInto:5,cp:"CSI 0 m"}],shelf:{text:"hello",cols:5,cls:"text-red-700 dark:text-red-400"},codepoints:14,bytes:14,columns:5,note:"ANSI escapes are invisible in a terminal â stringWidth strips them"},{id:"zwj",label:"ZWJ family",code:'"\uD83D\uDC68â\uD83D\uDC69â\uD83D\uDC67"',chips:[{label:"\uD83D\uDC68",kind:"joiner",cp:"U+1F468"},{label:"ZWJ",kind:"joiner",cp:"U+200D"},{label:"\uD83D\uDC69",kind:"joiner",cp:"U+1F469"},{label:"ZWJ",kind:"joiner",cp:"U+200D"},{label:"\uD83D\uDC67",kind:"joiner",cp:"U+1F467"}],shelf:{text:"\uD83D\uDC68â\uD83D\uDC69â\uD83D\uDC67",cols:2},codepoints:5,bytes:18,columns:2,note:"zero-width joiners fuse three emoji into one grapheme â terminals give it 2 columns"},{id:"flag",label:"flag",code:'"\uD83C\uDDFA\uD83C\uDDF8"',chips:[{label:"\uD83C\uDDFA",kind:"joiner",cp:"U+1F1FA"},{label:"\uD83C\uDDF8",kind:"joiner",cp:"U+1F1F8"}],shelf:{text:"\uD83C\uDDFA\uD83C\uDDF8",cols:2},codepoints:2,bytes:8,columns:2,note:"regional indicators U + S pair into one flag â still 2
60columns"},{id:"link",label:"OSC 8 hyperlink",code:'"\\x1b]8;;https://bun.sh\\x07Bun\\x1b]8;;\\x07"',chips:[{label:"â]8;â¦â",kind:"zero",absorbInto:1,cp:"OSC 8 ;; https://bun.sh BEL"},{label:"B",kind:"char",landCol:1},{label:"u",kind:"char",landCol:2},{label:"n",kind:"char",landCol:3},{label:"â]8;;â",kind:"zero",absorbInto:3,cp:"OSC 8 ;; BEL"}],shelf:{text:"Bun",cols:3,cls:"text-sky-700 underline decoration-sky-700/50 dark:text-sky-300 dark:decoration-sky-300/50"},codepoints:29,bytes:29,columns:3,note:"OSC 8 wraps a hyperlink around the text â only the anchor 'Bun' has width"}],Pe=tt.length,zn=6,vr=28,ks=152,ws=28,Ns=100,It=450,Gn="cubic-bezier(0.3, 0, 0.3, 1)",Ts="var(--sw-pink)",Xn="var(--sw-pink-text)",Es="var(--sw-pink-glow)",kr="var(--sw-lit)",Ss=` 61.sw-root { --sw-pink: rgb(var(--c-accent)); --sw-pink-text: rgb(var(--c-accent-strong)); --sw-pink-glow: none; --sw-lit: rgb(var(--c-fg)); } 62@media (prefers-color-scheme: dark) { 63 .sw-root { --sw-pink: #f472b6; --sw-pink-text: #f472b6; --sw-pink-glow: 0 0 6px #f472b688; --sw-lit: #e5e5e5; } 64} 65`,Ht="â¼ playingâ¦",Ls=["â¶ play","â» replay",Ht,...tt.slice(1).map((l)=>`â¶ next · ${l.label}`)],Rs={char:"border-line bg-subtle text-fg dark:border-neutral-600 dar
65k:bg-neutral-800/60 dark:text-neutral-200",zero:"border-violet-200 bg-violet-50 text-violet-800 dark:border-violet-700/60 dark:bg-violet-950/40 dark:text-violet-300",joiner:"border-amber-200 bg-amber-50 text-amber-800 dark:border-amber-700/60 dark:bg-amber-950/40 dark:text-amber-300"};function wr(){let[l,d]=s(`example 1 of ${Pe} · ${tt[0].label}`),[m,k]=s("ⶠplay"),[v,R]=y(),H=r(null),j=r([]),x=r([]),u=r(void 0),C=r(!1),W=r(0),ee=r(!1),Y=r(!1),M=(c,_)=>{j.current.push(setTimeout(_,c))},V=()=>{for(let c of j.current)clearTimeout(c);j.current=[];for(let c of x.current)cancelAnimationFrame(c);x.current=[]};function K(c,_,w){if(!c)return;let ae=performance.now(),U=(oe)=>{let ie=Math.min(1,(oe-ae)/w),X=1-Math.pow(1-ie,3);if(c.textContent=String(Math.round(X*_)),ie<1)x.current.push(requestAnimationFrame(U))};x.current.push(requestAnimationFrame(U))}let z=()=>H.current?Array.from(H.current.querySelectorAll(".sw-pane")):[];function b(){let c=H.current;if(!c)return;let _=0;for(let w of z()){let ae=w.style.display;w.style.display="",_=Math.max(_,w.offsetHeight),w.style.display=ae}c.style.minHeight=`${_}px`}function A(c){for(let oe of c.querySelectorAll(".sw-chip"))oe.style.transition="none",oe.style.transform="none",oe.style.opacity="1",oe.offsetHeight;let _=c.querySelector(".sw-shelf");if(_)_.style.transition="none",_.style.opacity="0";let w=c.querySelector(".sw-bar");if(w)w.style.transition="none",w.style.transform="scaleX(0)";for(let oe of c.querySelectorAll(".sw-tick"))oe.style.color="";for(let oe of[".sw-cp",".sw-by",".sw-co"]){let ie=c.querySelector(oe);if(ie)ie.textContent="·"}let ae=c.querySelector(".sw-co-wrap");if(ae)ae.style.opacity="0.4";let U=c.querySelector(".sw-ret");if(U)U.style.opacity="0"}function te(c,_){let w=c.querySelector(".sw-shelf");if(w)w.style.opacity="1";let ae=c.querySelector(".sw-bar");if(ae)ae.style.transform="scaleX(1)";let U=c.querySelectorAll(".sw-tick");for(let fe=0;fe<_.columns;fe++)if(U[fe])U[fe].style.color=kr;let oe=c.querySelector(".sw-cp"),ie=c.querySelector(".sw-by"),X=c.querySelector(".sw-co");if(oe)oe.textContent=String(_.codepoints);if(ie)ie.textContent=String(_.bytes);if(X)X.textContent=String(_.columns);let G=c.querySelector(".sw-co-wrap");if(G)G.style.opacity="1";let le=c.querySelector(".sw-ret");if(le)le.style.opacity="1"}function re(c){C.current=!1,k(c+1<Pe?`ⶠnext · ${tt[c+1].label}`:"⻠replay")}function D(c){if(!H.current)return;V(),C.current=!0,ee.current=!0,W.current=c,k(Ht);let w=z();w.forEach((xe,Ee)=>{xe.style.display=Ee===c?"":"none"});let ae=w[c],U=tt[c];if(d(`example ${c+1} of ${Pe} · ${U.label}`),A(ae),Y.current){te(ae,U),re(c);return}let oe=ae.querySelector(".sw-arena"),ie=ae.querySelector(".sw-shelf"),X=ae.querySelector(".sw-bar"),G=Array.from(ae.querySelectorAll(".sw-tick")),le=Array.from(ae.querySelectorAll(".sw-chip")),fe=ae.querySelector(".sw-co-wrap"),je=ae.querySelector(".sw-ret");M(100,()=>K(ae.querySelector(".sw-cp"),U.codepoints,300)),M(350,()=>K(ae.querySelector(".sw-by"),U.bytes,300)),M(600,()=>{let xe=oe.getBoundingClientRect(),Ee=(ye)=>{let ze=ye.getBoundingClientRect();return{x:ze.left-xe.left+ze.width/2,y:ze.top-xe.top+ze.height/2}},We=(ye)=>Ee(G[ye-1]).x,Ye=(We(1)+We(U.columns))/2,sa=ws+16;U.chips.forEach((ye,ze)=>{let rt=le[ze];if(!rt)return;let qr=Ee(rt),bt;if(ye.kind==="char")bt=We(ye.landCol);else if(ye.kind==="zero")bt=We(U.chips[ye.absorbInto].landCol);else bt=Ye;let oa=bt-qr.x,ia=sa-qr.y,la=ye.kind==="char"?It-100:It/3;rt.style.transition=`transform ${It}ms ${Gn}, opacity 250ms ease-out ${la}ms`,rt.style.transform=`translate(${oa}px, ${ia}px)${ye.kind!=="char"?" scale(0.5)":""}`,rt.style.opacity="0"})}),M(600+It-120,()=>{ie.style.transition="opacity 250ms ease-out",ie.style.opacity="1",X.style.transition=`transform 300ms ${Gn}`,X.style.transform="scaleX(1)";for(let xe=0;xe<U.columns;xe++)G[xe].style.color=kr}),M(1150,()=>{K(ae.querySelector(".sw-co"),U.columns,250),fe.style.opacity="1"}),M(1300,()=>{je.style.opacity="1"}),M(1500,()=>re(c))}function ne(){if(C.current)return;D(ee.current?(W.current+1)%Pe:0)}function p(c){if(C.current)return;if(c.key==="ArrowRight"||c.key==="ArrowDown")c.preventDefault(),D(ee.current?(W.current+1)%Pe:0);else if(c.key==="ArrowLeft"||c.key==="ArrowUp")c.preventDefault(),D((W.current-1+Pe)%Pe)}return a(()=>
65{if(!R)return;Y.current=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1,b();let c=()=>{clearTimeout(u.current),u.current=setTimeout(b,150)};return window.addEventListener("resize",c),D(0),()=>{V(),clearTimeout(u.current),window.removeEventListener("resize",c)}},[R]),t("section",{ref:v,tabIndex:0,onKeyDown:p,className:"sw-root not-prose relative my-10 -mx-4 overflow-hidden border-y border-line bg-surface text-fg-muted outline-none dark:border-neutral-800 dark:bg-[#0b0c10] dark:text-neutral-300 sm:mx-0 sm:rounded-2xl sm:border lg:-mx-8 xl:-mx-24",style:{overflowAnchor:"none"},children:[e("style",{children:Ss}),t("div",{className:"px-5 pb-3 pt-5 sm:px-7",children:[e("div",{className:"font-mono text-[11px] uppercase tracking-[0.18em] text-fg-faint dark:text-neutral-500",children:"Bun.stringWidth · terminal columns"}),t("div",{className:"mt-3 flex flex-wrap items-center justify-between gap-x-4 gap-y-2",children:[e("span",{"aria-live":"polite",className:"min-w-[16ch] flex-1 truncate font-mono text-[12px] tabular-nums text-fg-muted dark:text-neutral-400",children:l}),t("button",{type:"button",onClick:ne,"aria-disabled":m===Ht,className:`grid rounded-md border border-line bg-subtle px-3 py-1.5 text-left font-mono text-[13px] transition-colors dark:border-neutral-700 dark:bg-neutral-800/60 ${m===Ht?"cursor-default text-fg-faint dark:text-neutral-500":"cursor-pointer text-fg hover:border-line-strong hover:text-fg dark:text-neutral-200 dark:hover:border-neutral-500 dark:hover:text-white"}`,children:[Ls.map((c)=>e("span",{"aria-hidden":!0,className:"invisible col-start-1 row-start-1 whitespace-nowrap",children:c},c)),e("span",{className:"col-start-1 row-start-1 whitespace-nowrap",children:m})]})]})]}),e("div",{ref:H,className:"sw-stage",children:tt.map((c,_)=>e(Ms,{ex:c,first:_===0},c.id))}),t("div",{className:"border-t border-line px-5 py-3 text-[12px] leading-relaxed text-fg-faint dark:border-neutral-800/80 dark:text-neutral-500 sm:px-7",children:["One string, four sizes."," ",e("code",{className:"text-fg-muted dark:text-neutral-400",children:"stringWidth"})," ","returns the last one â what a terminal actually draws. Same engine backs"," ",e("code",{className:"text-fg-muted dark:text-neutral-400",children:"Bun.sliceAnsi"}),","," ",e("code",{className:"text-fg-muted dark:text-neutral-400",children:"Bun.wrapAnsi"}),","," ",e("code",{className:"text-fg-muted dark:text-neutral-400",children:"console.table"}),", and"," ",e("code",{className:"text-fg-muted dark:text-neutral-400",children:"readline"}),"."," ",e("a",{href:"https://github.com/oven-sh/bun/pull/25447",className:"text-fg-muted underline decoration-line-strong/30 hover:text-fg dark:text-neutral-400 dark:decoration-neutral-700 dark:hover:text-neutral-200",children:"#25447"})]})]})}function Ms({ex:l,first:d}){let m=zn*vr,k=l.chips.every((v)=>v.kind==="joiner");return t("div",{className:"sw-pane px-5 pb-5 sm:px-7",style:d?void 0:{display:"none"},children:[t("div",{className:"relative break-all pr-14 font-mono text-[12.5px]",children:[e("span",{className:"text-fg-faint dark:text-neutral-500",children:"Bun.stringWidth("}),e("span",{className:"text-fg dark:text-neutral-200",children:l.code}),e("span",{className:"text-fg-faint dark:text-neutral-500",children:")"}),t("span",{className:"sw-ret absolute right-0 top-0 tabular-nums text-success dark:text-emerald-400",style:{opacity:1,transition:"opacity 200ms ease-out"},children:["// ",l.columns]})]}),t("div",{className:"sw-arena relative mt-4 overflow-hidden",style:{height:ks},children:[t("div",{className:"absolute top-0",style:{left:"50%",width:m,marginLeft:-m/2},children:[e("div",{className:"sw-ticks flex",children:Array.from({length:zn},(v,R)=>e("span",{className:"sw-tick w-7 text-center font-mono text-[10px] tabular-nums text-fg-faint transition-colors dark:text-neutral-500",style:R<l.columns?{color:kr}:void 0,children:R+1},R))}),e("div",{className:"sw-bar absolute h-[2px]",style:{top:22,left:0,width:l.columns*vr,background:Ts,boxShadow:Es,transformOrigin:"left",transform:"scaleX(1)",willChange:"transform"}}),e("div",{className:`sw-shelf absolute left-0 font-mono text-[15px] ${l.shelf.cls??"text-fg dark:text-neutral-100"}
65`,style:{top:30,opacity:1},children:k?e("span",{className:"inline-block text-center",style:{width:l.shelf.cols*vr},children:l.shelf.text}):[...l.shelf.text].map((v,R)=>e("span",{className:"inline-block w-7 text-center",children:v},R))})]}),e("div",{className:"sw-raw absolute inset-x-0 flex flex-nowrap justify-center gap-1.5",style:{top:Ns},children:l.chips.map((v,R)=>e("span",{title:v.cp,className:`sw-chip relative whitespace-nowrap rounded border px-1.5 py-0.5 font-mono text-[11px] will-change-transform ${Rs[v.kind]}`,children:v.label},R))}),e("div",{className:"sw-rawlbl absolute inset-x-0 text-center font-mono text-[10px] uppercase tracking-wider text-fg-faint dark:text-neutral-500",style:{top:134},children:"codepoints"})]}),t("div",{className:"mt-3 font-mono text-[12px] text-fg-muted dark:text-neutral-400",children:[t("span",{className:"inline-flex items-baseline gap-1",children:["codepoints:",e("b",{className:"sw-cp inline-block min-w-[2ch] text-right font-normal tabular-nums text-fg dark:text-neutral-100",children:l.codepoints})]}),e("span",{className:"mx-1.5 text-fg-faint dark:text-neutral-600",children:"·"}),t("span",{className:"inline-flex items-baseline gap-1",children:["bytes:",e("b",{className:"sw-by inline-block min-w-[2ch] text-right font-normal tabular-nums text-fg dark:text-neutral-100",children:l.bytes})]}),e("span",{className:"mx-1.5 text-fg-faint dark:text-neutral-600",children:"·"}),t("span",{className:"sw-co-wrap inline-flex items-baseline gap-1",style:{color:Xn,opacity:1,transition:"opacity 250ms ease-out"},children:["columns:",e("b",{className:"sw-co inline-block min-w-[2ch] text-right font-normal tabular-nums",style:{color:Xn},children:l.columns})]})]}),e("div",{className:"mt-1 text-[11.5px] leading-snug text-fg-faint dark:text-neutral-500",children:l.note})]})}i();var Kn={origBytes:595432,webpBytes:127122,note:"Generated by scripts/bun-v1.4-image-data.ts from hero.jpg on 2026-07-15 with Bun 1.3.14. Bytes are real output of the exact chain in the blog code sample."};var{origBytes:Un,webpBytes:Nr}=Kn,Bs={kw:"text-[var(--sk-keyword)] dark:text-[#ff79c6]",cls:"text-[var(--sk-type)] dark:text-[#8be9fd]",fn:"text-[var(--sk-fn)] dark:text-[#50fa7b]",str:"text-[var(--sk-string)] dark:text-[#f1fa8c]",num:"text-[var(--sk-const)] dark:text-[#bd93f9]",pn:"text-[var(--sk-text)] dark:text-[#f8f8f2]"},As=[[["await ","kw"],["Bun","cls"],[".","pn"],["file","fn"],["(","pn"],['"photo.jpg"',"str"],[")","pn"]],[[" .","pn"],["image","fn"],["()","pn"]],[[" .","pn"],["resize","fn"],["(","pn"],["1024","num"],[", ","pn"],["1024","num"],[", { ","pn"],["fit","pn"],[": ","pn"],['"inside"',"str"],[" })","pn"]],[[" .","pn"],["rotate","fn"],["(","pn"],["90","num"],[")","pn"]],[[" .","pn"],["webp","fn"],["({ ","pn"],["quality","pn"],[": ","pn"],["85","num"],[" })","pn"]],[[" .","pn"],["write","fn"],["(","pn"],['"thumb.webp"',"str"],[");","pn"]]],_e=20,Be=900,$s=250,Is=550,Hs=700,Jn=500,Pt=0.58,Tr="cubic-bezier(0.22,1,0.36,1)",Ps="#fbf0df",jt="â¼ playingâ¦",_s=["â¶ play",jt,"â» replay"],js="/images/blog/bun-1.4/image-pipeline-src.svg",_t=(l)=>l>=1e6?`${(l/1e6).toFixed(1)} MB`:`${Math.round(l/1024)} KB`;function Er(){let[l,d]=s("â¶ play"),[m,k]=y(),v=r(null),R=r(null),H=r(null),j=r([]),x=r(void 0),u=r(!1),C=r(!1),W=(z,b)=>{j.current.push(setTimeout(b,z))},ee=()=>{for(let z of j.current)clearTimeout(z);j.current=[]},Y=(z)=>v.current.querySelector(z);function M(){let z=R.current;if(z)z.style.setProperty("--scan-h",`${z.offsetHeight}px`)}function V(z,b,A,te){let re=performance.now(),D=(ne)=>{let p=Math.min(1,(ne-re)/te),c=1-Math.pow(1-p,3);if(z.textContent=_t(Math.round(b+(A-b)*c)),p<1)requestAnimationFrame(D)};requestAnimationFrame(D)}function K(){if(u.current||!v.current)return;let z=H.current;if(z&&!z.complete){z.onload=K;return}ee(),u.current=!0,d(jt);let b=Y(".ip-cursor"),A=Y(".ip-img"),te=Y(".ip-jpg"),re=Y(".ip-webp"),D=Y(".ip-size"),ne=Y(".ip-scan"),p=Y(".ip-out");if(C.current){b.style.transition="none",b.style.transform=`translateY(${5*_e}px)`,A.style.transition="none",A.style.transform=`scale(${Pt}) rotate(90deg)`,te.style.opacity="0",re.style.opacity="1",D.textContent=_t(Nr),ne.style.opacity="0",p.style.opacity="1",p.style.transform="none",u.current=!1,d("â» replay");return}b.style.transition="none",b.style.transform=`translateY(${1*_e}px)`,b.offsetHeight,A.style.transition="none",A.style.transform="scale(1) rotate(0deg)",A.offsetHeight,te.style.opacity="1",re.style.opacity="0",D.textContent=_t(Un),ne.style.transition="none",ne.style.opacity="0",ne.style.transform="translateY(0)",p.style.transition="none",p.style.opacity="0",p.style.transform="translateY(4px)",W(150,()=>{b.style.transition=`transform ${$s}ms ${Tr}`,b.style.transform=`translateY(${2*_e}px)`}),W(200,()=>{A.style.transition=`transform ${Is}ms ${Tr}`,A.style.transform=`scale(${Pt}) rotate(0deg)`}),W(150+Be,()=>{b.style.transform=`translateY(${3*_e}px)`}),W(200+Be,()=>{A.style.transform=`scale(${Pt}) rotate(90deg)`}),W(150+2*Be,()=>{b.style.transform=`translateY(${4*_e}px)`}),W(200+2*Be,()=>{te.style.transition="opacity 250ms",te.style.opacity="0",re.style.transition="opacity 250ms",re.style.opacity="1",ne.style.transition=`transform ${Jn}ms linear, opacity 150ms`,ne.style.opacity="0.7",ne.style.transform="translateY(var(--scan-h))",V(D,Un,Nr,Hs)}),W(200+2*Be+Jn,()=>{ne.style.opacity="0"}),W(150+3*Be,()=>{b.style.transform=`translateY(${5*_e}px)`}),W(200+3*Be,()=>{p.style.transition=`opacity 300ms, transform 300ms ${Tr}`,p.style.opacity="1",p.style.transform="none"}),W(150+4*Be,()=>{u.current=!1,d("â» replay")})}return a(()=>
65{if(!k)return;C.current=window.matchMedia?.("(prefers-reduced-motion: reduce)").matches??!1,M();let z=()=>{clearTimeout(x.current),x.current=setTimeout(M,150)};return window.addEventListener("resize",z),K(),()=>{ee(),clearTimeout(x.current),window.removeEventListener("resize",z)}},[k]),t("section",{ref:m,className:"not-prose relative my-10 -mx-4 overflow-hidden border-y border-line bg-surface text-fg dark:border-neutral-800 dark:bg-[#0b0c10] dark:text-neutral-300 sm:mx-0 sm:rounded-2xl sm:border lg:-mx-8 xl:-mx-24",style:{overflowAnchor:"none"},children:[t("div",{className:"px-5 pb-3 pt-5 sm:px-7",children:[e("div",{className:"font-mono text-[11px] uppercase tracking-[0.18em] text-fg-faint",children:"Bun.Image · decode â resize â rotate â encode"}),t("div",{className:"mt-3 flex flex-wrap items-center justify-between gap-x-4 gap-y-2",children:[e("span",{className:"font-mono text-[12px] text-fg-muted",children:"photo.jpg â thumb.webp"}),t("button",{type:"button",onClick:K,"aria-label":"Replay Bun.Image pipeline demo","aria-disabled":l===jt,className:`grid rounded-md border border-line bg-subtle px-3 py-1.5 text-left font-mono text-[13px] transition-colors dark:border-neutral-700 dark:bg-neutral-800/60 ${l===jt?"cursor-default text-fg-faint":"cursor-pointer text-fg hover:border-line-strong dark:text-neutral-200 dark:hover:border-neutral-500 dark:hover:text-white"}`,children:[_s.map((z)=>e("span",{"aria-hidden":!0,className:"invisible col-start-1 row-start-1 whitespace-nowrap",children:z},z)),e("span",{className:"col-start-1 row-start-1 whitespace-nowrap",children:l})]})]})]}),t("div",{ref:v,className:"ip-stage grid gap-5 px-5 pb-5 sm:grid-cols-2 sm:items-start sm:px-7",children:[t("div",{className:"relative overflow-x-auto rounded-lg border border-line bg-code-bg px-3 py-3 font-mono text-[12.5px] leading-[1.6] dark:border-neutral-800 dark:bg-black/40",children:[As.map((z,b)=>e("div",{className:"whitespace-pre",children:z.map(([A,te],re)=>e("span",{className:Bs[te],children:A},re))},b)),e("div",{className:"ip-cursor absolute left-0 right-0 top-3 h-[20px] border-l-2 border-accent bg-accent/[0.08] dark:border-[#fbf0df] dark:bg-[#fbf0df]/[0.08]",style:{willChange:"transform",transform:`translateY(${5*_e}px)`}})]}),t("div",{children:[t("div",{ref:R,className:"relative aspect-[4/3] max-h-[300px] w-full overflow-hidden rounded-lg border border-line bg-slab dark:border-neutral-800 dark:bg-neutral-900",children:[e("img",{ref:H,src:js,alt:"Sample image (Bun mascot on a cream card) being resized, rotated, and re-encoded by Bun.Image",width:640,height:480,loading:"lazy",className:"ip-img absolute inset-0 h-full w-full object-cover",style:{willChange:"transform",transformOrigin:"center center",transform:`scale(${Pt}) rotate(90deg)`}}),e("div",{className:"ip-scan absolute inset-x-0 top-0 h-[2px] shadow-[0_0_8px_#fbf0df]",style:{background:`${Ps}b3`,opacity:0}
65})]}),t("div",{className:"mt-3 flex h-9 items-center gap-3 font-mono text-[12px]",children:[t("span",{className:"relative inline-grid w-[4.5ch]",children:[e("span",{"aria-hidden":!0,className:"invisible col-start-1 row-start-1",children:"JPEG"}),e("span",{className:"ip-jpg col-start-1 row-start-1 text-fg-muted",style:{opacity:0},children:"JPEG"}),e("span",{className:"ip-webp col-start-1 row-start-1 text-success dark:text-[#50fa7b]",style:{opacity:1},children:"WEBP"})]}),e("span",{className:"text-fg-faint dark:text-neutral-600",children:"·"}),e("span",{"aria-live":"polite",className:"ip-size inline-block min-w-[7ch] text-right tabular-nums text-fg dark:text-neutral-200",children:_t(Nr)}),e("span",{className:"flex-1"}),e("span",{className:"ip-out text-success dark:text-[#50fa7b]",style:{opacity:1,transform:"none"},children:"â thumb.webp"})]})]})]}),t("div",{className:"border-t border-line px-5 py-3 text-[12px] leading-relaxed text-fg-faint dark:border-neutral-800/80 sm:px-7",children:["zero ",e("code",{children:"npm install"})," · 1.38à faster than sharp on decodeâresizeâencode ·"," ",e("a",{href:"https://github.com/oven-sh/bun/pull/30032",className:"text-fg-muted underline decoration-fg-faint/50 hover:text-fg dark:text-neutral-400 dark:decoration-neutral-700 dark:hover:text-neutral-200",children:"#30032"})]})]})}var Ds=[{t:40,prefix:"build:client",text:"$ bun build src/client.ts --outdir=dist/client --minify",cls:"text-fg-faint dark:text-neutral-500"},{t:55,prefix:"build:server",text:"$ bun build src/server.ts --outdir=dist/server --target=bun",cls:"text-fg-faint dark:text-neutral-500"},{t:70,prefix:"build:worker",text:"$ bun build src/worker.ts --outdir=dist/worker --target=bun",cls:"text-fg-faint dark:text-neutral-500"},{t:85,prefix:"build:styles",text:"$ bun run src/build-styles.ts",cls:"text-fg-faint dark:text-neutral-500"},{t:110,prefix:"build:client",text:"Bundled 1 module in 4ms"},{t:118,prefix:"build:server",text:"Bundled 1 module in 4ms"},{t:125,prefix:"build:client",text:" client.js 69 B (entry point)",cls:"text-fg-muted dark:text-neutral-400"},{t:130,prefix:"build:worker",text:"Bundled 1 module in 3ms"},{t:138,prefix:"build:server",text:" server.js 153 B (entry point)",cls:"text-fg-muted dark:text-neutral-400"},{t:145,prefix:"build:client",text:"Done in 25ms",cls:"text-success dark:text-emerald-400"},{t:152,prefix:"build:worker",text:" worker.js 98 B (entry point)",cls:"text-fg-muted dark:text-neutral-400"},{t:160,prefix:"build:server",text:"Done in 32ms",cls:"text-success dark:text-emerald-400"},{t:168,prefix:"build:worker",text:"Done in 34ms",cls:"text-success dark:text-emerald-400"},{t:210,prefix:"build:styles",text:"compiled base.css"},{t:340,prefix:"build:styles",text:"compiled components.css"},{t:455,prefix:"build:styles",text:"compiled utilities.css"},{t:560,prefix:"build:styles",text:"compiled theme.css"},{t:580,prefix:"build:styles",text:"â 4 stylesheets â dist/styles.css",cls:"text-success dark:text-emerald-400"},{t:600,prefix:"build:styles",text:"Done in 560ms",cls:"text-success dark:text-emerald-400"}];function Sr(){return e(gt,{command:'bun run --parallel "build:*"',lines:Ds,rows:20,speed:0.6})}var qs=[{t:0,text:"Welcome to Bun v1.4.0",cls:"text-fg-faint dark:text-neutral-500"},{t:50,text:'Type ".help" for more information.',cls:"text-fg-faint dark:text-neutral-500"},{t:600,text:"> { a: 1 }",cls:"text-fg dark:text-neutral-300"},{t:700,text:"{ a: 1 }",cls:"text-warning dark:text-amber-300"},{t:1500,text:'> await fetch("https://bun.sh").then(r => r.status)',cls:"text-fg dark:text-neutral-300"},{t:1900,text:"200",cls:"text-warning dark:text-amber-300"},{t:2400,text:"> _",cls:"text-fg dark:text-neutral-300"},{t:2480,text:"200",cls:"text-warning dark:text-amber-300"}];function Lr(){return e(gt,{command:"bun repl",lines:qs,rows:10,speed:1})}function Rr(){return e(Ot,{})}function Mr(){return e(Xt,{})}function Cr(){return e(rr,{})}function Br(){return e(yr,{})}function Ar(){return e(Er,{})}function $r(){return e(br,{})}function Ir(){return e(ar,{})}function Hr(){return e(cr,{})}function Pr(){return e(wr,{})}function _r(){return e(ur,{})}function jr(){return e(Qt,{})}i();var Qn={};f(Qn,{default:()=>Dt});function Dt({src:l,poster:d,width:m,height:k,label:v}){let[R,H]=y({rootMargin:"200px 0px"}),j=r(!1);return a(()=>{let x=R.current;if(!x||!H||j.current)return;j.current=!0,x.src=l,x.play().catch(()=>{})},[H,l]),e("video",{ref:R,preload:"none",poster:d,width:m,height:k,muted:!0,loop:!0,playsInl
65ine:!0,"aria-label":v,className:"my-7 block h-auto w-full md:rounded-xl"})}i();var ea={};f(ea,{default:()=>qt});function qt({height:l=320,label:d="Expand",children:m}){let[k,v]=s(!1);return t("div",{className:"expandable my-[1.25em]",children:[t("div",{className:"relative",children:[e("div",{className:"[&_.CodeBlock]:!my-0 [&_.CodeBlock]:rounded-b-none [&_.CodeBlock]:border-b-0 [&_.CodeBlock+.CodeBlock]:rounded-t-none",style:k?void 0:{maxHeight:l,overflow:"hidden"},children:m}),k?null:e("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-x-0 bottom-0 h-24",style:{background:"linear-gradient(to bottom, rgb(var(--c-code-bg) / 0), rgb(var(--c-code-bg)))"}})]}),t("button",{type:"button",onClick:()=>v((R)=>!R),className:"flex w-full cursor-pointer items-center justify-center gap-2 rounded-b-xl border border-t-0 border-line bg-code-bg px-3.5 py-2.5 text-[13px] font-medium text-fg-muted transition-colors hover:text-fg",children:[e("svg",{viewBox:"0 0 16 16",className:"h-3.5 w-3.5 transition-transform "+(k?"rotate-180":""),fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:e("path",{d:"M3 6l5 5 5-5"})}),k?"Collapse":d]})]})}var ta=L(!1);function Fs({block:l}){return e(F,{block:l})}function De(l){let d=q({html:l.html,h:l.h}),m=r(null),k=r(void 0);return a(()=>{let v=m.current,R=k.current===void 0,H=R&&v!==null&&Ke(v),j=!R&&k.current===d.html;if(k.current=d.html??"",v&&!H&&!j)Ge(v)},[d.html]),e("div",{ref:m,className:"server-html",...Z(d),dangerouslySetInnerHTML:{__html:d.html??""},suppressHydrationWarning:!0})}function Oe(l){return t("details",{className:"details group my-[1.25em] overflow-hidden rounded-xl border border-line bg-surface text-[93%] open:",children:[t("summary",{className:"flex cursor-pointer select-none list-none items-center gap-2 px-3.5 py-2.5 text-fg-muted transition-colors hover:bg-subtle hover:text-fg [&::-webkit-details-marker]:hidden",children:[e("svg",{viewBox:"0 0 16 16",className:"chev-rot h-3.5 w-3.5 shrink-0 text-fg-faint transition-transform duration-200",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:e("path",{d:"M6 3l5 5-5 5"})}),e("span",{className:"m-0 font-medium",children:e(N,{content:l.summary})})]}),t("div",{className:"border-t border-line px-4 pb-1 pt-1",children:[e("div",{className:"mt-[1.1em] h-0"}),l.children,e("div",{className:"mt-[1.1em] h-0"})]})]})}function Os(l){let d=I(),m=S(ta);return t("span",{role:"figure","aria-labelledby":l.caption?d:void 0,className:"sm-full my-7 block overflow-hidden md:rounded-xl",children:[m?l.children:e("a",{target:l.target,href:l.href,rel:l.target==="_blank"?"noopener":void 0,className:"block",children:l.children}),l.caption?e("span",{id:d,className:"mt-2 block text-center text-sm text-fg-faint",children:l.caption}):null]})}function Ws(l){let{href:d,caption:m,...k}=l;return e(Os,{href:d||l.src,caption:m,target:"_blank",children:e("img",{loading:"lazy",decoding:"async",className:"mx-auto block",...k})})}function Ys(l){let d=l.children;if(typeof l.children==="string")for(let v of["pull/","issues/","commit/"]){let R="https://github.com/oven-sh/bun/"+v;if(l.children.startsWith(R)){let H=l.children.slice(R.length);d=e("code",{children:v==="commit/"?H.slice(0,7):`#${H}`});break}}let m=/^https?:\/\//.test(l.href)&&!/^https?:\/\/bun\.(sh|com)\//.test(l.href);return e(ta.Provider,{value:!0,children:e("a",{href:l.href,title:l.title,...m?{rel:"noopener"}:{},children:d})})}var Vs={note:{bar:"bg-info",chip:"text-info",label:"Note"},check:{bar:"bg-success",chip:"text-success",label:"Tip"},warning:{bar:"bg-warning",chip:"text-warning",label:"Warning"},caution:{bar:"bg-danger",chip:"text-danger",label:"Caution"}};function ra(l){let d=l.type===void 0,m=Vs[l.type??"note"];return t("div",{className:n("callout relative my-6 overflow-hidden rounded-xl border border-line bg-surface py-3.5 pl-5 pr-4 text-[94%] leading-relaxed text-fg/90 ",d&&"bg-subtle","mx-[calc(-1*var(--horizontal-padding))] rounded-none border-x-0 md:mx-0 md:rounded-xl md:border-x","[&>p]:my-2"),children:[e("span",{className:n("absolute inset-y-0 left-0 w-[3px]",d?"bg-line-strong":m.bar),"aria-hidden":!0}),!d||l.title?e("p",{className:n("!mb-1 !mt-0 text-[12px] font-semibold uppercase tracking-[0.08em]",d?"text-fg-faint":m.chip),children:l.title||m.label}):null,l.children]})}var zs=ra;function Gs(l){let d=l.html??Q(l.children);return e("div",{className:"rawhtml",dangerouslySetInnerHTML:{__html:d},suppressHydrationWarning:!0})}var Dr=new Map;function Xs(l,d){Dr.get(l)?.forEach((m)=>m(d))}function Ks(l){let d=Array.isArray(l.children)?l.children:[l.children],m=l.tabs.map((x,u)=>l.group?x.toLowerCase().replace(/[^a-z0-9]/g,"-"):String(u)),[k,v]=s(m[0]),R=I();a(()=>
65{if(!l.group)return;let x=(C)=>m.includes(C)&&v(C),u=Dr.get(l.group);if(!u)Dr.set(l.group,u=new Set);return u.add(x),()=>void u.delete(x)},[l.group,m.join("|")]);let H=(x)=>{if(v(x),l.group)Xs(l.group,x)},j=(x)=>{let u=m.indexOf(k);if(x.key==="ArrowRight")H(m[(u+1)%m.length]);else if(x.key==="ArrowLeft")H(m[(u-1+m.length)%m.length]);else return;x.preventDefault()};return t("div",{className:"CodeTabs my-5","data-tab-group":l.group||void 0,children:[e("div",{className:"CodeTabsHeader",role:"tablist",onKeyDown:j,children:l.tabs.map((x,u)=>e("button",{type:"button",role:"tab",id:`${R}-t${u}`,"aria-selected":m[u]===k,"aria-controls":`${R}-p${u}`,tabIndex:m[u]===k?0:-1,onClick:()=>H(m[u]),className:n("CodeTab",m[u]===k&&"active"),children:x.replaceAll("_"," ")},u))}),d.map((x,u)=>e("div",{role:"tabpanel",id:`${R}-p${u}`,"aria-labelledby":`${R}-t${u}`,hidden:m[u]!==k,className:n("CodeTabItem",m[u]===k&&"active"),children:x},u))]})}function Us(l){let[d,...m]=typeof l.children==="string"?[l.children]:Array.isArray(l.children)?l.children:[];if(d&&typeof d==="string"&&["[]","[x]","[ ]"].includes(d.slice(0,3)))return t("li",{className:"flex list-none items-start gap-2.5 !pl-0 [&]:-ml-[1.1em]",children:[e("input",{className:"mt-[0.42em] h-3.5 w-3.5 rounded accent-accent",type:"checkbox",checked:d.startsWith("[x]"),disabled:!0,readOnly:!0}),e("span",{children:[d.slice(3),...m]})]});return e("li",{children:l.children})}function Js(l){let d=l.children||"";if(d.includes("\\n"))return e("pre",{className:"rounded-md border border-line bg-code-bg px-[6px] py-[3px] text-[0.875em] leading-normal text-fg",children:d.split("\\n").map((m,k)=>t(ue,{children:[k>0?e("br",{}):null,m]},k))});return e("code",{children:d})}function Fe(l){if(!l.children)return null;return e("p",{children:l.children})}function Ve(l){return e("div",{className:"TableWrapper my-6 overflow-x-auto",children:e("table",{className:"!my-0",children:l.children})})}var Zs=({path:l="",routes:d="",loadTime:m=6.62})=>{let k=d?JSON.parse(d):[];return e("div",{className:"not-prose my-6 overflow-hidden rounded-xl border border-line bg-code-bg font-mono text-[13.5px] ",children:t("div",{className:"space-y-3 pb-4",role:"region","aria-label":"Bun development server terminal output",children:[t("div",{className:"flex items-center gap-2 border-b border-line px-4 py-3",children:[e("span",{className:"select-none text-success","aria-hidden":"true",children:"â¯"}),e("span",{className:"font-medium text-fg",children:"bun"}),e("span",{className:"text-info",children:l}),e(O,{text:`bun ${l}`,size:"sm",className:"ml-auto"})]}),t("div",{className:"flex items-center gap-3 px-5",children:[t("span",{className:"text-accent-strong",children:["Bun v",E]}),e("span",{className:"text-fg-faint",children:"ready in"}),t("span",{className:"text-fg",children:[m,e("span",{className:"text-fg-faint",children:" ms"})]})]}),t("div",{className:"flex items-center gap-3 px-5",children:[e("span",{className:"text-accent-strong","aria-hidden":"true",children:"â"}),e("span",{className:"text-info",children:"http://localhost:3000/"})]}),k.length>1&&t(o,{children:[e("div",{className:"px-5 pt-1 text-fg",children:"Routes:"}),e("div",{className:"ml-4 space-y-0.5 px-5",role:"list",children:k.map((v,R)=>t("div",{className:"flex items-center",role:"listitem",children:[e("span",{className:"mr-2 select-none text-fg-faint","aria-hidden":"true",children:"ââ"}),e("span",{className:"text-info",children:v.path}),e("span",{className:"mx-2 select-none text-fg-faint","aria-hidden":"true",children:"â"}),e("span",{className:"text-fg-muted",children:v.file})]},R))})]}),t("div",{className:"flex items-center gap-1.5 px-5 pt-1 text-fg-faint",children:[e("span",{children:"Press"}),e("kbd",{className:"rounded border border-line bg-surface px-1 text-[11px] text-fg-muted",children:"h"}),e("span",{children:"+"}),e("kbd",{className:"rounded border border-line bg-surface px-1 text-[11px] text-fg-muted",children:"Enter"}),e("span",{children:"to show shortcuts"})]})]})})};function na(l){let d=l.label==="Avoid";return t("div",{className:"mb-8",children:[t("div",{className:"mb-3 flex items-center gap-2",children:[e("span",{className:n("flex h-5 w-5 items-center justify-center rounded-full text-[11px] font-bold",d?"bg-danger/15 text-danger":"bg-success/15 text-success"),children:d?"â":"â"}),t("h5",{className:n("!m-0 text-base font-semibold",d?"text-danger":"text-success"),children:[l.label,l.title?e("span",{className:"ml-2 font-normal text-fg-muted",children:l.title}):null]})]}),e("div",{className:d?"avoid-example":"prefer-example",children:l.children})]})}function Qs({title:l="",children:d}){return e(na,{label:"Avoid",title:l,children:d})}function eo({title:l="",children:d}){return e(na,{label:"Prefer",title:l,children:d})}function to({version:l,improved:d}){let m=(k,v)=>t("a",{href:`/blog/release-notes/bun-v${k}`,className:n("since not-prose inline-block rounded-full border px-2 py-0.5 align-middle font-sans text-[13px] font-medium leading-none no-underline",v?"border-accent/40 bg-accent-soft text-accent-strong":"border-line text-fg-faint"),title:v&&d?`Improved in Bun v${k}`:`Shipped in Bun v${k}`,"data-pagefind-ignore":"",children:["v",k]},k);return t("span",{className:"ml-2 inline-flex items-center gap-1 align-middle",children:[m(l,l==="1.4.0"),d&&d!==l?m(d,d==="1.4.0"):null]})}i();var aa=(l)=>!!l&&typeof l==="object"&&l.$$mdtype==="Tag";function de(l,d){function m(v){if(v==null||typeof v!=="object")return v;if(aa(v))return k(v,void 0);let R=!1;if(Array.isArray(v)){let j=v.map((x)=>{let u=m(x);if(u!==x)R=!0;return u});return R?j:v}let H={};for(let[j,x]of Object.entries(v)){let u=m(x);if(u!==x)R=!0;H[j]=u}return R?H:v}function k(v,R){if(Array.isArray(v))return pe(ue,{key:R},...v.map((Y,M)=>k(Y,M)));if(!aa(v))return v;let{name:H,attributes:j={},children:x=[]}=v,{class:u,...C}=j;if(u)C.className=u;let W=H[0]!==H[0].toUpperCase()?H:d[H];if(!W)return null;let ee=Object.keys(C).length===0?R===void 0?null:{key:R}:{...m(C),key:R};return pe(W,ee,...x.map((Y,M)=>k(Y,M)))}return k(l,void 0)} 66export{ce,Q,De,Oe,Fe,Ve,h,de};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.