Marko in November 2026
- Selecting a row in a big list updates just 2 rows, wherever the list lives
- Dev servers use much less memory, and builds are faster
- Marko Run apps can now (easily) deploy to Vercel
- Doc comments on
Inputshow up in editor hovers - Coming soon: persisted pages for Christmas 🎄🤞, optimistic updates, and TypeScript 7.1 support
November brings faster browser updates, smaller bundles, and a leaner compiler.
Faster Rendering
A keyed <for> whose rows compare their key to a value, such as the selected item, now updates only the previously and newly selected rows even inside <if>, <await>, <try>, another <for>, or tag content. Selecting a row in a 10,000-row list inside an <if> updates 2 rows instead of 10,000 (marko#4645).
A <for> row or <if> branch that renders several sibling elements, such as a <dt> and a <dd>, also mounts faster. Creating 1,000 such rows takes about 20% less JavaScript time in Chrome and Firefox, or 5-8% less once layout is included (marko#4575). A style= value built from parts, such as style=[base, { color: tint }], updates only the CSS property that changed (marko#4753).
Faster Builds
Dev servers hold much less memory: after compiling every markojs.com template, the heap retained after garbage collection drops from 93 MB to 50 MB (marko#4789). @marko/vite also keeps its compiler caches across template edits, clearing them only when the set of tags can change, such as a new file under tags/ or a marko.json edit (vite#322).
When Marko is the only Babel plugin, as in @marko/vite, compiles take 7-19% less time, with smaller templates saving the most (marko#4558). In a project with 1,000 dependencies, the first tag lookup is about ten times faster, from about 160 ms to 15 ms (marko#4677). Production browser builds reuse templates already analyzed, so on markojs.com, compiling all 62 page entries went from 571 file reads to none in less than half the time (marko#4716).
Vercel Adapter
Marko Run apps deploy to Vercel Functions with @marko/run-adapter-vercel, and as with the other adapters, installing it is the whole setup (run#193). The build deploys through Vercel's Git integration or vercel deploy --prebuilt, and marko-run preview serves it locally without a Vercel account.
Handlers can run work after responding with ctx.platform.waitUntil, here recording a view while Vercel's CDN caches the page:
export const GET = Run.GET(async (ctx, next) => {
ctx.platform.waitUntil(recordView(ctx.params.slug));
const response = await next();
response.headers.set("cache-control", "public, s-maxage=60, stale-while-revalidate=600");
return response;
});Function options such as regions, memory, and maxDuration go to the adapter, since vercel.json settings do not apply to prebuilt output.
Template Types
A doc comment above a template's Input now documents the tag, and editors show it on hover wherever the tag is used, including JSDoc tags such as @deprecated and @see (language-server#621, Tag Documentation).
/**
* A row of buttons that picks one of a few options.
* @see <radio-group> for longer lists of options
*/
<div role="radiogroup">
<for|option| of=input.options>
<button
role="radio"
aria-checked=String(option === input.value)
onClick() {
input.valueChange(option);
}
>
${option}
</button>
</for>
</div>/**
* A row of buttons that picks one of a few options.
* @see <radio-group> for longer lists of options
*/
export interface Input<T extends string> {
/** The options, in display order. */
options: readonly T[];
/** The option shown as picked. */
value: T;
valueChange(value: T): void;
}
<div role="radiogroup">
<for|option| of=input.options>
<button
role="radio"
aria-checked=String(option === input.value)
onClick() { input.valueChange(option) }
>
${option}
</button>
</for>
</div>/**
* A row of buttons that picks one of a few options.
* @see <radio-group> for longer lists of options
*/
div role="radiogroup"
for|option| of=input.options
button
,role="radio"
,aria-checked=String(option === input.value)
,onClick() {
input.valueChange(option);
} -- ${option}/**
* A row of buttons that picks one of a few options.
* @see <radio-group> for longer lists of options
*/
export interface Input<T extends string> {
/** The options, in display order. */
options: readonly T[];
/** The option shown as picked. */
value: T;
valueChange(value: T): void;
}
div role="radiogroup"
for|option| of=input.options
button
,role="radio"
,aria-checked=String(option === input.value)
,onClick() { input.valueChange(option) } -- ${option}Typed component libraries, generic ones included, now publish like standard TypeScript packages: mtc writes x.d.marko.ts declarations that use only public types, with the new Marko.TemplateOf preserving a generic template's signature (language-server#665, language-server#655, language-server#664, marko#4732).
Improvements
Smaller Pages
- A child that only spreads an attribute tag or its input onto an element, or only calls its handlers, no longer rebuilds that object on each update. A list whose rows spread an attribute tag onto a button drops from about 3.3 KB to 1.6 KB brotli (marko#4641).
- A
<const>or property read in only one place, such as a loop item'sitem.name, no longer gets its own client function (marko#4613).
Type Checking
mtcspends 12-13% less time type checking eBay's evo-web component libraries, for 5-8% less wall time (language-server#658).- Dynamic tags such as
<${compact ? Chip : Card}>check attributes against each candidate'sInput(language-server#628). - Attribute tags that repeat or sit inside control flow are fully checked, and a required one provided only inside control flow is no longer reported missing (language-server#627).
- Marko Run templates type
$globalwith each route'sRun.Context, and each project in a workspace gets its own Marko Run types (language-server#661). - A dozen smaller fixes add source locations to
mtcerrors, prevent crashes on incomplete code, and honor<!-- use tags -->and<!-- use class -->(language-server#659).
Tooling
- The Prettier plugin formats about 1.5x faster from the command line (prettier#162), and VS Code reads every Prettier config format and applies config edits without a restart (language-server#630).
- Yarn Plug'n'Play projects compile, resolving tag libraries and
.markofiles withoutnode_modules(marko#4678, resolve-sync#16, marko#4720).
Diagnostics
- Giving
<let>anonChange-style handler points to the controllable<let>pattern, and combining:=with??or||shows the explicitvalue=andvalueChange=form (marko#4741). - A
<script>holding JSON-LD suggests<html-script>(marko#4593). - For teams working with coding agents (so, most of you), the
marko-best-practicesskill (npx skills add marko-js/marko) adds rules for controllable state, keeping reactions to state out of<script>, and verifying withmarko-run build(marko#4741).
Web Platform
- With
$global.cspNonceset, client-rendered<script>and<style>tags work under a strict Content Security Policy (marko#4727). - The native
<selectedcontent>element, part of the customizable<select>, compiles and is typed (marko#4551).
Fixes
Marko Run
Run.hrefworks when an app installs more than one Rolldown version (run#318).- Repeated form and query keys no longer take quadratic time to parse (run#327), and small form posts no longer allocate a buffer the size of the body limit (run#332).
- Error responses that depend on
AcceptsendVary: Accept(run#333). - The static adapter writes rewritten pages once, skips unnamed
$and$$routes, and keeps redirect pages on the same site (run#322, run#324, run#330).
Resume
- Removing content with
<if>or<for>runs itsonDestroycallbacks, aborts$signal, and stops subscriptions even when that content has no resume marker of its own (marko#4610). - Text from a component's input stays separate from text the component renders itself, so an update no longer overwrites a label (marko#4581).
Control Flow
- A keyed
<for>adds and removes items before updating rows, so no row renders against a removed item (marko#4617). - An event handler in a keyed row that reads only the key no longer throws (marko#4555).
- Binding to a destructured tag parameter, such as
value:=counton<define/Counter|{ value }|>, no longer crashes the server render (marko#4770). <show>toggles reliably when its body begins or ends with control flow (marko#4572).- Recursive tags that pass content back to themselves compile and render (marko#4599, marko#4640, marko#4647).
Lazy Loading
- A tag with a
loadtrigger waits for it even when rendered through a dynamic tag (marko#4767). - On a resumed page, a lazy tag rendered after its trigger already fired loads immediately instead of waiting for a second click or scroll (marko#4774).
- A lazy tag nested inside another resumes when its module finishes loading first (marko#4672).
- A failed load caught by a
<try>no longer surfaces an unhandled rejection (marko#4778).
Interop
Class API content renders wherever Tags API content does, including through spreads and content=, and updates in place with its state. Many mixed pages are 2-4 KB smaller minified, though a Tags page passing changing input to a Class API child grows about 0.5 KB (marko#4660).
In Brief
- Streamed pages keep their event handlers when a tag manager or browser extension appends to
<body>mid-stream (marko#4685). - In development,
@marko/viterecompiles every template an edit affects, so changing a grandchild's<return>updates the page above it (vite#326). $globalworks insideclassandstyleobjects (marko#4561), and$signalin a native tag's attribute aborts when that attribute re-runs or the tag is removed (marko#4761).
Full details for every change are in the release notes of each package on GitHub.
Coming Soon
Persisted Pages
Persisted pages are closer than ever and will be ready to try in time for Christmas 🎄. Since October, the Patch Protocol that keeps the live page across navigations has added:
- Strict Content Security Policy support, with patches carrying
$global.cspNoncelike resume scripts. - Redirects (including after form posts), Back and Forward, and links to handler-only routes such as sign-out.
- Static sites, with the static adapter writing each page's patch beside its HTML.
The release adds an experimental patches option, already exercised across markojs.com and several sample apps.
Drafts and Actions
New <draft> and <action> core tags bring optimistic updates, showing the result of an action before the server confirms it. A <draft> follows its source until assigned a guess, and an <action> wraps a handler whose pending stays true until its work ends, including a form post that navigates. A guess holds until its action ends.
<draft/following=input.following/>
<action/toggle() { following = !following }/>
<form method="POST" action="/follow" onSubmit=toggle>
<button disabled=toggle.pending>${following ? "Following" : "Follow"}</button>
</form>Submitting shows "Following" and disables the button right away, without cancelling the form post. Since the tags rely on persisted pages, they will follow that release.
TypeScript 7
TypeScript 7.1, now in beta, adds content mappers, and @marko/language-tools provides one so TypeScript reads .marko files directly. The same mapper works with tsrs, a Rust port of TypeScript 7, a step toward fully supporting the Vite+ toolchain, whose type checking runs on tsrs.
{
"contentMappers": [
{ "package": "@marko/language-tools", "extensions": [".marko"] }
]
}tsc --runExternalCodetype checks templates and emits their declarations, and.tsfiles import templates with their types.- TypeScript's language server provides TypeScript features such as hover, completion, and rename inside templates, while Marko's language server keeps the Marko-specific ones.
mtcwrapstsc --build, and the mapper replaces@marko/ts-plugin.
It will ship once TypeScript 7.1 is stable.
Community
vwong updated Run.href to serialize an array search value as repeated keys, so { tag: ["a", "b"] } produces ?tag=a&tag=b just as ctx.search reads it (run#336). Their reports also led to this month's Run.href fixes and the streaming fix for tag managers. IngeniozIT reported and fixed the css.devSourcemap deprecation warning Marko Run printed on Vite 8.4 (run#338). Both shipped in @marko/run 0.11.20.
NUAAwqy co-authored three compiler fixes, including the clearer error for tags named like JavaScript built-ins (marko#4635, marko#4636, marko#4638), and the interop rework (marko#4660). joshuakeel restored the basic starter's backdrop-filter, which production builds had dropped (examples#67), and updated the installation guide to install marko rather than marko@next (website#325).
Further Reading
Contributors
Helpful? You can thank these awesome people! You can also edit this doc if you see any issues or want to improve it.