Svelte turns ten: custom renderers, async progress and mdsvex 1.0
For its tenth anniversary, Svelte added experimental custom renderers that can target terminals, PDFs and native apps, and reported progress on await expressions. Here is what changed and what it means for sites built with Svelte.
On this page
Svelte, the open source framework for building user interfaces, turned ten this month. On 25 November the Svelte team marked the anniversary with a post on its blog, written after its third in-person Svelte Summit in Ljubljana. The post lists several pieces of new or progressing work. The biggest for anyone building sites is an experimental way to render Svelte components to something other than a web page.
Custom renderers, behind a flag
Svelte components normally render to the DOM, the structure a browser turns into a page. Custom renderers change that target. The Svelte docs describe the renderer as "a small object that tells Svelte how to create, arrange and update the nodes of the target environment." The team's post names native apps, terminal interfaces and PDFs as examples. The docs also mention a WebGL scene.
You still write ordinary Svelte components. To try it, you opt in with the experimental.customRenderer compiler option, set in svelte.config.js or in your Vite config through vite-plugin-svelte. The option can be true, so each component chooses a renderer with <svelte:options customRenderer="..." />. It can also name one default renderer module for every component, or be a function that picks a renderer by file name. A renderer module is built with createRenderer from svelte/renderer. It implements methods to create elements and text, insert and remove nodes, set attributes and handle events.
The docs are clear about the limits:
- The API "may change before the experimental flag is removed."
- DOM-only features fail at compile time in these components. That includes
bind:on elements, transitions and animations,{@html}and<svelte:head>. - Svelte still scopes a component's styles but does not inject them. The renderer decides what to do with CSS.
- Components that use a custom renderer render nothing on the server. They are created in the browser after the page loads.
- Events do not pass from one renderer to another.
Async Svelte moves closer to ready
The anniversary post says Async Svelte is making progress toward being ready for production. No release date is given. The docs describe the feature as await expressions: you can use await at the top level of a component's script, inside $derived(...), and in markup.
The feature has been available since Svelte 5.36 behind the experimental.async compiler option. The docs say "the experimental flag will be removed in Svelte 6." They also warn that, while it is experimental, how await behaves may change in breaking ways outside a major release. Independent await expressions in markup run in parallel. A <svelte:boundary> with a pending snippet shows a loading state on first load. Server rendering works when you await the render(...) call, and the docs say streaming server rendering is planned.
Tools around the framework
The post also lists changes to the tools that sit around Svelte:
- vite-devtools-svelte has moved into the Svelte GitHub organisation and is working toward a 1.0 release. It plugs into Vite DevTools, and the post says it exposes an MCP server, so coding agents can connect to it.
- rsvelte is a single Svelte toolchain written in Rust. The post says it is "not quite production-ready yet."
- mdsvex, the toolkit for using Svelte components inside markdown, has reached version 1.0.
The team says talks from the summit will be published on the Svelte Society YouTube channel.
What it means for your site
- Nothing changes unless you opt in. Both custom renderers and await expressions sit behind experimental compiler flags. A site that does not set them builds as before.
- Keep experiments out of production for now. The docs say both APIs can still change. Try them on a branch or a side project, and pin your Svelte version while you do.
- Expect no server output from custom renderer components. If a part of your site needs to be in the first HTML for search engines or for speed, keep it on the normal DOM renderer.
- Try await expressions if you already plan your upgrade path to Svelte 6. The flag is due to go away in Svelte 6, so code written against it now is code you will keep. Check the docs for the change in effect ordering when the flag is on.
- Content sites built from markdown can look at mdsvex 1.0 now that it has a stable release.