

Updates to the Aardink editor v0.5.0: the same editor in a browser

Outline
Notes and sources, not prose. Rewrite each section before publishing. Sources are in the aardink repo unless noted. Write it as a mirror of the 0.4.0 post: same editor, new places.
TODO: opening. The 0.4.0 post showed the editor on Android with language services and a bridge to a real language server. 0.5.0, released 27 September 2026, runs the same code on desktop and in a browser.
Upgrading on Android
- Nothing to change:
implementation("com.aardarch:aardink:0.5.0"). The public API only grew. - New:
EditorTypographyandLocalEditorTypography, hardware keyboard shortcuts, scrollbars on desktop and web,KeyboardToolbarPlacement.platformDefault,WebSocketLspTransport. - Changed:
EditorThemeParseruseskotlinx.serializationinstead oforg.json. - Source:
CHANGELOG.md0.5.0.
The same editor in a browser
- Side by side with 0.4.0: the same
CodeEditorLayout, the same built-in languages, the sameLspClient. Stdio on Android, a WebSocket in the browser. - How the pieces fit: your web app, then your JS exports, then
AardinkWeb, thenCodeEditorLayout. TODO: ReactFlow diagram, from the text diagram inWEB_INTEGRATION.md. - TODO: screenshots of
:sample-web(language and theme pickers, stats bar).
Using it from JavaScript
pnpm add @aardarch/aardink-web. 0.5.0 went to npm by hand on 27 September. From 0.6 it publishes from CI.- Snippet:
createEditor(container, onChange, options), thenupdateOptions,setDiagnostics,onDidChangeCursor,dispose. Monaco-shaped on purpose, so swapping one for the other is small. - Vite needs
optimizeDeps.exclude: ['@aardarch/aardink-web']. The pre-bundler rewrites the package and breaks thenew URL('./x.wasm', import.meta.url)references the loader relies on. - Under the hood: editors cross the JS boundary as integer handles, and every export is prefixed
aardink. The export template is compiled in Aardink’s own tests so it cannot rot. - A grammar of your own in Kotlin means building your own small wasm module from the template. 0.6 adds registering one from JavaScript.
- TODO: live editor in this post, or save it for part 6? See the notes in part 6 before building it.
- Source:
WEB_INTEGRATION.md.
Where 0.5.0 falls short
- Typing gets slower as the file grows: about 50 ms a keystroke at 6 KB, 190 ms at 26 KB, 1 s at 139 KB. Compose lays out the whole text field as one paragraph, twice a frame.
- Fast typing loses keys in big files: 15 to 29 of 30 at 10 keys a second on 5,000 lines, none at 250 lines. Found just after release, while building the 0.6 performance gate.
- A disposed editor leaks about 275 KB. Compose Multiplatform 1.12.1 has no way to tear down a viewport; 1.13 fixes it.
Reuse one editor with
setValue. - Shipped anyway: aardflex’s XML files are a few hundred lines. Part 5 is the fix.
- Source:
KMP_MIGRATION_PLAN.mdsection 7.4,AARDINK_0.6_PLAN.mdsection 1.