editmd-gpuix
by Ilja
A Markdown editor. A port of editmd, a Swift app, to Svelte.
github.com/fubits1/svelte-gpuix-editmd
19 Nov 2026
Custom renderers and the unexpected places they take us
Follow along on your phone here
Software engineer at Schibsted · Stockholm
Part one
Once upon a time, in 2016
…in the spirit of web standards
Rich, at the anvil
2016 to 2026
Since 2016
…and Svelte has mostly kept up
The new meta for JS frameworks
But also…
“Virtual DOM is pure overhead”
…and AI, of course
Part two
Svelte, minus the DOM
What is a custom renderer?
document.createElement('button') hard-codedrenderer.createElement('button') yoursLet’s build the world’s worst custom renderer.
Step 1 of 2
import { createRenderer } from 'svelte/renderer';
export default createRenderer({});
Step 1 of 2
export default createRenderer({
// …create and walk nodes, from the last slide
insert(parent, n) {
parent.children.push(...nodesToInsert(n));
n.parent = parent;
if (parent === root) print(n);
},
});
function nodesToInsert(n) {
return n.name === 'fragment' ? n.children : [n];
}
function print(n) {
const [first] = n.children;
if (first) console.log(`[${n.name}] ${first.text}`);
}
<h1>Hello world</h1>
Wiring
import { compile } from 'svelte/compiler';
import { mount } from 'svelte';
import renderer, { root } from './renderer.js';
import App from './App.svelte';
const { js } = compile(source, {
generate: 'client',
experimental: {
customRenderer: './renderer.js',
},
});
mount(App, { renderer, target: root });
Once you can write a renderer
Running on PocketJS

Wait, was that Wolfenstein?
snuffy@snuffyDev Wolfenstein 3D rebuilt in Svelte for Svelte Hack 2023. Every wall is a DOM element moved with CSS 3D transforms: no canvas,
no WebGL.
That was fun. Now let’s get practical.
03 · Part three
Svelte drawn by GPUI


A code editor whose team built their own GPU UI framework, GPUI, tuned for exactly that job.

Node/Bun bindings for GPUI, as well as React + Solid support. Prebuilt, so no Rust toolchain is needed.

Svelte support for gpuix.
Base architecture
<script lang="ts">
let count = $state(0);
</script>
<div class="app">
<text class="count">{count}</text>
<div class="btn" onclick={() => count++}>Add one</div>
</div>
<style>
.btn {
padding: 12px 24px;
border-radius: 8px;
}
</style>
So, where does my code run?
The frontend is the backend.
The frontend is the backend
<script lang="ts">
import { readdirSync } from 'node:fs';
import { homedir } from 'node:os';
let files = $state(readdirSync(homedir()));
</script>
{#each files as file}
<text>{file}</text>
{/each}
Read the file system, straight from a component
~
Documents/Downloads/side-project-41/side-project-42/definitely-not-memes/final_FINAL_v7.psdtodo-from-2019.txteverything
else
gpuix-svelte
The custom renderer about 180 lines at its core
Can you build a real app with it?
Built with gpuix-svelte
by Ilja
A Markdown editor. A port of editmd, a Swift app, to Svelte.
github.com/fubits1/svelte-gpuix-editmd
by d1lanX
Bookmark shell commands, launch them, watch their logs.
github.com/d1lanX/cmdmark
A local-first second brain, written in Svelte

Strata · every model runs on your machine
04
Zooming out
1 JavaScript is the host gpuix-svelte
2 Native is the host
Invert the dependency: start from a native project, add Svelte on top, emit native code.

The engine I picked
A UI library in C99 with about 190 ready-made components.
OK, but if it’s so limited, what’s the point?
≈250 KB
…for a complete CUI app.
World’s smallest Svelte app
We really just need something that runs JavaScript…
The plan, step one
<Button
variant="primary"
onclick={() => clicks++}
>
Click me
</Button>
<Text>Clicked {clicks} times</Text>
{ /* <Button> k5 */
cui_button_opts o = {0};
o.variant = CUI_BUTTON_PRIMARY;
bool r = cui_button_ex(ui, "Click me###k5", &o);
if (r) cuisv_emit(s, 2);
}
{ /* <Text> k6 */
cui_text_opts o = {0};
cuisv_text_inherit(&o);
cui_text_ex(ui, cuisv_str(s, 3), &o);
}
cuisv_emit queues the click for JavaScriptcuisv_str reads a slot that Svelte’s effect wroteSvelte, compiled to C
Add QuickJS for the script tags, and…
First build about 12 seconds. After an edit, under one.
The todo app, as a Mac executable
1.9 MB
about 1 MB zipped
Code and data
The Svelte runtime is 59 KB of that. Your components, compiled to C: 3.6 KB.
For scale: the same kind of app on Bun plus native bindings ships at about 110 MB.
Part five
What every custom renderer runs into
The question every renderer runs into
Is it really Svelte if you can’t show the component in a browser? 😅
One codebase
Why are we
even doing
this?
Isn’t AI about to make all frameworks obsolete?
At the end of the day, a person is responsible for the codebase.
Svelte’s simple semantics
06 · Part six
Desktop
npm create gpuix-svelte@latest gpuix-svelte.stanislav.garden
Desktop, today
+ every engine
that already exists
What an engine needs for a custom renderer
JS bindings (Node, Bun), or generate native code directly
And what about mobile?


gpuix-svelte, running on iOS and Android.
The DOM was only the beginning for Svelte.
Join on your phone
stanislav.garden/talks/svelte-everywhere