Release notes
What changed in each published version of brust, newest first. Packages are published under @brust/* with the version shown.
2.0.0-alpha.66 · 25 November 2026
This version makes brust build and the first build of brust dev faster on a large app. On the 771-module app we measured, a development build went from about 57 seconds to about 12.5. What the build writes is the same, byte for byte. A build now takes more memory by default; the item under Changes says how much and how to turn that off.
Changes
- Pages and layouts compile on up to 4 threads, and a build takes more memory for it (#554). Until this version the compiler used one core. It now uses up to 4 threads, fewer when the machine has fewer cores or the app fewer route files. Each thread keeps its own copy of the modules it reads, so peak memory of the build rises: in our runs to between 1.4 and 1.65 times that of one thread on the 771-module app (2.76 GB on one thread), and to about 2 times on a 316-module app (1.45 GB on one thread). The memory is returned before bundling starts. If a machine or a CI runner is short of memory, set
BRUST_COMPILE_THREADS=1: the build then compiles on one thread with the memory it took before. Any other number sets that many threads; in our runs 8 threads were slower than 4 and took 0.9 GB more. The output is the same at any number, and so is the error a failing build reports.
Fixed
- A build of a large app no longer reads and parses the same modules again and again (#552). The step that looks for modules written at load time parsed every module on each of its two runs without keeping anything, and each question the compiler asked about an imported module read that file again. On a 771-module app this was most of the build: the two scans took about 10.7 seconds each and each of the three compiles about 10.8. A module is now read and parsed once per run, and what it exports is worked out once. On that app the scans take under 2 seconds each and a compile about 7.2, and the whole development build went from about 57 seconds to about 28.
- The compiles of one build share what the first step already parsed (#553). A build runs the compiler several times, and each run used to start with nothing. They now share one session, so a module that has not changed on disk is not parsed again; a file that changed, appeared or went away between two steps is read again. On the same app each compile dropped from about 7.2 to about 5.9 seconds on one thread, and peak memory stayed within 2% of what it was.
BRUST_BUILD_TIMINGS=1shows where a build spends its time (#552). With this variable set,brust buildprints the time of each stage, now with one line per compile and one for bundling. Without it nothing extra is printed.
2.0.0-alpha.65 · 22 November 2026
This version fixes the build refusal that the 2.0.0-alpha.64 notes said was left: a component that branches on a prop the page does not pass, when the prop’s default is a constant, builds again. It also changes one thing at build time: a prop default that names a constant another module changes when it loads is no longer taken from the source. Read the item under Upgrading, then the item under Fixed for what is still refused.
Upgrading: what you must change
- A prop default that names a constant another module writes when it loads is no longer treated as a constant (#550). If a component has a default such as
side = NO_SIDE, whereNO_SIDEis an exported object that another module changes when it loads (NO_SIDE.on = true), until this version the build took the valueNO_SIDEhas in its source,{ on: false }, as the default and printed that in the server template (a probe on 2.0.0-alpha.64 shows the default folded to that literal). The server page then showed the declared value, not the value the app has at run time. Now the default is not taken from the source: the component renders with React, itstierindist/manifest.jsonreadsreact, and the build printsprop-default-shapewith the textthe default of the prop `side` is a name that is not a prop (a module constant, an import or a global), which the server template cannot evaluate. The write is followed through a re-export (export { NO_SIDE } from './Side',export * from './Side',importthenexport) and under another export name (export { NS as NO_SIDE }). A constant that nothing writes is folded as before, and a default that was not folded before (a call, alet, an import) is unchanged. How to tell whether it touches you: rebuild and look for a newprop-default-shapeline, or for a component whosetierchanged toreact. Most apps see nothing: in the pull request’s check, every fixture app, the website and our benchmark app built to the same outputs with and without the change (119 of 119, the manifest and every template).
Fixed
- A build no longer stops with
dynamic-in-reactandits child has a job under a condition the server cannot evaluate per rowwhen the condition reads a prop the page does not pass and the prop’s default is a constant (#550). This is the refusal the notes of 2.0.0-alpha.64 said was left. The shape: a component takesside = NO_SIDE(a literal, or a constant of its module that no other module writes) and branches onside.on; a child in one of the branches has a job on the server, for example a React island; a page renders the component withoutside, next to a<Dynamic>. The build now evaluates the condition with the default, the same value the template prints, so the branch the page cannot take never runs its job and the page stays what it was. It holds for a default offalseortrue, for a default written in the pattern (side = { on: false }) and for a prop with no default that the condition only tests (side ? … : …). A page that passes the prop (side={props.side}) is unchanged. What is still refused, with the message it gets (the samedynamic-in-reactmessage, with this text inside it): a member of an omitted prop that has no default (side.onwith{ items, side }) and a prop passed as an inline literal (side={{ on: false }}) both end withnested-instance … its child has a job under a condition the server cannot evaluate per row; a default the build cannot fold ends withprop-default-shape: the default of the prop `side` is a call outside the subset, which the server template cannot evaluatefor a call (side = makeSide()), oris a name that is not a prop (a module constant, an import or a global)for a modulelet, an import and a constant another module writes. The served test checks a page with a default ofon: falseand one withon: true: each renders the island once for each row, only in the branch that is live, next to the runtime component.
2.0.0-alpha.64 · 22 November 2026
This version stops a function that only reads a table from making the table count as written, so a build that 2.0.0-alpha.62 or 2.0.0-alpha.63 refused, or a component they rendered with React for that reason, builds again as it did before. It also takes most of the kept scripts of 2.0.0-alpha.62 back, and it makes every action call cheaper by dropping a copy of the request that nothing read. If you are on 2.0.0-alpha.62 or 2.0.0-alpha.63, read the first three items under Upgrading.
Upgrading: what you must change
- A build that 2.0.0-alpha.62 or 2.0.0-alpha.63 stopped, or a component they rendered with React, because a function only read a table, works again (#548). If your build stopped with
dynamic-in-reactand a message that containsits child has a job under a condition the server cannot evaluate per row, or it printedmodule-writtenfor a component you wrote to be interactive (itstierindist/manifest.jsonreadsreact), this is the cause most apps hit. A module passed a table that another module exports to a function of your own that only reads it, such as a check built onObject.keysandObject.hasOwn, and the build counted that as writing the table. Every export that reads the table was then counted as changed by another module, and an interactive component that reads one of them was rendered with React: its static parent got a job on the server, and where the page renders a component that holds a<Dynamic>and branches on a prop the page does not pass, the build was refused. Now a table passed to a function of your own is judged by what the function does with it; the next item says exactly what still counts. Rebuild to get this; nothing in your code has to change. The rule itself is older than 2.0.0-alpha.62 (it came with A value another module changes at load time renders like React in 2.0.0-alpha.16). 2.0.0-alpha.62 made a.tsfile with a generic arrow readable (see its Fixed item), so a module the build used to skip was scanned and its hand-off counted, which is how an app first met the rule. - What still counts as a write when a table is passed to a function, and the error this does not remove (#548). A table or a list passed as a bare argument to a function is written unless all of these hold. The function is a top-level function of your app: a
functiondeclaration, or aconstthat holds a function or an arrow and is never assigned again, called by its name from its own module or imported by name (a re-export is followed). The call has no spread argument. The table goes to a plain parameter, not a destructured, default or rest one. And the function does nothing with that parameter that could change or keep it. It counts as written when the function assigns into the parameter or one of its members, calls a changing method on it (push,sortand the like) orObject.assignon it, stores it, hands it to a function that does or to a package function, calls itself (also through another function), or returns it or a member of it that is an object or a list, because the caller may then write to the result. Returning a member that is a string or a number is a read. A function that is a method of an object or a class (o.check(T)), one reached throughimport * as ns, one that is assigned again, and a callee chosen by a condition all still count. A member of a table passed to a function (fmt(T.a)) never counted. This does not make the error itself impossible. A component that has a job on the server, such as one rendered as a React island because a module it reads is really written, sitting in a list under a condition on a prop the caller does not pass (in the case we reproduced the component takes its default from a constant of its own module), in a component that also renders a<Dynamic>, is still refused with the same message. That was not changed in this version. Update for 2.0.0-alpha.65: this refusal is fixed when the prop’s default is a constant; the Fixed item of 2.0.0-alpha.65 says what is still refused. - Scripts leave pages again: ordinary read-only code no longer keeps a native component’s script on every page (#547, #548). In 2.0.0-alpha.62 a module that reads an imported table when it loads kept its component’s script on the pages of the route as soon as any module of the app did something with that table beyond a short list of reads. This version takes most of that back. It no longer keeps the script when: (a) the code runs only on the server, because only a module that some script the browser loads contains can keep a script, so a loader or an action file that keeps items of a table no longer does, while a module that writes into the table counts wherever it runs; (b) an item or the table is held by a local
const(const own = TABLE.find((p) => p.key === k),const all = TABLE), which is followed to where it is used; (c) the value passes through??,||,&&or?:, or is tested withif,while,!,typeof,===,!==,== nullor!= null; (d) an item or the table goes to a top-level function of your app (the same kind as in the previous item), which is followed into the function: what it does with the parameter, and what it returns of it, is what counts; (e)Object.keys,Object.values,Object.hasOwnandArray.isArrayread it, and so doesObject.entriesof a table whose members are strings or numbers; (f) a method that is not on the list of reads is called on a string, a number or a boolean member (normalize,localeCompare,toFixed), because only a method on an object or a list can change it. Rebuild to get the new lists: the scripts a page carries are decided at build. - What still keeps a script on every page (#547, #548). A write through the table, one of its items or a local
constor alias that holds one: an assignment,delete,push,sortor another changing method,Object.assign. An item or the table returned from a function, or put in an object or a list that leaves the function (export const FIRST = TABLE[0],() => ({ p: TABLE[0] })). An item handed to a package function or tonew. Aletorvarthat holds an item that is an object or a list, and a destructuring of an item or of the table (const { path } = TABLE[0],const [first] = TABLE). A function passed by name as a callback (TABLE.map(key)). An item used where JavaScript turns it into text or compares it loosely: a template string,'' + item,item == other. A call of a function that the scan does not follow: a method of an object, a function nested in another function, one reached throughimport * as ns, a recursive one, one with a spread call or a destructured, default or rest parameter.Object.entriesof a table whose members are objects or lists, and an object handed on whole fromObject.values(Object.values(TABLE).map((p) => p)). Animport()of the module that holds the table, and animport()whose specifier is not a string literal, which keeps every table, in a module the browser loads. To see which components still send their script, rebuild and opendist/manifest.json: a native component whose record has nohostsalways sends it, as under 2.0.0-alpha.62.
Fixed
- A build no longer stops with
dynamic-in-reactbecause a function only reads a table (#548). The first two items under Upgrading say what changed, what still counts as a write and which refusal of the same message remains. Update for 2.0.0-alpha.65: that refusal is fixed for a prop with a constant default; see 2.0.0-alpha.65.
Changes
- An action call costs less CPU because the server no longer sends the worker a second copy of the request (#546). Every action call carried the method, the URL, the headers as an object, the parsed cookies and the query a second time, and nothing read them: the worker builds the
Requestyour handler receives from the method, the URL, the headers and the body, and still does, so a handler sees the sameRequest. Loaders, jobs and runtime components keep what they were given. Measured once, on our benchmark app (6 paired runs of the previous build and this one, 4 workers on 4 CPUs, 120 connections at once): CPU per request fell by a paired median of 1.09 µs from 26.05 µs, about 4%, for an action that answers a page of 1,976 bytes (lower in 6 of 6 pairs), and by 1.64 µs from 28.58 µs, about 6%, for an action read (lower in 4 of 6 pairs); requests per second were 1.04 and 1.07 times as high. A cached page and a page rendered on every request make no such call, and their differences (0.05 µs lower and 0.36 µs higher) are within the noise of the run. One app on one machine, not a promise.
2.0.0-alpha.63 · 22 November 2026
This version makes every call from the server to its JavaScript workers cheaper, and builds an action’s reply with less work. Nothing in an app changes. Two log lines are worth knowing: one for a worker that exits while it is answering, and one new warning for calls a worker never finishes.
Upgrading: what you must change
- Nothing to change: a worker that exits in the middle of a call is logged as
worker exited mid-call(#541). The request that was waiting for it still gets a 500 at once, not after the call deadline, and the log line for the failed call (action call failed,loader call failedorjobs call failed) carriesworker rejected: worker exited mid-callas its error. - Nothing to change: a new warning when a worker has not finished calls that were given up for more than 10 seconds (#541). It reads
N of K slots have held a call for more than 10 s after its caller gave up; the worker has not finished themand carries the fieldsworker_id,stale,slotsandoldest_s(the age in seconds of the oldest). It appears at most once a minute for each worker. It means that a handler is still running, or never returns, for requests whose client has already gone, and that each such slot stays out of use until the handler answers or the worker exits. The line does not name the route. A burst of clients disconnecting does not trigger it: the worker finishes those calls at once, and the warning counts only calls still unfinished after 10 seconds.
Changes
- A call from the server to a JavaScript worker costs less CPU and makes less garbage (#541). Before, every call to a worker (a loader, an action, the values a component computes on the server) turned the handler’s promise into a Rust future, which made two native functions, two wrappers and two derived promises to learn that the call had finished. Now the worker reports that a call is finished with one native call into a cell that each worker slot reuses, so nothing is allocated for it. Measured once, on our benchmark app with 8 workers (the median of 12 paired runs of the previous build and this one; actions at 8 and at 120 connections at once, pages at 120): CPU per request was 12% to 13% lower for an action read and 10% to 13% lower for an action write, with the JavaScript threads 18% to 21% lower; 13% lower for a page with a React island; 8% lower for a small page rendered on every request; and unchanged, within 1%, for a page that renders a long list, because its cost is the render. Requests per second for actions were 1.13 to 1.20 times as high. Requests per second moved more between runs than CPU per request did, so read the CPU figures. Pages served from the page cache and static pages make no worker call and gain nothing: the control cell read 1.000. One app on one machine, not a promise. Why a late answer cannot land in another request’s reply: a request whose client went away keeps its worker slot until the worker reports back or exits, and a report for any other call is ignored, so the slot is never handed to a new request while the worker may still write to it. The served test sends 2,000 requests, 32 at a time, with every fifth client giving up within a few milliseconds, and checks that every answer carries the marker of its own request and that nothing hangs. A slot that stays held is what the warning under Upgrading reports.
- An action’s reply headers are built once instead of twice (#543). The status and headers of an action’s reply were turned into JSON twice, once to measure them and once to send them. Now one copy does both. The bytes sent are the same: a test compares 6,000 generated replies (up to 40 headers each, with repeated and non-ASCII values, and bodies from empty to over the limit) with the previous path and finds the same frame, the same return value and the same log lines. Measured the same way, CPU per request was 2% lower for an action read and 4% to 6% lower for an action write. The control, a cached page, read 1% lower, which is the noise of the measurement.
2.0.0-alpha.62 · 22 November 2026
This version lets a native component’s script be left out of more pages: a module that only reads data another of your modules exports, such as a member of an imported table, no longer keeps the script on every page. In exchange, the data has to be read and nothing else: if any module of your app hands it on or writes to it, the modules that read it keep their scripts again. Read the first item under Upgrading, then the rule under New.
Upgrading: what you must change
- Nothing breaks, but a script can come back on pages where 2.0.0-alpha.61 left it out (#539). In 2.0.0-alpha.61 a module that spread, copied or looped over an array another module exports as a literal could drop its component’s script from pages that do not draw the component, even when some other module of your app handed that array on. Now the array counts as data only while the whole app only reads it. If a module of your app returns the array or one of its objects, passes it to a function, keeps it in another value or object, re-exports an alias of it, calls
Object.keyson it, destructures it, loops over it withforEach, or writes to it (pushand the like, also inside a function that only runs later), every module that reads that array when it loads keeps its component’s script on every page of the route, as a module that runs code at load does. The pages still work; they carry a script they could have skipped. To see whether this happens to you, rebuild and opendist/manifest.json: a native component whose record has nohostsalways sends its script. The build does not say which module keeps it, so look for the handing-on forms above in the modules that import the same table, and read the rule and the ways out under New. Update for 2.0.0-alpha.64: that version takes most of this back. A localconstthat holds the array or an item, a call of a top-level function of your app that only reads it,Object.keysand a few other reads, and modules that only the server runs no longer keep a script; the last two items under Upgrading of 2.0.0-alpha.64 say what does. - Rebuild to get this version’s lists; the two notes of 2.0.0-alpha.58 apply as they were (#539). The scripts a page carries are decided at build, so a build made by an earlier version keeps its lists. Code of your own that inserts the markup of a native component the server did not render still needs
component_scripts = "route", and a package that does work when it is imported still runs only on the pages that carry the scripts of the components importing it.
New
- Module code that reads imported data when it loads no longer keeps a component’s script on every page (#539). An app report showed six shapes that only build values from tables another module exports. All of these now count as building values: a member of an imported object (
T.a,{ ...T.side },Math.round(T.a / 3)); a computed index or key that is itself plain data (R[k],{ [k]: 1 }), but never as the target of a call or as a callback;'name' in p; string, number and array methods that take no function, inside an inline callback (ARR.map((p) => p.path.split('/')[1]),toLowerCase,startsWith,endsWith,includes,indexOf,trim,padStart,slice,substring,at,charAt,toFixed,toString,join,concat, andreplaceorreplaceAllwith two strings); and an imported array read withARR.find((x) => x.k === k)?.k,ARR.map((x) => x.k),ARR[0].k,for (const x of ARR) void x.korARR.length.replacewith a function or a regular expression,localeCompareand anything else not listed still keep the script. The module that exports an array reading it itself (.find,.map,[0],for…of) no longer counts against it either. - The rule: imported data is trusted only when it is a plain literal and the whole app only reads it (#539). Plain data is an
export constof one of your modules whose value is a literal of strings, numbers, booleans,null, arrays and plain objects, with no function, no computed key and no spread in it. Reading it means the forms above. A number or a string taken out of it may go anywhere. Anything else, in any module of the app, makes it not data for every module: assigning into it,sort,pushor another method not on the list, handing it or one of its objects to a function, returning it or one of its objects, storing it or one of its objects in another value,import()of its module, or animport * as nsobject used other than asns.name. Then the modules that read it when they load keep their scripts on every page, as before. The likeliest surprises, each with the way out: a helper that returns an item (export const find = (k) => ARR.find((x) => x.k === k),export const same = () => ARR,export const row = ARR[0]) returns an object someone could write to, so return the member you need (ARR[0].k,ARR.find((x) => x.k === k)?.k); a stored copy of an array of objects (const xs = [...ARR], a storedARR.filter(…)) holds the same objects, so storeARR.map((x) => x.k)instead, since a copy of strings or numbers is fine;Object.keys(T), a destructuring such asconst { a } = Torconst [first] = ARR,forEach,reduceand an alias such asconst a = ARRare not on the list of reads, so read the member where you need it (T.a) or usefor…of,map,filterorfind. If a table is handed on for a reason you cannot change, keep a literal list in the module that needs it. The build does not print which module keeps a script;dist/manifest.jsonshows only whether a component hashosts. Measured once, on one larger app (102 native components): nothing changed, and 91 scripts can be left out before and after. The gain is for apps that derive module data from imported tables. Update for 2.0.0-alpha.64:Object.keys(alsoObject.values,Object.hasOwnandArray.isArray), a localconstalias such asconst a = ARRand passing the array to a function of your own that only reads it are now reads; returning an item, destructuring,forEachandreducestill keep the script.
Fixed
- A generic arrow function in a
.tsfile, written without a trailing comma, is read as TypeScript (#539). The compiler parsed every module as TSX, so<T>(l: T): T => lin a.tsfile opened a JSX element and the module was treated as one it could not analyse: its component’s script stayed on every page, and one component of our larger test app got amodule-writtenfinding it did not deserve, which is gone..ts,.mtsand.ctsfiles now parse as TypeScript, and.tsxfiles as before.
2.0.0-alpha.61 · 22 November 2026
This version makes a NaN, an Infinity or a bigint in a value the server computes for a component print and compare as in JavaScript, and it spreads the calls from the server to its JavaScript workers over more workers, which makes loaders and actions answer faster on a quiet site at the price of some extra CPU. Read the first two items under Upgrading: a condition on a 0n, an Infinity or a NaN in such a value can now take another branch than in 2.0.0-alpha.60.
Upgrading: what you must change
- A
0nin a value the server computes is now false in a condition, as in JavaScript; 2.0.0-alpha.60 said it counted as true (#538). If a page tests such a value and relied on the alpha.60 reading, that condition now takes the other branch. This holds for a value a job returns and for each item of an array a job returns. Abigintthat sits deeper, as a member of an object, is not marked: it still arrives as its decimal digits, and there0nstill reads as true, as in 2.0.0-alpha.60. - A
NaN,Infinityor-Infinityin such a value now prints and compares as in JavaScript instead of printing nothing (#538). What you may see change on a page: text that was empty now showsNaN,Infinityor-Infinity(the browser already showed it after hydration), astyle={{ width: v }}now readswidth:NaNpx, and a condition on anInfinitynow takes the true branch where it used to take the false one (aNaNis false either way). To find the places, look for a value computed on the server from a division or a parse (a / b,Number(text),parseFloat(text)) that a component prints or tests. This also covers a value a job returns and each item of an array a job returns; deeper in an object, aNaNstill arrives asnull. Both changes above take effect after you rebuild the app with this version. - New warning in
brust devonly; nothing to change (#538). When a job returns an object, aDate, aMap, aSetor aPromisefor a position that prints it (text or an attribute), the dev server logs once for each component, value and kind, for examplebrust dev: component `Card` prints the job value `items` (an object) as text: brust printed "…" (its JSON image); React throws ("Objects are not valid as a React child"). Return a string or a number from the job for that position.The text names the component, the value and its kind, and says what React does with it. A built and started app prints the same bytes and logs nothing. - Nothing to change for the worker spread (#535). Its cost in CPU is stated under Changes.
Fixed
- The values a component computes on the server keep
NaN,Infinity,-Infinityandbigintas they are in JavaScript (#538). In 2.0.0-alpha.60 aNaNorInfinityarrived asnulland printed nothing, and abigintarrived as digits that read as true even for0n. Now the worker marks such a value and the server reads it back as what it was, with no new kind of value on the page. Text, attributes,style, the conditions&&,||and??, comparisons and arithmetic give what React gives. The served test checks seven values (NaN,Infinity,-Infinity,-0,10n,0nand42) on a page the server computes and on a page the client re-renders, in text, in an attribute, in a condition, as a prop to a child and as the items of an array, against React’s own render, and the page the client re-renders paints the same first and after a state change. A table of 2,844 generated cases compares each template operator and filter with JavaScript. The limits: only a value a job returns and each item of an array a job returns is marked, so aNaNor abigintas a member of an object keeps the old behaviour; aNaNorInfinitythat one precomputed value passes as an input to a separate one still arrives asnull; loader data is unchanged, so abigintin loader data still answers 500; andbigintarithmetic on the server runs on 128-bit integers, so a result beyond 2127 fails the page where JavaScript would print it. Mixing abigintwith a number in arithmetic, or dividing one by zero, fails the render as it throws in React. Rebuild to get it: the marking is written into the built jobs bundle, so a build made by an earlier version keeps the previous behaviour.
Changes
- Calls from the server to its JavaScript workers are spread over more workers, which costs some CPU at moderate load (#535). Before, a worker took calls until all its slots were full, so on a quiet site every loader and action ran on one worker thread while the others idled: with 8 workers and 8 calls at once, all of them went to the first. Now a worker takes calls while it has fewer than two in flight, then the next worker is used. Measured once, on our benchmark app with 8 workers and 8 connections at once (12 paired runs of the previous build and this one): requests per second were 1.34 times as high for an action read, 1.40 times for an action write and 1.16 times for a page with a React island, with CPU per request within 3% for the read and the island page and 5% lower for the write. A page that renders a long list gained nothing (1.00 times) and used about 4% more CPU. The price: at moderate load the action path uses up to about a fifth more CPU per call, because more worker threads each run part of the time instead of a few staying busy. With 32 calls in flight it used about 16% more CPU per request and answered 1.11 times as many requests per second, so throughput is not lower. With 120 connections at once, which keeps every worker busy, CPU per request was unchanged within the measurement. One app on one machine, not a promise for yours. Nothing changes with
--workers 1, for a page served from the page cache or a static page, which make no worker call, or for a client that sends one request at a time, which still uses the first worker.
2.0.0-alpha.60 · 22 November 2026
This version stops a bigint in a value the server computes for a component from failing the whole page with a 500, and makes the server spend less CPU turning style={{…}} objects into CSS text and hashing layouts. The HTML it sends is the same. Nothing in your app has to change.
Upgrading: what you must change
- Nothing to change (#534, #536). An app that builds and runs on 2.0.0-alpha.59 builds and runs the same on this version. The one thing you may notice is expected: a value the server computes for a component that holds a
bigintnow prints its digits where it used to answer 500 (see Fixed). The faster rendering changes no output: its tests compare the new code with the previous code on generated inputs.
Fixed
- A
bigintin a value the server computes for a component no longer makes the page answer 500 (#534). These are the precomputed values of a component, such as a class built by a helper or auseId. They travel from the worker to the server as JSON, JSON has nobigint, and one in a value made the whole reply fail. Now thebigintis carried as its decimal digits, so text and attributes print the number as React does; the served test compares the page with React’s own output for10nin text, in an attribute, as an array item and as a member of an object. One difference stays, and it is documented on the Rendering tiers page: in a test the digits are a non-empty string, so0ncounts as true on the server where JavaScript reads it as false. A reply that has nobigintis written as before. Three things are unchanged:NaNandInfinityin such a value still arrive asnulland print nothing; abigintin loader data is not converted, so that page still answers 500; and the Cloudflare entry that a build writes applies the same rule to these values only. Update for 2.0.0-alpha.61: the first two of these changed; see the first two items under Upgrading in that version.
Changes
- Rendering a page on the server takes less CPU, and the HTML is byte for byte the same (#536). Two things got cheaper: writing a
style={{…}}object as CSS text, and the per-layout hash that client-side navigation uses. Measured once, on our benchmark app (12 paired runs of the previous build and this one, same machine): CPU per request fell by about 17% for a page of 151 rows whose badges each carry a style object, by about 19% for a small page rendered on every request, and by about 5% for a page with a React island. This is one app on one machine, not a promise for yours; a page you serve from the page cache does not render at all, so it gains nothing.
2.0.0-alpha.59 · 21 November 2026
This version lets a native component’s script be left out of more pages: a module that only builds its own values when it loads, such as a Set, a spread or a filter over a table, no longer makes the script ship on every page of the route. It also moves brust’s own build and tests to Bun 1.4.5. Nothing in your app has to change for either.
Upgrading: what you must change
- Nothing to change for Bun 1.4.5 (#530). The minimum Bun that the docs state for an app is still Bun 1.4 or newer, and
@brust/cache-redisstill declaresbun >=1.2.23: nothing in this version needs 1.4.5. We recommend running your app on 1.4.5, the version that brust’s own build, tests and release now use. An app created withcreate-appafter this version lists@types/bun^1.4.5in itsdevDependencies; an existing app keeps the range it has. - Nothing to change for the wider script judgement (#532); rebuild to get it. brust leaves a script out only for module code that does nothing when it loads except build its own values. The first item under Upgrading in 2.0.0-alpha.58 still applies as it was: if your own code inserts the markup of a native component that the server did not render, set
component_scripts = "route"under[build]inbrust.toml.
New
- A module that only builds its own values when it loads no longer keeps a component’s script on every page (#532). In 2.0.0-alpha.58 a script was always sent when its chunk bundled an app module that ran code at load, and an app report showed that this caught modules that only build data. Now these forms count as building values:
new Set(…)andnew Map(…), empty or of an array literal or of another such value, with.addand.setchained on the new value; a spread of an array literal, a collection or a constant of the module, and the spread of an array another of your modules exports as a literal; the array methodsfilter,map,flatMap,reduce,find,some,every,sortof a copy and the other read-only ones, and the reads of aSetorMap, when their callback is written inline as an arrow or afunctionthat only builds values; a call of a function the same module declares, when its body is onlyconstdeclarations,if,returnand calls judged the same way; and a template that holds a string or number constant imported from your own module. The served test builds a component whose module uses all of them: its script is left out of a page that does not draw it, and the page that does draw it works. On our larger test app with 105 native components, 94 now have a script a page can leave out (93 in 2.0.0-alpha.58); the one that moved was held only by a template of an imported string constant, and no other component changed. Tiers and findings are the same as before: this only decides which pages carry the script. Update for 2.0.0-alpha.62: an imported array counts as plain data only while every module of the app only reads it; see the first item under Upgrading in that version. - What still keeps the script on every page, because brust cannot prove it only builds values (#532). A callback that is not written inline (a named function or a
constarrow handed tosortormap);sortorreverseof an imported array in place; a spread or aSetof a value brust cannot read as plain data, such as an imported function result or an object with a getter; a function the module calls that useslet, a loop,try,this,arguments, recursion orasync, writes outside itself, or is imported from another module of yours;Array.from; and a call of a package with a function.
Changes
- brust is built and tested with Bun 1.4.5 (#530). The CI and release workflows run Bun 1.4.5, and the compiler links the Bun parser, printer and React compiler at that version. Those sources did not change between 1.4.4 and 1.4.5.
2.0.0-alpha.58 · 21 November 2026
This version sends a page the scripts of the native components it contains, not those of every native component its route could draw. A page that draws one widget out of six loads one widget’s script. If your own code inserts the markup of a native component the server did not render, or a package you import only from components a page does not draw does work when it loads, read the first two items below.
Upgrading: what you must change
- Code of your own that inserts the markup of a native component the server did not render finds no script for it, and the component stays inert with no error (#528). That is an HTML string you build and put in the page, or a fragment you fetch from another URL and insert, when the markup holds the element of a native component that the page you are on did not contain. Set
component_scripts = "route"under[build]inbrust.tomland rebuild: every page then carries the scripts of every native component its route can draw, as in the previous versions. To find these places, search your client code forinnerHTML,insertAdjacentHTML,importNodeand for code that appends fetched markup, and check whether what they insert can hold a native component the current page did not draw. Cloning a node that is already in the page is not affected, and neither is the markup of a component that the page sent hidden, such as the other branch of a condition on state or the row of a list that was empty on the server: the page contains those, so their scripts stay. - Code a package runs when it is imported no longer runs on a page that does not draw the components that import it (#528). brust does not check code outside the app root and its
[build] source_roots. A package that registers something global as soon as it loads, imported only by components a page does not draw, is not loaded on that page, and a package call that your own module makes when it loads, with data only, runs only on the pages that carry that component’s script. If a page needs that code on every page of a route, setcomponent_scripts = "route". Code of your own is judged: a script is always sent, on every page of its route, when the component bundles an app module that runs code when it loads (a statement at the top level, a call of your own code, a class,new), so that code runs on every page of the route as before. A function the module declares runs nothing until it is called and does not count, but passing one to a package call at load does. Update for 2.0.0-alpha.59: a module that only builds its own values when it loads (a collection, a spread, an array method with an inline callback, a call of its own function that only builds values) no longer counts; see the first item under New in that version. - Rebuild to get the smaller lists;
manifest.jsongains two fields (#528). A component record can carryhosts, and the manifest hascomponent_scriptswhen you set it to"route". A build from an earlier version has nohosts, and a server of this version sends the previous list for it. This only matters to a tool that checksmanifest.jsonstrictly. React islands, the runtime and its feature modules, stores, runtime components and client navigation are sent as before.
New
- A response carries the script of a native component only when the page contains that component (#528). The server looks for the component’s element in the finished HTML before it writes the script tags, and leaves out the script of a component with no element in it. Before, the list depended on the route only: every native script the route could print, on every response. Markup the browser may still show later is part of the HTML, so its scripts stay: the other branch of a condition over state or over a prop that can change, and the row of a list that is empty on the server, which is sent as a hidden template that includes the components inside a row, nested ones too. The served tests click through each case: a server switch, a state branch, a prop branch, a list filled from an action with a child and a grandchild component, a component inside a hidden copy, a native component inside a React island, host-specialised copies and a layout that draws a host. A page that the cache stores holds the list as filtered, so the first response and the cached one are the same bytes. A client navigation loads the scripts that the next page lists before it swaps the page in, and going back works the same.
brust build --target staticpages carry the same lists. The Cloudflare target calls the same server function, but the served tests do not run on it. See Only the components the page drew. [build] component_scriptschooses between the two lists (#528)."drawn"is the default;"route"sends every script a route can draw, whatever the page contains. Any other value is aconfigerror. See Configuration.- What it saves, measured. On a small test app with a page that draws none of six native components behind a server switch, the page’s script tags went from 10 to 4 and the JavaScript it loads from 126,854 to 11,661 bytes;
loadon a throttled network profile went from about 182 ms to about 66 ms. A page that draws one of the six loads 5 tags and 12,270 bytes. On one larger app with 105 native components, 93 have a script that a page can now leave out; the other 12 are always sent, because their script bundles a module of the app that runs code when it loads: 10 build a table by calling your own code at load, and the rest convert an imported value to a string or build anew Setat load. The numbers are one small app and one larger one, not a promise for yours.
2.0.0-alpha.57 · 21 November 2026
This version fixes a click that threw a ReferenceError when an inline handler called a function a custom hook returns, lets such a function be an event handler in every spelling the tests prove, and lets a module-level table built from a table another module exports keep its component off React.
Upgrading: what you must change
- If you wrote
onClick={() => s.run()}after the alpha.55 notes advised it, upgrade: before this version the click threw aReferenceError(#526). Heresis what a custom hook returns, as inconst s = useS(); … onClick={() => s.run()}, andrunis one of its functions. The component compiled without React, but the page script did not containrun, so a click threw in the browser console and the build printed nothing. Nothing to change in your code: rebuild with this version. The destructured form,const { run } = useS(); onClick={() => run()}, was not affected. The same fix covers an effect with an expression body,useEffect(() => s.run(), []). - Some components compile lighter than before, and a
[tiers]snapshot reports it without failing the build (#522, #525). A component whose custom hook returns a function that is used as an event handler by name and reads a store or a context value is no longer refused withhook-shape(#525). A component whose module builds a table from an imported table is no longer refused withmodule-side-effect(#522). Ifbrust.tomlhas[tiers] snapshot, the build prints one line for each, such astiers: components/views/Card.tsx#default react -> native, and passes; the snapshot file is left as it is until you runbrust build --update-tiers. A[tiers.max]rule fails the build only for a component that compiles heavier than the rule allows, so no rule of yours fails because a component got lighter. - A custom hook imported through
export *is looked up as JavaScript looks it up (#522). When a module hasexport * from './x'and also exports the hook’s name itself, in any form, that export is the one JavaScript uses. brust used to followexport *past it and use a hook declared in./x; now the search stops at the module’s own export, and the component renders with React when that export is not a hook function brust can read. Rare: it needs one name exported twice. - TypeScript only:
RenderContext.notNowis typed as a function property, not a method (#524). Nothing to change. Code that callsctx.notNow()compiles as before.
New
- A module-level table built from a table another module exports no longer makes the component a React island (#522).
const NAV = [{ label: "Home", icon: ICON.overview }]is accepted whenICONisexport const ICON = { … }in a module of your app (an object or array literal, also through a re-export), with no getter, spread or computed key on the way to the value, and nothing in the app changes it. Also accepted at module scope: template strings and operators over accepted values, regex literals without thegoryflag, andArray.from({ length: 24 }, (_, i) => `${i}:00`). Still React, with the finding: a class, aletorvarthat a function changes, a statement that runs at load, a call of your own function at load, and a mutating call such aspush,deleteorfillon a value brust cannot name, for example(c ? a : b)(…).delete(id)ornew Array(n).fill(0). On one app of about 550 components themodule-side-effectfindings went from 55 to 18, 6 components that rendered with React now compile without it, and none got heavier. See Rendering tiers. - A function a custom hook returns can be an event handler in every spelling the tests prove (#525, #526). By name,
onClick={s.run}or a destructuredonClick={run}, also when the function reads a store or a context value (#525): the served tests click each case in Chromium and compare with React for a direct read, a derived value, a store action, a store another component changes between clicks, two instances of the hook, two Providers, a nested Provider and the context default. Inline with an expression body,() => s.run(),() => run()andgo(s.run)(#526). The function may read hook state, its parameters, props, derived values, a hook-local function, a store or a context. Still React, with the findinghook-return-shape(“an object a custom hook returns is used as a whole …”): a block body through the hook object,() => { s.run() }, the object read as a whole,s['run'](),const f = s.run; f()ands.run?.(). Write an expression body, or destructure the hook’s result. ctx.notNow()may be called detached, and its value must be returned as it is (#524).const { notNow } = ctx; return notNow()answers “not now”. The answer is one value that brust compares by identity, so a copy,{ ...ctx.notNow() }, is not a not-now answer: it fails withcomponents.render returned object, not a string or null. See Runtime components.
Fixed
- An inline handler or an effect that calls a hook function through the hook object no longer throws
ReferenceError(#526).() => s.run(),go(s.run)anduseEffect(() => s.run(), [])now declarerunin the page script, and the props the function reads reach the client. A browser case with both spellings, inline through the object and destructured, failed on the previous version with theReferenceErrorand passes now.
Changes
- The
module-side-effectfinding names the declaration or the function, its line and what was not proven (#522). For examplethis module's `const STAMP = …` (line 1) may run code when the module loads: it calls `Date.now(…)`orthis module's function `add` (line 3) may change a module binding: `LIST.push(…)`. A moduleconstthat reads anotherconstdeclared below it is now refused as well, withit reads `B` before it is declared; JavaScript throws at that line when the module loads. - The CLI page says that a failed build publishes nothing (#524). The build is written beside the output directory and replaces it only when it has finished, so an existing
dist/stays as the last good build left it. A test now covers it for a build that fails withtemplate-size. See Large templates.
2.0.0-alpha.56 · 21 November 2026
This version lets the render of your runtime components answer “not now” instead of returning null or throwing, and lets you set a size budget for a template so the build fails when one grows past it.
Upgrading: what you must change
Nothing: an app on the previous version builds and runs unchanged. [build] template_max_bytes is opt-in; with no value, or 0, the build prints what it printed before, including the warning for a template over 1 MB. A render that returns a string, null or nothing behaves as before, and any other value is still an error. One TypeScript detail: RenderContext is an exported type and now has a notNow() member, so an object you type as RenderContext yourself, in a test for example, needs it.
New
renderofcomponentscan answer “not now” withreturn ctx.notNow()(#519). Return it, directly or from a promise, when the HTML is not ready yet, for example while your renderer warms up. The slot is an empty host your client mounts into, nothing is stored in the island HTML cache, the page is not stored in the page cache, and the server logs nothing; the next page render callsrenderfor that component again.nullis kept with no time limit, and a throw is not kept but logs arender threwline, so neither fits “ask me again”. Runtime components run on the native server only: the Cloudflare target refuses them at build (dynamic-target), so this does not apply there. See Runtime components.[build] template_max_bytesinbrust.tomlfails the build when a template is larger than the budget you set (#520). The value is a number of bytes; absent or0means no budget. A build with a template over it stops with onetemplate-sizeerror that lists every such template, largest first, with its size and the file it came from (below), and writes nodist. A template over the budget is reported by the error only; one under it keeps the 1 MB warning. The budget applies to every template the build writes, for every target.brust devprints the same lines aswarning template-sizeand keeps running. A negative or fractional value, or one that is not a number, is aconfigerror. See Large templates and Configuration.
With template_max_bytes = 1000000, a page whose template is 1.2 MB stops the build:
$ brust build
error template-size page_6879790b.jinja is 1200068 bytes (1.1 MB), over [build] template_max_bytes = 1000000 (Page.tsx)
a template grows with what a page inlines; see https://brust.dev/docs/cli#large-templatesChanges
- Two docs pages say what they left implicit. Rendering tiers now says that the methods the template prints take literal arguments only:
s.slice(0, 3)andxs.join(', ')are printed, ands.slice(0, n)runs as a job. Caching says that no call drops one entry of the island HTML cache: an entry leaves when it is evicted, when the ref has a new artifact, or when the server restarts, andctx.notNow()is the way to avoid storing an answer.
2.0.0-alpha.55 · 21 November 2026
This version lets more everyday list and hook code compile without React: a list callback may destructure its item and compute row values, the component body may destructure, and a custom hook may come through a re-exporting module or take a default argument. It also adds [dev] watch for files outside the app, fixes a hook helper that stopped a page script from loading, and makes tier errors point at the right line.
Upgrading: what you must change
- A component whose custom hook returns a function that is used as an event handler by name, and that function reads a store or a context value, now renders with React (#517). That is
onClick={q.find}, orconst { say } = useSay(); … onClick={say}, where the function reads a store or a context inside the hook. The build prints ahook-shapefinding that names the hook and the function and saysused as an event handler by name, reads a store(orreads a context value); brust does not check that read on the client yet. The output is the same as before for a component that works, and the page may be heavier. If yourbrust.tomlhas a[tiers]snapshot or a[tiers.max]rule that covers such a component, the build now fails with atiererror: check the component, then runbrust build --update-tiersto accept the change or relax the rule. To keep the component light, call the function from an inline handler,onClick={() => q.find()}. To find these components, build once and search the output forhook-shape. Update for 2.0.0-alpha.57: the refusal is lifted there, and the inline form above threw aReferenceErroron click before that version. - A
[dev]table inbrust.tomlis now checked (#514). It has one key,watch. Any other key, or a[dev]that is not a table, is aconfigerror atbrust buildand atbrust dev; before, the table was ignored. This only matters if your app already has a[dev]table of its own: searchbrust.tomlfor[dev]and remove what is notwatch. - The first line of a
tiererror can show a different line number (#516). For a component that compiles to native because of aref, a prop linked to a child, or an expression that depends on state, the position used to be the start of the file (:1:1). It is now the line of the first cause that has one. Nothing to change, unless a script parses that line.
New
- A list callback may destructure its item and compute row values, and the component stays native or static (#513). The item may be a flat pattern,
({ id, name }) =>or([key, , value]) =>. The body may be a block ofconstdeclarations andif (…) return null;statements before onereturn <li …/>. Before, both made the component a React island (list-shape). Four kinds of callback still stay React and the build names the reason: an item pattern with a default, a nested pattern, a rest element or a computed key (or a pattern as the index); a row binding that islet,varor a pattern, or a const that holds JSX or calls a hook; an early return other thanreturn null; and a row const read where a nested list or a function declares a name its value reads. One difference from React: brust does not keep a row const as a variable, so a const read twice calls its helper twice. For a pure render the output is the same. See React coverage. - The component body may destructure:
const { kind, m: msg } = askorconst [first, , third] = pair(#517). Over a path of props, state, a store view or another body const, each name reads its member of that path. Over anything else, such as a call, the call runs once and each name reads its member of the result. A default, a nested pattern, a rest element or a computed key keeps the component React (body-shape). - A custom hook may be imported through a module that only re-exports it, and may take a parameter with a default (#517). The re-export may be
export { useX } from './x',import { useX } from './x'; export { useX }(renamed too) orexport * from './x', up to four modules deep. A parameter such asselector = 'input'is accepted when its default reads no other parameter and calls nothing: a call that leaves the argument out, or passesundefined, gets the default, as in React. Before, both were React islands (hook-unsupportedandhook-shape). [dev] watchmakesbrust devreload for files outside the app (#514). It is an array of files or directories relative to the app root, for examplewatch = ["../../packages/api"]for a workspace package reached throughnode_modules. It only watches: unlikesource_rootsit does not change what imports may reach, andbrust buildandbrust startignore it. A path that does not exist is onewarning dev.watchline, and the session goes on. See Dev mode and Configuration.brust build --update-tierswithout a[tiers] snapshotsays so, and atiererror points at the line of the first cause (#516). The build printstiers: --update-tiers has no effect: no [tiers] snapshot is configuredinstead of nothing. A cause that is aref, a linked child or a state-dependent expression now carries a line, as a state or an event handler did.
Fixed
- A component did nothing in the browser when a hook’s module exported a helper function that the hook’s handler used (#517). With
export function shout(x) { … }next touseShout, the page script was written with theexportkeyword inside it and the browser refused it (Unexpected export); the build printed nothing. The helper is now carried withoutexport. - A function returned by a custom hook and used as an event handler by name could fail on click or read a wrong value (#517). For
onClick={q.find}, a name the function read inside the hook (the hook’s own function or derived value) was missing from the page script, so the click raised an error. A prop the function read, through a hook parameter, was not sent to the browser and arrived asundefined. Both are now declared and carried. A read of a store or a context there is not checked on the client yet, so that component renders with React (see Upgrading).
Changes
- Two docs pages state what was implicit (#515). Caching has one table with the contract of every cache layer: key, lifetime, what is stored, what a route
bypassskips and how it is configured. Rendering tiers says which expressions the template prints directly and that anything else runs as your own JavaScript in a server job. - The Navigation page says that
data-brust-prefetch="false"on<html>turns prefetch off for the whole app, and that the navigator handlespopstatebefore a listener you add (#514). To follow a back or forward move, listen forbrust:nav:load,successanderrorand readtrigger. - The tier pages gain three notes (#516). A component under
[build] source_rootsoutside the app is matched by a key that starts with../; the snapshot lists the components of your source, not copies; and the check runs after a successful compile, so a build error comes first. - On one app report,
list-shapefindings went from 65 to 4 (#513), and the 24 findings about a destructured body, a re-exported hook or a defaulted hook parameter went to 0 (#517). Of its 548 components, those rendering with React went from 353 to 350 after #517. No component moved to a heavier tier in either measurement.
2.0.0-alpha.54 · 21 November 2026
This version lets you state in brust.toml the heaviest tier a component may compile to and keep a committed record of every component’s tier, so a tier that grows with an ordinary edit fails the build instead of shipping.
Upgrading: what you must change
Nothing: an app on the previous version builds and runs unchanged. [tiers] is opt-in; an app without it prints and writes nothing new.
New
[tiers.max]inbrust.tomlstates the heaviest tier a component may compile to, andbrust buildfails when one compiles heavier (#510). Each key is a path pattern relative to the app root, with an optional#Exportsuffix (#defaultfor the default export); the value isstatic,nativeorreact, lightest to heaviest. A heavier component fails the build, for every target, with onetiererror that lists every such component: its file, line and name, then each cause. For a component that compiles to React, the causes are the fallback rules with their messages and the fix. For a component that compiles to native wherestaticis required, they are what makes it interactive, with lines (the block below the list shows one). When several patterns match, one with#Exportwins, then the one with more literal characters; two patterns that tie on both counts and name different tiers are a config error that names both. A pattern that matches no component printswarning tiers "<pattern>" matches no component. A copy the compiler makes of a component for some call sites is checked against that component’s pattern, and the error says which component places it.brust devprints the same findings aswarning tierlines and keeps running. See Configuration and Rendering tiers.[tiers] snapshotkeeps a committed record of every component’s tier, andbrust build --update-tiersaccepts a change (#510). The first build writes the file. After that, a component heavier than the file records fails the build with the same reasons as above. A lighter, new or removed component prints one line, such astiers: components/views/Card.tsx#default native -> static, and the file is left as it is. When the change is wanted,brust build --update-tiersrewrites the file and prints each difference; the[tiers.max]rules still apply.brust devnever writes it. See Rendering tiers and the CLI page.
The error for a component that compiles to native where static is required:
$ brust build
error tier components/views/Counter.tsx:4:1 Counter compiles to native; [tiers.max] "components/views/**" allows static
state `count` is set (line 4)
an event handler (line 6)2.0.0-alpha.53 · 21 November 2026
This version lets more of a normally written React app compile without React: a custom hook in another module can read a store, a small arrow you declare in the component costs no tier, and a component with a precomputed value placed inside another one no longer turns the outer component into an island. No source change is needed.
Changes
- A custom hook in another module may read a store and the components that call it stay native (#508). The hook’s module must import the store handle:
import { team } from '../team'andconst max = useStore(team).max; return maxinlib/use-max.ts. Before, every component that called such a hook was a React island (hook-shape). A hook whose module declares the store itself is still React: define the store in a module of its own and import it. So isreturn useStore(team).max, which is a hook call inside an expression: bind it to a name first. See Store. - One store field can be read as
const max = useStore(team).max(#508). It was a React island (hook-unsupported) and is now read natively, like the whole view or a destructuring. An optional chain (?.) or a computed key is still not read. - A small arrow function declared in the component costs no tier when you call it in the markup (#508). For
const fmt = (x: number) => x + ' ' + props.unit, the call{fmt(props.a)}, in the markup, in a state initialiser or in a derived value, is compiled as the arrow’s expression. Before, the component was a React island (client-function-in-job). The arrow stays a function, and the call compiles as it did before, in four cases: an arrow with a block body, a call whose argument contains a call, an arrow that calls a method of an imported object or of a store handle, and a call in the rows of a list whose item or index is spelled like a name the arrow reads. - A component with a precomputed value, placed inside another component that has one too, now keeps the outer component’s tier (#508). A precomputed value is a class built by a helper or a
useId. At that place the inner component renders as a React island, a copy compiled for that place, and the build prints anested-fed-childwarning on the inner component; the copy is listed indist/manifest.jsonwith the id<id>_r. Everywhere else the inner component keeps its own tier. Before, the outer component became the island (nested-instance); it still does when the copy would not help. Both the warning and the_rentries are expected after you upgrade. See Rendering tiers. - On an app of 521 components, 60 components moved to a lighter tier and none to a heavier one (#508). Measured with
brust build --dev: React 406 → 348, native 26 → 86, static 89 → 95. Two of the 348 React entries are the new copies.
2.0.0-alpha.52 · 20 November 2026
This version makes a long &&, ||, ?? or ?. chain compile to a template that grows with the chain instead of doubling at every operand, warns when a template is huge, and makes brust start load only the templates a route renders, which cuts its memory and start-up time.
New
brust buildwarns when a template it writes is over 1 MB (#505). The line readswarning template <name> is <n> MB (<source>)and says where the template came from. The build still succeeds, and a page under 1 MB prints nothing. A template that large is worth a look: it is often one expression printed many times over. See Large templates on the CLI page.
Fixed
- A chain of
&&,||or??no longer doubles (or triples) the template text at every operand (#505). The compiler printed the left side of each operator more than once, so 16 operands of&&became one condition of 1,769,795 bytes, and??grew by a factor of three per operand. A real app with such a chain in a component placed in many pages produced templates of megabytes each, andbrust startused gigabytes of memory to load them. Each operand is now printed once or a fixed number of times: the same 16-operand&&or||chain is 959 bytes, a??chain 1,541 bytes. The rendered HTML is unchanged. - An optional chain such as
a?.b?.cno longer triples the template text at every?.(#505). Each optional link printed its target three times. The path is now printed once under one guard that covers every optional link, as JavaScript short-circuits the whole chain. The rendered HTML is unchanged.
Changes
- A build writes, and
brust startreads and compiles, only the templates of pages and layouts (#506). A route renders its pages and layouts by name; a component you place in a page is already printed inside that page’s template.dist/jinja/and the Cloudflare Worker bundle now hold those templates only, and a component that is not a page or layout has nodist/jinja/<component>.jinjaof its own. If a script of yours reads one of those files, build withBRUST_BUILD_ALL_TEMPLATES=1: it writes every component’s template again, to read what one component compiles to, and the server ignores the extra files. Rendered output, the manifest and the request path are unchanged. - On an app with 148 components, the template side of start-up fell from 145 MB to 44 MB resident and from about 1 second to 0.2 seconds (#506). Of its 33.1 MB of template text, 4 templates (6.6 MB) are rendered by name, and
dist/jinjawent from 33.1 MB to 6.6 MB. These were measured on Linux with a debug build.
2.0.0-alpha.51 · 18 November 2026
This version lets a loader render the route’s own page at any error status, such as a 403 page or a 503 maintenance page, and makes a mistyped || in a cache expression say what to write instead.
New
- A loader can render the route’s own page at any status from 400 to 599 with
renderStatus(status, data)(#503). Return it from a loader, as you donotFound(): a 403 page for a visitor without access, a 451, a 503 maintenance page. The page is the route’s own, with its layouts; the verdict’sdatais merged over the parent loaders’ data, and the loaders’ response headers and store values apply. It is exported from@brust/corewherevernotFoundis. A status outside 400–599 throws when the loader calls it: useredirect()for a 3xx, and return the data for a 200.notFound(data)is unchanged and equalsrenderStatus(404, data). - A page rendered by
renderStatusis never stored in the page cache, and client navigation shows it like a not-found page (#503). The loader runs on every request, so a 403 for one visitor is never served to another. When a visitor follows a link to such a page, the browser swaps it in with its status, as it does fornotFound(), and does not keep it in the client cache. UsehttpError()instead when the answer is a body and not a page, such as a JSON error for an API or a plain-text 429: it renders no template and no layout. brust build --target staticrefuses a page that renders at an error status (#503). As withnotFound()returned from an ordinary route, the build fails withssg-renderand the status it got, because a static file cannot answer at a status other than 200.
Changes
- A hand-built verdict is judged by its
renderfield, not by its status (#503). Before, any verdict with a status other than 404 became a redirect to/, so a verdict such as{ status: 403, render: true }sent the visitor to the home page instead of showing the page. Now a verdict withrender: truerenders at its status, and one with a status outside 400–599 is a loader error (500) and never a redirect. Verdicts built withnotFound(),renderStatus()andredirect()behave as documented. - A cache expression written with
||or&&now fails with a message that names the function to write (#503).cookie(a) || query(b)used to fail withtrailing input at byte N. It now sayscache expression: '||' is not an operator: write or(a, b)(andand(a, b)for&&). No new syntax: several conditions are still writtenor(a, b)andand(a, b), and other trailing input keeps the generic message. The Caching page says so, and its playground shows the same text.
2.0.0-alpha.50 · 13 November 2026
This version stops compileComponent from running code in the source it compiles, lets runtime components place React islands that mount in the browser, and adds an opt-in way to keep exposed modules from changing the chunks of unrelated components. If you pass sources you do not fully trust to compileComponent, upgrade.
Security
compileComponentno longer runs code from the source it compiles (#501). A source that imported a Bun macro (import { x } from "…" with { type: "macro" }) had that macro function run on the server while the source was scanned or bundled, even when the result wasok: false. Every scan and bundle step on the compile path now runs with macros disabled, and a macro import is refused first, asruntime-macrowith its position, before the compiler or any bundle sees the source. Any other import attribute (with { type: "json" }), on an import, a re-export or a dynamicimport(), is refused asruntime-import. You are affected only if your app passescompileComponenta source it does not fully trust. Builds are not affected: they read only your app’s own source and installed packages.
New
- A runtime component can place a React island from your build; the browser mounts it (#500). List the export in
[build] islands = ["shop/sdk.tsx#Motion"], and the module must also be in[build] expose. The build compiles each listed export as an island even when no route renders it, with a chunk and amanifest.runtime.islandsentry. A listed entry that does not exist or is not a React component fails the build.compileComponentthen prints the island’s host with the props you pass and nothing inside, adds its id to the artifact’s newislandsfield, and the page loads the build’s chunk once however many slots place it. The island is not server-rendered. An artifact that names an island the build does not list is refused at registration; an unlisted React component is refused as before. Known limit: a listed component is bundled into its own island chunk together with its exposed module, so in the browser that module has a second instance next to the exposedx-file. A store defined in it is still one store, because stores register by name; any other module-level state is not shared. Theexpose-isolated-duplicatewarning does not report this. [build] expose_isolated = truekeeps an exposed module from re-chunking an unrelated component (#499). By default the exposed files and your built components are one bundle, so a module that both a component and an exposed file import is hoisted into a shared chunk, and the component’s own chunk shrinks to a stub that loads it. Withexpose_isolatedthe exposed files are built first, on their own, and a component imports each by its URL; the component keeps its own copy of whatever else it shares with them, and each exposed module is still one instance. The price is the copy: a module or package that both sides import runs once on each side, so a module that holds state must be exposed or reached only through an exposed module. The build prints oneexpose-isolated-duplicatewarning that names every module it bundled on both sides, and anexpose-isolated-no-exposewarning if the flag is set with nothing in[build] expose. It is off by default, and changing it changes the build id.
Changes
- In a component that renders itself, or that holds a
<Dynamic>slot, a React island with per-row props is now client-only instead of turning the component into React (#500). Before, such a leaf made the whole component a React island (rulesnested-instanceandrecursion-unsupported), server-rendered whole. Now the component keeps its static or native tier and the page prints the leaf’s host with that row’s props and nothing inside; the browser mounts it. The build says so with anisland-client-onlywarning. The leaf is no longer in the server HTML: if it must be, render the island outside the recursive component, or map over the list in the route component. Plain nested lists and mutual recursion are unchanged. - A React island whose host arrives empty now mounts instead of hydrating (#500). The island shim hydrates a host that has server HTML and mounts one that has none with
createRoot; one chunk serves both. A page with a server-rendered island behaves as before. In the shadcn coverage report the measured pages that load an island chunk (dropdown-menu, resizable, tabs, tooltip) grew by 1 KB gzip each.
2.0.0-alpha.49 · 13 November 2026
This version lets an app render its own runtime-component islands, and compresses buffered action replies for clients that accept gzip.
New
- A runtime component can be an island that your app builds and renders itself (#497).
components.resolvemay return{ v: 1, build, id, tier: "island", client }with nojinja.clientis your own ES module: it pushes a hydrate function ontoglobalThis.__brustIslands. The<Dynamic>slot prints the same<brust-island>host a built React island gets, so hydration,data-hydrated,data-committedand disposal on SPA navigation work as they do for built islands.compileComponentnever produces an island artifact; you build it yourself. - The new optional
components.render(ref, props, { build, page: { id, total } })returns the HTML of an island’s slot (#497). It is placed inside the host as you give it, so escape what you put in it. A page render makes at most one extra worker call, in whichrenderruns once per distinct (ref, props), in parallel;page.idis the same for every call of one page render andpage.totalis the number of calls in the batch. The HTML is cached per (ref, artifact, props), within[components] cache_entriesand 64 MiB, and again in the page cache, sorendermust depend only on(ref, props): reading a cookie, the user or the time would hand one visitor’s output to the next. Returningnull(or having norender) prints an empty host. A throw, an answer over 4 MiB or no answer prints an empty host and keeps that page out of the cache. The HTML of one page counts against[server] max_loader_response_bytes. - The island’s
clientmodule is served from its own URL, and itsidmust change whenever its code does (#497). It is served at/_brust/rc/<build>/<ref>/<id>.js, at most 256 KiB, withCache-Control: immutableand gzip for clients that accept it. It may import other same-origin modules by absolute path; brust neither bundles nor rewrites them, and[csp]still blocks a cross-origin import. The page gets the island runtime even when it is otherwise all static.
Changes
- Buffered action replies are now gzip-compressed for clients that accept gzip (#496). A reply is compressed when it is 1 KiB or more, has a text, JSON, JavaScript, XML or SVG content type, has no
Content-Encoding,Content-RangeorCache-Control: no-transform, is not a 204, 206 or 304, and gzip makes it smaller. It getsContent-Encoding: gzip; a strongETagis dropped because the bytes change, and a weak one stays. Every reply that passes the rules except the client’sAccept-EncodingcarriesVary: Accept-Encoding. Streamed replies, built-in replies and 101 upgrades are not touched. If one reply holds a secret token (a CSRF token, say) next to input the request reflected back, setCache-Control: no-transformon it: compression can let a party who controls the reflected part learn the secret from the size. The replies most exposed are those ofGETactions and of servers withcross_site = "allow". - A runtime component ref that registers again with the same
idbut different client code is now refused, for every artifact that has a client (#497). The chunk URL is cached for good, so new code under an old id would be served stale. Change theidwhenever the client changes; a content hash works. - The Actions docs now say what the cross-site guard refuses: every cross-site request other than
GET,HEADandOPTIONS(#496). They saidPOST. The behaviour is unchanged.
2.0.0-alpha.48 · 13 November 2026
This version lets code outside React know when a React island has committed its tree, which data-hydrated never meant.
New
- A React island now tells you when its tree has committed (#493).
data-hydrated="1"is set as soon as the island’s hydrate call returns, buthydrateRootandcreateRoot().render()only schedule the render, so React may not have rendered yet. Once the island’s root has committed, its<brust-island>host getsdata-committed="1"and dispatches a bubblingbrust:islandevent withdetail: { id, phase: 'committed' }, whereidis the host’sdata-id. It works for hydrated islands and forclient_onlyones that mount withcreateRoot. The signal fires once per host and never for a host that has left the page.data-committedalways comes afterdata-hydrated;data-hydratedkeeps its meaning and timing. brust renders the root inside a small wrapper that adds no element and does not changeuseIdvalues, so server and client markup stay the same. See Rendering tiers. - Code that may run late checks the attribute first (#493). The event fires once, so a listener added after it would never hear it. Test
host.getAttribute('data-committed') === '1'and only otherwise listen withhost.addEventListener('brust:island', run, { once: true }). - A hand-written island hydrate function can take a third argument,
committed()(#493). Call it when the island’s tree has committed and the runtime sets the attribute and sends the event. A function with two arguments still works; it never signals. Acommitted()called while the hydrate function is still running waits until it has returned, and a hydrate function that throws never signals. The runtime exports the type of the event’sdetailasIslandEventDetail.
Changes
- The signal covers the island’s root, not every
<Suspense>boundary inside it (#493). React may hydrate the content of an inner boundary after the root has committed, and that later hydration sends no event. Do not read the event as “every part of this island is interactive” when the island holds a<Suspense>boundary. - Pages that load an island carry about 0.2 KiB more client JavaScript (#493). The island part of the runtime grew by the signal above; the measured runtime for a React-tier page in the React coverage report went from 4.3 to 4.5 KiB (gzip). Nothing to rebuild beyond upgrading.
2.0.0-alpha.47 · 12 November 2026
This version closes the gaps that kept some apps from replacing a hand-written Content Security Policy with [csp]: more directives, default-src 'none', a per-request host, a per-deploy switch and a policy under brust dev. It also sends form-action whenever [csp] is on, which can block a form that posts to another origin.
New
[csp]has keys for the directives apps most often had to write by hand (#491).form_action,frame_src,media_src,worker_src,manifest_srcandobject_srcare lists, anddefault_srcandbase_uritake"self"(the default) or"none". Theframe_src,media_src,worker_srcandmanifest_srcdirectives are sent only when you set them, with'self'first.object-srcstays'none'unless you list sources inobject_src. A misspelt key or value is still a startup error. See Content Security Policy.default_src = "none"works without breaking brust’s own scripts, fetches and assets (#491). With it, nothing falls back to your origin, so brust names what its runtime loads:script-srcandstyle-src-elemas before, andconnect-src,img-srcandfont-srcwith'self'(navigation and prefetch fetches, actions and your WebSockets; the images a navigation preloads and those brust-built CSS serves; the fonts it serves). Frames, media, workers and manifests stay closed until you list them, and then only what you list is allowed. A served browser test runs an island, an action, a WebSocket and SPA navigation with the progress bar under this policy with no violations.- A source can use
{host}, the host the request was sent to (#491).connect_src = ["wss://{host}"]allows each page’s socket on its own host name when one app answers to several. The value is the request’s authority with its port, and it is used only when it is a plain host name or IP address with an optional port: any otherHostheader drops the source from that response and is never copied into the header.{host}is refused inscript_srcand inobject_src, where a source taken from the request would let any host name that reaches your server serve script or plugins. A policy with a{host}source addsVary: Host. A static page or thepublic/rule on Cloudflare has no request, so the build leaves those sources out and prints a warning (ssg-csp-host,cf-csp-host). BRUST_CSP_MODEswitches the policy per deploy without editingbrust.toml(#491). Read whenbrust startor the Worker starts:offsends no policy;report-onlyorenforcesends it in that mode, from your[csp]table even whenenabledis not true (or the default policy when there is no table). Any other value stops startup. On Cloudflare it is a Worker variable, and the build now ships the[csp]table in the Worker’s config even when it is off so the variable can turn it on. It reaches only pages a server or Worker renders:--target staticpages and HTML files inpublic/keep the policy written at build, and the Cloudflare build printscf-csp-publicwhenpublic/holds HTML.[csp] dev = truesends the policy underbrust devtoo (#491). It goes out indev_mode(report-onlyby default) withstyle-src-elem 'unsafe-inline'added for the error overlay’s styles; the dev client, the devtools and their WebSocket are same-origin and already covered by'self'.brust startnever gets that addition. Withoutdev = true,brust devstill sends no policy.
Changes
- With
[csp]on, brust now always sendsform-action 'self', so a form that posts to another origin is blocked (#491).form-actiondoes not fall back todefault-src, so an app with[csp]had no form restriction before. Forms that post to your own app, actions included, are unaffected. Add the other origin toform_action, for exampleform_action = ["https://pay.example.com"], before upgrading; withmode = "report-only"the browser only reports it. The directive is part of the policy in every place brust sends it, static pages included. - A response that already has a
Content-Security-Policy-Report-Onlyheader now keeps brust from adding its own (#491). Before, only a response with the same kind of header was left alone, so a loader’s report-only policy could end up beside brust’s enforced one. Now a loader that sets either header owns the response’s policy and brust adds neither.
2.0.0-alpha.46 · 12 November 2026
This version makes [csp] work for static builds and stops two servers that share an L2 cache from serving each other’s pages when their runtime configuration differs.
New
- With
[csp]on,brust build --target staticpages now carry the same policy asbrust start(#489). Every page, the default 404 page included, opens its<head>with<meta http-equiv="Content-Security-Policy">(right after a<meta charset>that starts the head, otherwise first), with the same hashes for brust’s own inline scripts. Browsers ignoreframe-ancestors,report-uri,report-toandsandboxin a meta tag, so those go into the one/*rule ofdist/static/_headersas aContent-Security-Policyheader, which Cloudflare Pages and Workers Static Assets send for every path; on another host, send that header from its own configuration. A page without a<head>stops the build, so no page is left without a policy. See Content Security Policy. - With
--target cloudflare, HTML files you put inpublic/get the policy too (#489). The Worker already sent the header for the pages it renders, but the platform servespublic/HTML itself. When there is at least one such file, the build adds the same policy to the/*rule ofdist/cf/assets/_headers; with no.htmlthere, nothing is added.
Fixed
- Two servers that share one L2 cache and run the same build with different runtime settings no longer serve each other’s pages (#487). The shared key held only the build id, but each process writes its own values into a page: the actions prefix and client settings, the base path, and the
generatormeta (and, under[csp], the hashes of those scripts). A config-only deploy, or staging and production on one Redis, could therefore read a body with the other’s tags, and under[csp]a script whose hash was not in the serving process’s header. The key now also carries an 8-character fingerprint of those values. Servers with the same settings still share entries.
Changes
- The first start after upgrading reads none of the old shared-cache entries (#487). The key format changed, so existing L2 entries are no longer read and are left to expire by their own TTL; pages are rendered once and cached again under the new key. Invalidation by tag, path or prefix still reaches the entries of the current fingerprint. Nothing to rebuild beyond upgrading.
- Limits of the static policy (#489). A meta tag cannot name a report URI, so violations of the meta policy are not reported anywhere; a report sent through the
_headersheader covers only the directives in it.mode = "report-only"cannot be a meta tag either: in that mode the pages get no meta and the whole policy goes into the/*rule asContent-Security-Policy-Report-Only. A policy that only one page sets (a loader’s own header) is dropped from_headerswith a build warning, and that page still gets its own meta.brust devstill sends no policy.
2.0.0-alpha.45 · 12 November 2026
This version adds an opt-in, hash-based Content-Security-Policy, makes the facts compileComponent returns for each handler report what the handler writes, and stops brust dev from adding its scripts to HTML your own routes return.
New
- A new
[csp]section makes brust send a strictContent-Security-Policyheader (#486). It is off by default; withenabled = trueevery HTML response ofbrust start(and every page a Cloudflare Worker renders with--target cloudflare) getsscript-src 'self'plus asha256hash for each inline script brust itself writes, such as the base path and actions globals.modeis"enforce"or"report-only", andscript_src,style_src,connect_src,img_src,font_src,frame_ancestorsandreport_uriadd sources. A loader that sets its ownContent-Security-Policykeeps it. Inline scripts you write yourself are blocked inenforcemode; start inreport-onlyon an existing app. See Content Security Policy. script_srcrefuses the sources that would void the hashes, and a misspelt key is an error (#486).'unsafe-inline','unsafe-eval','unsafe-hashes', a host of just*and bare schemes such ashttps:,data:andblob:are refused with an error that names the entry unless you also setscript_src_unsafe = true;'strict-dynamic'is refused always, because it would block every script brust adds. The same applies to an unknown key under[csp].- The facts
compileComponentreturns now say what each handler writes, reads and reaches (#485). Before, a handler such as{(e) => { e.currentTarget.innerHTML = html; setN(n + 1) }}reported only the setter as a callee, so a check that allowed only setter and local callees accepted it. Each entry offacts.handlersnow also haswrites(every assignment,++,deleteand destructuring or loop target, with atargetand the writtenpath),readsParams,globalsandreaches, andfacts.functionslists the same facts for each local function a handler reaches by call, by name or through an alias. A write’stargetislocal,param,param-member,prop-member,closure,closure-member,global,global-memberorother; what the walk cannot trace isother(or anunknowncallee), never left out. The facts are still a report, not a sandbox: allow-list writes with targetlocaland callees of kindsetterorlocal. Writes insideuseEffect, callback refs and module-level code are not listed;hooks,attrsandglobalsname them.
Fixed
brust devno longer injects its client and devtools scripts into HTML that an action or an Elysia route returns (#484). Before, everytext/htmlresponse got them, so a page of your own returned from such a route and shown in a sandboxed<iframe sandbox="allow-scripts">logged a cross-origin script error per frame. Now only a pagebrustitself rendered (including its 404 and error pages) is injected; the HTML your route returns passes through untouched. The pages the dev proxy writes itself, such as the 502 page, keep their scripts.
Changes
- If your code reads
facts.handlers[].callees, somekindvalues changed (#485). A call rooted at a global (window.localStorage.getItem,navigator.sendBeacon,document.body.append) is nowglobal-member, and one rooted at a handler parameter or a name derived from it (e.preventDefault,e.target.remove) isparam-member; both used to bemember, which now means a chain rooted at anything else. A callback that came in from outside the component (a prop, its destructured name, a helper’s argument) isprop, orprop-memberthrough a member of it, where it used to belocal; a parameter that is reassigned, handed to a call or written to is no longer claimed asprop. A class, an object the file built, a loop or catch variable and a name assigned more than once areunknowninstead oflocal. A setter counts only when it comes from React’s ownuseStateoruseReducer(a local function that happens to be calleduseStateno longer does). A handler that is not a function written in the file, such asonClick={props.go}, is now itself listed as a callee. A check that allowedsetterandlocalstill works and is stricter; one that matched onmemberneeds the new kinds. - The navigation progress bar’s styles are now an adopted stylesheet, and an app rule overrides them (#486). They used to be a runtime
<style>element, which a strictstyle-srcblocks. The bar now builds a constructable stylesheet and adds it todocument.adoptedStyleSheets; a browser without that support gets the<style>as before. Every selector is wrapped in:where(), so any rule of yours ondiv[data-brust-bar]wins over the built-in one regardless of order. The bar looks the same unless you already style it. [csp]does not apply underbrust dev,--target staticpages or the static assets of the Cloudflare target (#486). The dev overlay adds<style>elements a strict policy would block, so check your policy withbrust start; static pages and Cloudflare assets are served by the platform, so set the header in your host’s configuration for those. Inline-script nonces for your own scripts are not added yet.
2.0.0-alpha.44 · 12 November 2026
This version fixes slice on a list in a server-rendered expression, which used to slice the list’s printed text.
Fixed
items.slice(a, b)in a server-rendered expression now slices the list (#482). Before, the list was printed and the characters of that text were sliced, soitems.slice(0, 1).map(...)rendered empty items anditems.slice(1).lengthprinted the length of the text instead of the number of items, with no error. Now it behaves likeArray.prototype.slice: a negative index counts from the end, an omitted end means the end of the list, an index past the end is clamped, and a start at or after the end gives an empty list. The result works with.lengthand.map. String.sliceis unchanged. The generated templates are the same, so there is nothing to rebuild beyond upgrading.
2.0.0-alpha.43 · 12 November 2026
This version makes the compiler faster on apps with long component chains and stops concurrent builds of one app from breaking each other.
Fixed
- Running
brust buildandbrust dev(or two builds) of one app at the same time no longer breaks either of them (#480). Before, each run emptied and rewrote.brust/pkg-src, so a second run could see a package source in one place and not in another, and the build failed withcomponent-compile-divergentor anENOENT. Now a package source is rewritten only when its text changed, through a temporary file renamed over it, so a reader sees the old file or the new one and never a partial one. A package directory that no build references any more is removed only after it has gone unused for 10 minutes. The generated output is the same as before. - A package source that cannot be written now fails the build and names the file (#480). Before, a failed write was treated like an unusable package, so the build carried on and that package’s components were rendered with React without a message. Now the build stops with a
BuildErrorthat names the file and the error code.
Changes
- The compile step is faster on apps with many components that import each other (#479). Within one compile each module is now parsed once, and the check for whether an imported module can hold an element is remembered instead of repeated. On a large app we measured the compile phase going from about 10 s to about 1.8 s with byte-identical output; your result depends on how your components import each other, and a small app saw no real change. There is no API or output change and nothing to rebuild.
- Two components of one file that render each other now stop at an explicit guard (#479). Before, the compiler kept cloning that chain until the parser ran out of stack. Now a call site that is already being cloned keeps the shared component. The output is the same as before.
2.0.0-alpha.42 · 12 November 2026
This version makes a client navigation show the same store values as a full load of the same URL, for the keys the destination’s loader wrote.
Changes
- On a client navigation, a live store now takes the keys the destination’s loader set (#476). Before, a store the tab already used kept every client value, so the new page could show new props next to old store values. Now a key the loader set with
.set()in that request is applied to the live store, even when the value is equal to the current one. A key the loader did not set keeps its client value. A store the tab has not used yet seeds from the page as before, and a loader that sets nothing changes nothing. This replaces the earlier rule that a live store keeps its value across a navigation. See Navigation and Store. - The swap runs in a fixed order (#476). First the old page’s effect cleanups run (native
onCleanupand island unmounts), so they read the old values. Then the loader’s values are applied. Then the new page mounts or hydrates, and its effects run with the new values only. This holds for native pages and islands alike, with no hydration mismatch. - A cached, prefetched or back-navigated page applies the values from its own fetch (#476). Like its props, the store values belong to the response the page came from.
- A store signal can no longer be named
~w(#476). The name carries the list of written keys in the page snapshot, sodefineStorerefuses it.
2.0.0-alpha.41 · 12 November 2026
This version adds WebSocket support to actions: write app.ws() in actions.ts and the Rust server runs the connections. See WebSockets.
New
app.ws()inactions.tsserves WebSockets under the actions prefix (#468, #470–#472). The server does the handshake, the frames, the pings and the limits, and your handlers run in a worker. A socket stays on the worker that accepted the upgrade for its whole life.ws.subscribe(topic)andws.publish(topic, data)reach sockets on every worker.- The new
[actions.ws]table sets the limits (#468, #471). The defaults are a 1 MiB message (max_payload_bytes), 120 s without a frame from the client (idle_timeout_s), a ping every 30 s (ping_interval_s), 10000 open sockets (max_connections) and 1 MiB of unsent data per socket (backpressure_bytes).enabled = falseturns the feature off. server.publish(topic, data)works outside socket handlers (#474). It is available in an HTTP action asserverin the Elysia context, and from module scope asapp.serveron the app you export. It sends to every subscriber on every worker.app.serveris set when brust mounts the app, so useapp.server?.publishand publish later. Module scope runs once in each worker, so a subscriber there runs once per worker.brust devrelays WebSockets (#469). A refusal such as a guard’s 401 reaches the browser as that status. When the app restarts, the browser socket closes with 1012 “service restart”.
Security
- A cross-site WebSocket upgrade is refused with 403 (#468). An upgrade is judged like a mutation under
[actions] cross_site = "reject": a foreignOriginis refused, a request withoutOriginis allowed, and the[cors] originslist is honoured.
Changes
- On shutdown the server closes open sockets with 1001 “going away” (#471). Write the client to reconnect after 1001 and 1006, with a delay.
brust build --target cloudflarerefuses an app that calls.ws()(#473). The build warns and the app fails at startup with a message that names the target. Server-sent events are still not supported.
2.0.0-alpha.40 · 11 November 2026
This version keeps a wrapper component static when it passes its props to a list of components that render themselves.
Fixed
- A component that maps its props to a component that renders itself no longer renders with React when the route feeds it fixed props (#466). For example
Body({ nodes })returningnodes.map(n => <NodeView n={n} />), rendered by the route with loader data, was reported asrecursion-unsupportedand shipped client code, while the same list written inside the route was static. It now compiles to a static template, with no island and nox-data, and the HTML equals React’srenderToString. This also holds when the wrapper is given an expression such asnodes={s.nodes ?? []}, which was reported asisland-prop. A call site fed by state, and a child that is truly interactive, still render with React as before.
2.0.0-alpha.39 · 11 November 2026
This version can render a component whose source was stored after brust build: you expose some of your modules, compile a source text with @brust/core/compile, and place the result with <Dynamic>. A component that renders itself is now one server template, and a list wrapper that only looked interactive stays static.
New
[build] exposebuilds app modules once for runtime components (#456). A built component and a runtime component that import an exposed module share one instance in the browser, so both read and write the same store. The manifest gains aruntimeblock (exposedandstores); it is additive.compileComponentin@brust/core/compilecompiles a source string into a runtime artifact (#459). It compiles as the build would, against the realdist/, and refuses what cannot be one template and one client module, with a rule name and a position.compileComponentreturnsfactsfor a check of your own (#460). They list the imports, globals, hooks, tags, props, handlers with their calls, and risky constructs of the whole file, on a refused result too. They feed an allowlist; they do not prove isolation, so pair them with a Content-Security-Policy.<Dynamic component={ref} props={…} />renders a runtime component on the server (#457). The routes entry exportscomponentswith aresolve(ref, { build }). A missing, refused or failing component prints nothing and the page still answers 200.brust build --target static, the Cloudflare target and--ssgrefuse an app that has a slot. New option:[components] cache_entries. See Runtime components.- A component that renders itself compiles to one template macro, with no React island per node (#462). A tree, a menu or a comment thread that calls its own component prints on the server as a single macro, so the page carries no client code for it. It works for a component compiled with
compileComponentand placed with<Dynamic>too. A tree nested deeper than 32 levels fails the whole render (the error names the component and the cap); it does not fall back to React. A component that cannot be one macro (it holds state, a handler, an effect, a ref or a store read, or its call to itself passes JSX children, a function, arefor a spread of props) renders with React and reports the rulerecursion-unsupportedwith the reason. Two components in one module that render each other are now reported as mutual recursion, not as an import cycle.
Changes
- A static wrapper over a child that only the loader makes interactive stays static (#463). A wrapper such as a section
switchthat renders a component fed from its own props, which renders a list of switch components, is now specialised per call site, so the whole chain prints static with no client code. A repro of this shape went from a 30.6 KB template to 5.4 KB. The specialised copy is kept only when it makes something below it static. - brust is now tested with Elysia
2.0.0-rc.4and@elysia/eden2.0.0-rc.1(#464). The peer range is unchanged (^2.0.0-rc.0), and apps fromcreate-apppin the new pair. - The Runtime components page describes the whole flow, and a served test covers it (#461). The test compiles source strings, renders them through
<Dynamic>, and checks that a built component and a runtime one share one store across a client navigation.
2.0.0-alpha.38 · 5 November 2026
This version makes the rows of a list that never changes smaller: the server picks what each row shows, so the page no longer carries every hidden case for every row.
Fixed
- Rows of a list that never changes are decided on the server (#454). This covers a list from a module-level
const(imported ones too, if nothing writes them), a literal, a fixed prop, or the rows of such a list. Aswitchorifchain in a row, or in a child rendered by it, now prints only the matching case for each row. Before, every row printed every case, hidden, so a 38-case iconswitchover 36 rows put 36 × 38 icons in the page. A stateless child that is given only such row values stays static, with no<brust-host>and no client props. Other reads in the same row that follow state or a store still update in the browser. A list that can change (state, a store, a live prop, a modulelet, or aconstwritten anywhere) is unchanged.
Changes
- The data sent to the browser for such a list holds only the fields the browser reads (#454). A field that only the server prints, such as
{it.name}in a row, is no longer sent, while a field a handler reads, such asid, still is. - The
fragment-rootwarning now says why the component is interactive (#454). The text names the cause: it holds state, handles events, runs an effect, takes a ref, reads a store, or is passed props that change in the browser.
2.0.0-alpha.37 · 5 November 2026
This version fixes a build that never finished for a component with a long if / else if chain or switch that follows state, a store or a list row. It also stops a false “no slot” warning when a value is undefined.
Fixed
- A long
if / else ifchain,switchwith areturnper case, early-return chain or nested ternary no longer hangs the build (#452). When the tests followed state, a store or a row of a store-driven list, every case doubled the template, so a 38-caseswitchin such a list never finished building. Each case is now printed once, so the build time and the template grow in line with the number of cases. The page renders the same as before: one case is visible on first paint and a change shows the right case with no duplicate in the DOM. - A value that is
undefinedrenders like React and no longer logsprecompute result has no slot(#451). For example,arr.find(…)that finds nothing on the server now renders nothing, or the falsy branch of{x ? x.name : ‘none’}, with no warning on every request. A genuinely missing slot still logs the warning, and its text no longer blames a staledist/jobs.jsas the only cause.
Changes
- Deeply nested reactive conditionals now stop the build with
reactive-if-depth(#452). A conditional nested inside another one that follows state, a store or a list row still prints both branches, so what sits under it doubles. When one component would print more than 8 MiB of those copies, the build stops at once and names the component and the depth, instead of running out of memory. Turn the nesting into oneif / else ifchain orswitch, or compute the choice into one value first. See Early returns and switch.
2.0.0-alpha.36 · 4 November 2026
This version adds a trailing-slash setting and closes the cache stats endpoint by default. It also fixes a form handler that rendered with React, the Cloudflare dev date, and stopping a server on Windows. If you read /_brust/cache/stats, see Changes before you upgrade.
New
- Pick one trailing-slash policy with
[server] trailing_slash(#447)."redirect"answers a GET or HEAD for/about/with a 308 to/about, keeping the query string and the base path, before route matching and the page cache."ignore"serves both spellings from one cache entry."strict", the default, behaves as before:/cart/is a 404 and a{*rest}route also matches the slashed path. The value is baked in at build time, sobrust startrefuses a different one (trailing-slash-mismatch). See Configuration. - Control who can read
/_brust/cache/statswith[server] stats(#448, #449). The setting takes"off","public"or"token". With"token", a request must sendAuthorization: Bearer <token>, where the token is read fromstats_token = "env:NAME". A wrong or missing token gets a 404, so the endpoint is not revealed. The response always carriescache-control: no-store./pingstays public. On Cloudflare Workers the choice isofforpublic. See Configuration.
Fixed
- A handler written as
const submit = async (e) => {…}builds native (#445). It used to render with React, with the warningclient-function-in-job … names setMsg, although the same handler as anasync functionor written inline inonSubmitwas native. The Form action cookbook page now builds as the page says. brust dev --target cloudflarestarts without pinning a date (#443). The defaultcompatibility_datecould be newer than the workerd your wrangler installs, sowrangler devrefused to start. The default is now capped at the newest date your installed workerd supports. A date you set in[cloudflare] compatibility_dateis used as written, with the warningcf-compat-datewhen workerd is older.- Windows: a server stops reliably with its launcher, and on Ctrl+Break (#442). If Windows gave the launcher’s process id to another program, the server could keep running after the launcher died. It now compares the launcher’s start time as well. Ctrl+Break in the console now drains the server the same way Ctrl+C does.
- Tailwind skips brust’s build output in every layout (#441). Since alpha.35 Tailwind ignores
dist/and.brust/, but it still scanned an out dir outside the app root, an out dir whose name holds glob characters, and, underbrust dev, a productiondist/left by an earlier build. All three are now skipped too. - The
server-only-in-clienterror names every island and writer (#446). When server-only code reached the browser through a loader’s writer, the error named only the first island and writer. It now lists them all, sorted, up to three, followed by “and N more”.
Changes
/_brust/cache/statsis off by default inbrust start(#448). It used to answer any client, and behind an edge that forwards every path, every domain the app serves exposed the cache numbers. It now answers 404 unless you set[server] stats = "public"or"token", orBRUST_STATS. If a monitor reads it, set one of these before you upgrade.brust devkeeps it public.
2.0.0-alpha.35 · 4 November 2026
This version is for apps that serve many hosts, or that share one origin with another app. You can clear one host’s cached pages, mount an app under a path, and pages built from loader data now ship less JavaScript. Two build checks are now stricter; see Changes.
New
- Clear the cached pages of one prefix only (#435). A route cached with
prefix: 'request(host)'keeps one copy of each page per host, butcache.invalidate({ path })and{ tags }cleared that page for every host.cache.invalidate({ prefix: 'a.test', path: '/about' }),{ prefix, tags }and{ prefix }alone now clear only the pages stored under that exact prefix, in memory, in Redis/Dragonfly and in the Cloudflare KV and Durable Object adapters, and on every instance.prefixapplies to pages only, so passing it together withkeythrows aTypeError. See Caching. - Mount an app under a path with
[server] base_path(#434).base_path = "/portal"moves every URL brust owns under/portal:/_brust/*(client files, actions, cache),/public,/ping, the navigation and asset tags, and thebrust devchannel. Two apps can then sit behind one path-routing proxy on one origin, in production and in dev, without merging theirdist/clientfolders. Routes and the URLs you write stay real paths ('/portal/orders'). A request outside the base gets a 404, and a link outside it does a full page load. The value is baked in at build time and exported asbasePathfrom@brust/core. See Configuration.
Fixed
- A list over loader data renders as plain HTML, even when it is not in the page component (#437, #439). A stateless component that the page passes loader data to (
<PageView sections={data.sections} />) used to ship the runtime andx-for. If a row child formatted a prop with a helper (formatPrice(Number(price))), it rendered with React instead. Wherever every prop a stateless child receives is a value the browser never changes, brust now renders that call site as static HTML with no script, through nested components too. The same component keeps its interactive output where a parent passes state. A helper in a row now runs only for the rows whose branch renders it, so a helper that needs a field only some rows have no longer fails the page. - A
switchthat returns in every case no longer forces React (#436).switch (s.type) { case 'hero': return <Hero /> … }on a variable or property path, with literal cases, now compiles like anif/returnchain, so the component stays static or native. Matching is strict:'1'does not match1. Aswitchthat could fall through, usesbreak, or tests a non-literal still renders with React, and the build now names itswitch-fallthrough. - No more
tsconfig-pathswarning whenpathsare in your owntsconfig.json(#433). The warning came up on every build whenever the file usedextends. It now appears only when an extended file setsbaseUrl, which changes how your aliases resolve, and it names that file.
Changes
- Conflicting route patterns now fail
brust buildinstead ofbrust start(#433). A{*rest}route next to a{slug}route at the same level used to build and then stop the server at boot. The build now fails withroute-conflictand names both routes. The Routing page now covers{*rest}, which matches the rest of the path at any depth with status 200, alongside the'*'404 catch-all. See Routing. - Tailwind never scans brust’s own build output (#438). Without a
.gitignorecoveringdist/and.brust/, the second build read the first build’s output and kept utilities your sources no longer use. Those stale utilities are now gone, which can make your stylesheet smaller. Tailwind scans the app root only: a[build] source_rootsfolder is scanned once your stylesheet names it with@source. See CSS. - Shared cache stores: pages stored before this version are not cleared by
prefix(#435). With Redis, Dragonfly or the Cloudflare adapters, pages written by an earlier version were stored without a prefix, soinvalidate({ prefix })cannot find them. They expire with their TTL, or you can clear them once withinvalidate({ path })or{ tags }.
2.0.0-alpha.34 · 3 November 2026
brust now runs on Windows x64. Nothing changes on macOS or Linux, apart from one new CSS build error that catches a leaked local path. See Installation.
New
- Windows x64 is supported (#425, #426, #427).
@brust/corenow lists@brust/native-win32-x64-msvc, sobun create @brust/app,brust dev,brust buildandbrust startwork on 64-bit Windows with no Rust toolchain. Paths with backslashes, drive letters and non-ASCII folder names are handled throughout the build, so the server-only check applies on Windows exactly as on macOS and Linux. Every pull request now runs a Windows CI job: it scaffolds an app into a non-ASCII folder, builds it, serves it and checks that a client import of server-only code fails the build. Windows on ARM is not supported yet. - On Windows, a server whose launcher is killed now shuts down by itself (#428). Windows has no process groups, so killing
bun run startfrom an IDE or a process manager used to leave the server running, still holding its port and the app folder. The server now checks its launcher every second, and when the launcher is gone it drains and exits, the same way it does on Ctrl+C. SIGTERM drain is still POSIX-only.
Fixes
- Windows: CSS fonts and images are emitted as hashed files (#430). A
url()in CSS used to keep the absolute local path (C:\Users\…) in the built stylesheet, and fonts and small images were not copied todist/client. They are now copied as<name>-<hash>.<ext>, as on macOS and Linux. - Windows: a dependency’s source package resolves to the right file (#430). A package that brust builds from its source resolved to the wrong file on Windows. It now resolves to the same file the bundler uses.
- Windows: building from a symlinked folder works (#431). A build started inside a symlinked folder (or a link to another drive) failed with “Cannot find module”. The server-only and load-writer build errors now spell paths with
/on every platform, andbun create @brust/appprintscd ./my-appon Windows instead of a full path.
Changes
- New build error
css-asset-path(#430). If a CSSurl()would still name a file on the build machine after the build (aC:\…or\\host\…path, or a path inside the app ordist/), the build now fails instead of shipping that path. Write the URL relative to the stylesheet, or as/public/…. See CSS. - Windows: if your launcher exits after starting the server, start brust directly (#428). A server now exits when the process that started it goes away. If a process manager on Windows launches brust through a script that exits right after spawning it, point the manager at
brust startitself.
2.0.0-alpha.33 · 29 October 2026
Fixes for a build that failed on a server-only module and for streamed uploads on Cloudflare, and one small change to brust dev. Nothing breaks.
Fixes
- Passing an imported function to other code no longer marks its module as written (#421). A call such as
use(addrsOf)in a server module used to make the build treat that module as written, so a server-only module was pulled into the client islands that import it and the build failed with “server-only code in a browser bundle”. That no longer happens, and re-exports through barrels are followed. Writing to a function as an object (fn.x = ...,Object.assign(fn, ...)) still counts, and so doletandclassexports. When server-only code does reach a browser bundle this way, the error now names the chain: the island, the writer, and the module judged written. - Cloudflare: a streamed action answers 400 when the upload fails midway (#423). If the platform's request body stream fails mid-upload (the client went away, or the body was short), the action now answers 400, as on the native server, even when the app caught the read error. A chunk with no byte length now fails closed instead of slipping past
max_stream_bytes.
Changes
brust devreads the actions prefix once per build instead of once per request (#423).- Docs: echoing
request.bodyon Cloudflare (#423). An action that echoesrequest.bodypast the ceiling sees its response fail mid-flight. Read the body first if you need the 413. See Actions.
2.0.0-alpha.32 · 28 October 2026
Hovering links no longer sends a request on every hover. Nothing breaks. See Navigation.
Changes
- A URL that was fetched a moment ago is not prefetched again (#419). A URL fetched less than 10 seconds ago, by a prefetch or by a navigation, is skipped by the next prefetch.
<html data-brust-prefetch-gap="<seconds>">sets the gap and0turns it off. It matters for pages the cache does not keep: a response withCache-Control: no-store, an error, or any page after a mutation cleared the cache, which used to be fetched again on every hover and then again on the click. Clicks,navigate()and back or forward are unchanged and always fetch what they need, and ano-storepage is still never shown from memory. A link to the page you are on is no longer prefetched.
2.0.0-alpha.31 · 28 October 2026
An action can now take a streamed upload, so a large file no longer sits in memory. Two fixes come with it: an action sees the client's Content-Length, and an early answer reaches a client that is still sending. Nothing breaks. See Actions.
Changes
- Streamed uploads for actions (#414, #415). List the route in
[actions] stream = ["POST /upload", ...], with paths relative to the prefix, and give the route{ parse: 'none' }. Itsrequest.bodyis then a real stream, and memory does not grow with the size of the upload. The limits are keys under[actions]:max_stream_bytes(default 256 MiB, at most 4 GiB),stream_idle_ms(30 s),stream_total_ms(15 min) andmax_streams(default max(1, slots/4)). Answers: 413 past the ceiling, whether declared or reached mid-stream; 408 on a timeout; 400 on a short or broken body; 503 withRetry-After: 1whenmax_streamsis full. Boot fails for a listed entry with no matchingparse: 'none'route, and aparse: 'none'route that is not listed warns and is buffered, capped atmax_body_bytes. It works on the native server, on Cloudflare Workers (counted againstmax_stream_bytes; the platform's body limit for your plan still applies) and underbrust dev, where the proxy now admits bodies up to 4 GiB and does not cut a paused upload.
Fixes
- An action sees the client's
Content-Lengthrequest header (#413). It was dropped, sorequest.headers.get('content-length')wasnull. It now arrives inbrust start,brust devand on Cloudflare. - An answer sent before the upload was fully read reaches the client. A 413, a 503 or an early 401 used to reset a client that was still writing; the client now gets the answer (#414).
2.0.0-alpha.30 · 27 October 2026
A maintenance release: the compiler moves to the Bun 1.4.4 release. Nothing changes for apps, and nothing breaks.
Changes
- The compiler builds on Bun's crates from the
bun-v1.4.4release (#411). The parser and the React Compiler come from that release, in place of a Bun main snapshot from 8 October. CI and the release build run on Bun 1.4.4, and the templates fromcreate-apppin@types/bun^1.4.4. Bun 1.4.4 is the version to use for apps.
Fixes
- The diagnostic for a dynamic
import()that the compiler cannot lazy-load now points at theimportkeyword. Its column moved, taken from upstream; the compiled output is the same.
2.0.0-alpha.29 · 27 October 2026
The actions client can now renew a token and send a call again, a route can sit under the actions prefix, every page names the brust version that served it, and the navigation progress line is thinner by default. One behaviour change: a loader that sends Vary: Accept is no longer cached.
Changes
- Action client middleware:
client<App>({ middleware: [...] })(#409). A middleware is(req, next) => Response(ActionMiddleware), placed between Eden and the transport.middleware[0]is the outermost:[a, b]runsa, thenb, then the transport, and the response comes back throughb, thena.nextmay be called any number of times and each call sends its own copy of the request, so a retry sends the same JSON or multipart body again. A link can answer without callingnext, and then nothing is sent. A link that throws is a network failure: the call resolves withstatus: 503(or throws, withthrowHttpError). The same code runs in a page and in a loader. The docs carry a token-renewal recipe that renews once for all calls that fail together and then sends the failing call again, and a recipe that adds a custom header to every call. The new “Typed routes” example shows Elysiatschemas for the body and each response, and cookies set on a typedstatus()answer: everySet-Cookiereaches the client anderror.valuekeeps its type. See Actions. - A page or loader route may sit under the actions prefix (#407). A
GETorHEADthat a route whose own pattern is under the prefix matches is served by the route. Every other method, and aGETthat no such route matches, still go to the actions app; the*catch-all never counts, and neither does a route outside the prefix. Build and boot now refuse only the prefix itself and a{*rest}route under it. AGETaction that a route shadows is named in a warning at boot. Example: an OAuthGETcallback at/auth/{provider}/callbackis a loader that sets the session cookie and redirects, while Apple'sform_postto the same path stays an action. - Every full document carries
<meta name="generator" content="brust/<version>">(#404). A tag the app writes itself wins. A fragment, such as a navigation payload, gets none. The default static 404 page has it too. - The progress line is a 2px line that moves toward 80% (#403). It runs to the end and fades at
successorerror. Its height is--brust-progress-height, and your own CSS for the bar now wins over the built-in rule.data-brust-progress="off"on<html>still turns it off.
Breaking
- A response whose
Varynames a field other thanAccept-Encodingis no longer cached (#406). The cache key holds no request header, so a page that varies onCookieorAccept-Languagewould have been served to everyone. A loader that sendsVary: Acceptloses caching; drop the header if the page does not vary, or accept that it is rendered per request.
Fixes
- The content type of
httpError()reaches the wire. A string body istext/plain; charset=utf-8and an object body isapplication/json; charset=utf-8by default, and{ contentType }names another. A server-owned name in theheadersofhttpError()is dropped with a warning inbrust devas well, instead of failing the request with a 500 that hid the error the loader meant to send (#406). - An old page's island no longer reads the next page's store seeds during a navigation. The seed tags of the next page wait until the old ones are done (#405).
- The transition's image preload scans only the level that is swapped. The eager images of a layout that stays are on screen already and no longer take part in the 100 ms decode wait (#405).
2.0.0-alpha.28 · 26 October 2026
A loader can now set response headers: cookies, caching, and security policies, on the page and on a redirect. One behaviour change comes with it: headers given to httpError() now reach the response.
Changes
- Every loader gets
res.headers, a standardHeadersfor the response (#401). There is one object per request, shared by the whole layout chain. Loaders run root to leaf, so a layout can set a header for every page under it and a page can add to it:setreplaces a value (the deepestsetwins) andappendadds one, so twoSet-Cookiestay two. The headers go on whatever the chain answers: the page,notFound(),redirect()andhttpError(). A thrown plainErroris still a bare 500 without them. Typical uses: twoSet-Cookiewithreturn redirect('/login', 303)on logout;Cache-Control: no-storein a layout loader for every signed-in page;Referrer-Policy; and a realContent-Security-Policyheader, soframe-ancestorsworks, which a<meta>tag cannot do. See Response headers. - Some header names belong to the server.
Content-Type,Content-Length,Transfer-Encoding,ConnectionandLocationcannot be set from a loader. Inbrust devsetting one throws and names it; in production it is dropped with a warning that names it; the Cloudflare target always drops it and warns. A static build (--target static) writes files, which carry no headers, so loader headers are dropped and the build warns withssg-headers. - A header can keep a page out of the caches. A response with
Set-Cookie, aCache-Controlofno-storeorprivate, orVary: *is never stored by the server cache. The browser’s navigation cache skips onlyno-store, soCache-Control: no-storefrom a layout loader keeps every page under it out of both. See Navigation.
Fixes
- Headers passed to
httpError()reach the response. The options’headerswere dropped before; now they are sent, together with the headers the loaders set.
Tests
- A cross-site form post to an action is pinned to the documented 403 (
CrossSiteRejected), so the rule cannot change unnoticed (#400). Nothing changes for apps.
2.0.0-alpha.27 · 26 October 2026
Navigation gets faster and smoother. Pages you hovered or visited are shown from memory, a thin progress line shows while a slow page loads, and the swap between pages is a cross-fade in browsers that support it. A new built-in store, navigation, gives a component the navigation state without addEventListener. Cache, progress line and transition are on by default. See Navigation.
Breaking
- The page cache, the progress line and the page transition are on by default. Opt out with
data-brust-cache="0",data-brust-progress="off"anddata-brust-transition="off"on<html>. The cache means a page can be shown as it was up to five minutes ago, and a back or forward step shows the cached page at any age. A page that must never be shown from memory, such as an authenticated or sensitive one, has to sendCache-Control: no-store; that is the only thing that keeps a page out (private,no-cache,max-age=0andmust-revalidatedo not). If your own indicator is made of CSS onhtml[data-brust-loading], delay it by about 150 ms: with a transition on, the old page is painted once more while the attribute is set, even for a cached page. Without a delay the indicator flashes.
Changes
- A page you hovered or visited is shown from memory, with no second request. In alpha.26 a prefetched page was held for 15 seconds and used once, so a click after that, a second click, or a back step fetched it again, and hovering again always fetched again. Now every page that is fetched, prefetched or navigated to, goes into a cache in the tab. An entry is fresh for 5 minutes: a hover, a click,
navigate()or a link from anywhere uses it with zero requests, and after that the page is fetched again. Back and forward use an entry of any age. The cache holds 32 pages, least recently used out first, keyed by the URL without its#hash. It never holds a response withCache-Control: no-store, a status of 400 or more, or a response that is not a brust page of this build. A click during a prefetch waits for that same request.<html data-brust-cache="60">sets the freshness in seconds, and0turns the cache off. A navigation served from the cache fires the same events,click,load,success, with the sameidrules. - A mutation clears the cache. A call through the actions client (
@brust/core/client) with any method other thanGETorHEADclears the whole cache once it gets a response, so a page read after a change is never one from before it. If you change data another way (your ownfetch, a form post, a logout), callclearNavigationCache(), exported from@brust/core; it does nothing on the server or on a page without thenavscript. - A progress line along the top of the page while the next one loads. It appears only if a navigation is still loading 150 ms after
load, so a cached or fast page never shows it. It moves on toward about 90%, runs to the end atsuccessorerror, and fades out. It is a<div data-brust-bar>on<html>, outside<body>, so no swap removes it. Set its colour with--brust-progress-color(default#2f7cf6). Withprefers-reduced-motion: reduceit shows without the movement and the fade.<html data-brust-progress="off">turns it off, for an indicator of your own. - A cross-fade between pages, where the browser has view transitions. When
document.startViewTransitionexists, the swap runs inside a view transition whose default look is the browser’s cross-fade of the page (opacity only, about 250 ms); a header or sidebar that stays does not visibly change, and nothing slides or scales. Everything slow (the fetch, the new page’s scripts and styles) happens before the transition starts, so the old page is frozen for about one frame. The first eight eager images of the new page (notloading="lazy") get up to 100 ms to decode first, so a hero image does not pop in after the fade; mark below-the-fold images lazy.successfires when the new page is in the DOM, not when the animation ends, and a navigation that starts during a transition skips it. With reduced motion, without the API, or with<html data-brust-transition="off">the page swaps at once. Restyle it with::view-transition-old(root)and::view-transition-new(root). - A
navigationstore:useStore(navigation)gives the navigation state with noaddEventListener(#397). Importnavigationfrom@brust/core/navigationand read it like any store, in a native component or a React island. Its keys:state('idle'or'loading', loading frombrust:nav:loadtosuccessorerror),url(path and query on screen),to(what is loading, elsenull),trigger,status,error(the message of the last failure; a swapped 404 readsHTTP 404) andid. The server paintsstate: 'idle'andurlas the request’s path and query, so the first paint matches and hydration finds what it expects. The namenavigationis reserved: your owndefineStore('navigation', …)that a component reads is a build error (store-name-reserved). A layout that readsurlrenders different markup on every page, so it is replaced on every navigation instead of kept; readtoandstatein a layout. Do not write to it; the next event overwrites a write.
2.0.0-alpha.26 · 25 October 2026
Links no longer reload the page. A click on a same-origin link fetches the target’s HTML and swaps it in place, and the result is what a full load of that URL would show. Layouts whose markup did not change stay live, with their state, islands and scroll position, and a navigation that crosses layouts never reloads. There are four events to listen to, a data-brust-loading attribute for a preloader in pure CSS, and navigate(url, { replace }) for code. The pages are described in Navigation.
Breaking
- Navigation without a reload is on by default. To keep a normal page load, put
data-brust-reloadon a link, on a region, or on<html>. Every plain click on a same-origin<a href>now stays in the document. A click with Ctrl, Meta, Shift or Alt, a link withtargetother than_selfor withdownload, a click that something alreadypreventDefault()-ed, and a link that only changes the#hashare left to the browser, and forms still submit as before. If anything in your app assumed that a link click re-runs every script on the page, check it: a classic script in a layout that stays live does not run again. A script that must run once per tab can say so withdata-brust-once. There is no config key;data-brust-reloadon<html>turns the whole feature off. - Every full document now carries the
navscript tag, and every layout level is wrapped in<!--brust-l:id:hash-->comments. The tag (<script type="module" data-brust-nav>) is on all documents, also pages that are fully static and load no runtime, and in--target staticoutput; fragments get none. The comments mark where each inner layout’s output starts and ends, and carry a hash of that layout’s own markup, which is how a layout is kept only when its markup is the same. The root layout’s id and hash are on the tag. If you minify HTML (an adapter, a CDN setting), keep comments: when they are stripped, navigation still works, but it replaces the whole body instead of keeping layouts. The dev-only<!--brust:id-->markers are gone; the devtools highlighter uses the new ones. Golden files that print a page’s HTML change by these comments and the tag.
Changes
- A link click fetches the real HTML and swaps only the layout levels that changed. There is no new endpoint, so the server, the static target, Cloudflare and the adapters all work as they are. The new page’s stylesheets and every module it needs (runtime features, behavior chunks, React island chunks) are loaded before anything is swapped, so a page never paints unstyled or before its code. The head ends up exactly as the new page’s head, in the same order; an element that is identical in both is reused, not downloaded again, and an element a live component added at runtime (a CSS-in-JS style, a React hoisted link) is kept. Between two pages under the same layouts only the page is replaced; across sibling layouts the common ancestors stay and the rest is replaced; across root layouts the body and the attributes of
<html>and<body>are replaced. Whenever a level cannot be swapped safely (an outlet in a<p>whose child is a block, or in a table, a React page level that is not marked, a response with no marks) the swap happens one level higher, in the end the whole body, and a response that is not a page of this build is loaded the normal way. It is never a wrong page. Back and forward restore the scroll position, a#hashscrolls to its target, and a link to the page already on screen re-fetches it without a new history entry. After a deploy the first navigation does a full load, so a tab never mixes two builds. The client is a standalone module of 3,522 bytes gzip (budget 3,730; the design estimate of 2.5 KB was too low once every behaviour above was in), built as its own content-hashed asset. - Four events for a preloader, and
data-brust-loadingon<html>. They are plainCustomEvents ondocumentthat bubble, so a native component, a React island or a plain script listens the same way.brust:nav:click: a qualifying link was clicked; it is cancelable, andpreventDefault()leaves the click to the browser.brust:nav:load: a navigation started (a link,navigate(), or back and forward).brust:nav:success: the new page is in place and mounting.brust:nav:error: the navigation did not succeed. Each carriesid(a per-tab counter that pairs the end with its start),urlandfrom; the order is alwaysclick,load, then exactly one ofsuccessorerror, and a navigation that a newer one aborts fires nothing more. Anerrorfor a 404 or another error page that brust rendered hasswapped: true: the page is shown, as a full load would show it. Anerrorwhere nothing could be swapped (network failure, a response of another build, a failed import) hasswapped: falseand loads the URL the normal way, unless you callpreventDefault()to show your own message. While a navigation loads,html[data-brust-loading]matches, which is enough for a progress bar in CSS alone. - Prefetch on intent,
data-brust-persist, and head scripts. A link is fetched after 65 ms of hover, on focus, or at once on touch, and the click uses that response (held for 15 seconds, used once); it is skipped when the browser asks to save data and fordata-brust-prefetch="false"anddata-brust-reload. An element withdata-brust-persist="key"that both pages have is moved into the new page and never disposed (a playing video, an open chat widget). A classic script that is new in the head runs; after a swap of the whole body every classic head script runs again, in order, as on a full load, so a theme script that sets<html class>stays right, except those markeddata-brust-once. - What survives a navigation: live stores, and a React island is unmounted when its page leaves. A store that is already in use keeps its client value; the new page’s snapshot only seeds a store the tab has not used yet, as client state does across a route change in a React app (this is the one place where a navigation differs from a full load). When an island’s host leaves the document its React root is unmounted, so effects clean up once, as on a React route change, and the next page’s islands hydrate when idle. The island chunk’s hydrate function now returns the root’s
unmount, so island chunks built before alpha.26 should be rebuilt (a build always writes new ones). The dev first-paint warning no longer fires for a component that mounts after the page loaded (F301), and a page that first loads the runtime core while its body is later replaced by another page mounts the new page’s components as late ones. The runtime grows by 182 bytes raw; the core is 3,557 bytes gzip of its 3,560 budget. navigate(url, { replace })is exported from@brust/core. It runs the same flow as a click withtrigger: 'navigate'and resolves aftersuccessorerror. It is a browser function: on the server it throwsnavigate is browser-only, and on a page with nonavscript it falls back tolocation.assign. The types of the eventdetailobjects are exported too. Navigation has the events table, the opt-outs, and a preloader example in JavaScript and in CSS.
2.0.0-alpha.25 · 24 October 2026
A patch that stops silent wrong output. A React island page that reads a context a layout provides now fails the build with a message and a workaround, where it used to show the context’s default. The JavaScript operators -, *, the comparisons and == / === follow JavaScript on the server and no longer answer 500, a controlled <select> behind a spread paints its value, and more Radix components compile to native code.
Breaking
- A React island page that reads a context a layout provides now fails the build (
island-layout-context). In alpha.24 and earlier, a page that imported a context from another module (useContext(Ctx), oruseTheme()from a theme module) could not be compiled to native code, so it was sent as a React island, and an island is rendered on its own: it never sees the Provider that a layout puts around<Outlet />. It painted thecreateContextdefault, on the server and after the page loaded, where React shows the layout’s value. The build now refuses it, naming the module, the context and the layout. The rule is deliberately wide: it applies to the page and to every component in its compiled tree that is an island, and it refuses when the component imports anything (the context, a hook, a helper) from a module that declares a context a layout above the route provides, directly or through re-exporting modules; css, json and image imports are not scripts and are not checked. To fix it, pass the value to the page through its loader (as a prop), or render the Provider inside the page’s own tree. Reading such a context natively is planned (F439 for literal values, F440 for values that are state).
Changes
- Subtraction, multiplication, comparisons and equality in a template expression follow JavaScript and no longer answer 500. The template engine’s
-and*fail on a string ornull('5' - 1,-s), its<and>fail when a string meets a number, and its==follows Python, so1 == '1'andnull == undefinedwere wrong andtrue === 1was true. An operator whose two sides are not both known to be numbers (or both strings) now does what JavaScript does: text andnullbecome numbers asNumber()does,undefinedisNaN, strings compare by UTF-16 code unit,==coerces and===is strict.NaNandInfinityprint as JavaScript prints them and-0prints as0. Two numbers, two strings, and===against a string literal keep the plain operator. A loop index (iinitems.map((x, i) => …)) and.lengthcount as numbers, soi + 1is a plain addition again (alpha.24 made it a function call). Two arrays or two objects are never equal here, because a template cannot see whether they are the same object. A list item that is destructured and has the name of an outer loop’s index is not yet told apart from that index (F452). - A controlled
<select>or<textarea>behind a spread paints its value, and amultipleselect keeps its picks when the page loads.<select {...props} value={v}>and the same for a textarea, the shape of the shadcn wrappers, still wrote avalueattribute with no selected option (alpha.24 fixed the shape without a spread). The server now takes the value from the spread when no prop after the last spread gives one, and a textarea whose value isnullorundefinedshows its children, as React does. In the browser,x-modelandx-bind-valueon aselect multipleused to bind one string and cleared the server’s picks on load; they now read and write each option’sselected. The model runtime grows from 648 to 720 bytes (655 measured). Not covered yet: a live value bound through a spread by a parent (F445). - An object
createContextdefault stays native, and a page’s own inline Provider no longer paints the default. In alpha.24 a page that readuseContext(Ctx).aorconst { a, b } = useContext(Ctx)with no Provider, whenCtxwascreateContext({ a: 'x', b: 2 }), fell back to a React island. The literal fields now become the defaults of the fields the page reads, for the page and for the components it inlines. A spread, a getter, a computed key, a value that is not a literal, or a read of a field the default does not have still falls back, by name. Separately, a page that rendered<Ctx.Provider>in its own JSX and read the context in a component inside it painted the default where React paints the Provider’s value. That is now refused by name (context-no-provider), and the page is rendered by React; framing it natively is F446. - A
Primitive.<tag>from another package scope inside a copied component now resolves. The RadixPresenceof the tabs content is copied into the component that uses it, and the<Primitive.div>it renders comes from@radix-ui/react-primitive, which the copied module cannot import from its own place in a package manager that isolates packages. brust looked for it from the copy and refused the component. It now resolves the factory from the module that wrote the JSX, so the node becomes its element andasChildworks as before. A namespace import or a member chain longer than one name is still refused, and so is a component brust cannot resolve at all; the message now names the module that wrote it. In the shadcn coverage the checkbox goes from two React components to one. asChildunder a native parent, and handlers passed through a native child’s spread. A native component that takesasChildand renders one element is now copied around that element, so the parent no longer has to be static; the same holds when the child is a native component, and its attributes become props, its event handlers are combined, and its ref carries over. And anon…prop that reaches a native child’s rest spread is now bound on the child’s element and read from the child’s live props when the event fires, so a parent that swaps the handler is honoured, andonChangeon a text input listens toinputas in React. It refuses (and the component stays React) when the child reads or combines the same key, when a later spread may replace it, or when the order of the element’s own handler for that event cannot be proven. The shadcn toggle group does not turn native yet; the next obstacles are F448 to F450.- A hook called inside JSX attributes and a method on an array literal compile natively, and Radix
useIdids equal React’s. A built-in method on an array literal of plain values, such as['mounted', 'unmountSuspended'].includes(state)in Radix’sPresence, is now a plain read; it used to make the component a React island.<input id={useThing()} />and a hook whose result is written straight into the JSX are lifted to the top of the component, only when the call is unconditional (not in a condition, a loop or a callback). Radix’s ownuseId(@radix-ui/react-id) is recognised by its printed source, token for token, and by nothing else, and on React 19 it is lowered to the same server-seeded iduseId()gives:radix-plus the id, or the id you pass in. Any other shape stays an ordinary custom hook, and with another React version the old path is used, so a change in Radix’s hook falls back to a React island and does not paint a wrong id. The ids of a form field, its label and its description match the HTML React renders for the same page. - A native Provider copied for its content can contain another Provider, and a rest forwarder can sit around a native Provider. Alpha.18 kept these two shapes in React so that they would not paint a wrong value; they are native now, and still paint what React paints. When a component such as a tabs root is copied around its children, a child that reads a context now reads the Provider nearest to it: the one inside the copied template when the child sits under it, the child’s own Provider when it has one, and the outer one otherwise. A child that sits beside the inner Provider (next to
{children}) and reads its context is refused by name and the component stays React, because it would have read the wrong Provider. A wrapper that spreads its own{...rest}exactly once into a native Provider is copied for each place that calls it, with its children, or with none; a wrapper with any other spread stays React. A forwarder that is itself a Provider (the shape ofRovingFocusGroup) is not covered yet: it needs F446 first, then F447. - For people who work on brust: the JavaScript operator filters are checked against JavaScript itself.
crates/brust-jinja/tests/gen-js-operators.tscomputes the expected result of each operator over 26 operands (undefined, null, booleans, numbers, strings, arrays, objects) with JavaScript and writes a 5,460-row table that a Rust test runs through the filters; the battery has three new rows for the operator families, andtests/server/js-operators.test.tsprints 37 expressions throughbrust startand compares them withString()of the JavaScript value.
2.0.0-alpha.24 · 24 October 2026
A patch of wrong output and crashes, most of them found by comparing the HTML that brust serves with React’s own render of every battery row. A local named loop no longer stops the server from starting, a sibling module’s JSX constant no longer answers 500, string + number follows JavaScript, and a controlled <select> or <textarea>, a lazily initialised state and a page’s own context default now paint their value on the first load.
Changes
- A state or list variable named
loop,self,none,Trueand similar no longer stopsbrust startfor the whole app. AuseState, list item or list index with such a name was written into the template as{% set loop %}or{% for loop in … %}, which the template engine refuses, so the server did not start at all. Such a name now gets another name in the template. The names covered are the engine’s reserved words (loop,self,none,None,True,Falseand others) and every function brust’s templates call. A variable namednotalso read wrongly and is fixed. Props are not affected: a prop with such a name was already refused with a message. - A sibling module’s JSX constant no longer answers 500 under
brust start. A page that importedexport const el = <b />from another module failed withjsxDEV is not a functionwhen you ranbrust startfrom a shell that has noNODE_ENV: Bun then compiles the JSX for development, and React’s production runtime has nojsxDEV. Only JSX that runs when the module is imported was affected. In production mode the workers now mapjsxDEVonto the app’s own production JSX functions, so there is still one copy of React.brust devkeeps React’s development runtime, and a static build or a Cloudflare bundle was never affected. string + numberin a template expression follows JavaScript and no longer answers 500.tone={t + n}in a list, withta string andnan index, failed with “tried to use + on string and number”, because the template engine’s+does not join a string and a number. A+whose two sides are not both known to be numbers now does what JavaScript does: it joins as text when either side is a string (undefined + 'x'is'undefinedx'), and adds otherwise. Two numbers still add as before.- A controlled
<select>and<textarea>show their value on the first load.<select value="b">was written with avalueattribute and no selected option, so the first option showed until the page loaded;<textarea value="hi">was written with avalueattribute, which browsers ignore, so it was empty until the page loaded. They now match React: the option whose value equals the select’s value (or its text, when it has novalue) isselected, and the textarea’s value is its text. It works for a string, a number, an array on amultipleselect, anddefaultValue, and for options written directly, in a.map, in an<optgroup>or in an inlined child component. An<option>that has novalueand an element as a child is refused by name (select-option). Not covered yet: a select whose props arrive through a spread (the shadcn wrapper shape; F432), and amultipleselect, whose picks the browser still clears when the page loads (F434). useState(load)with a module-level function paints its value.const [n] = useState(load), whereloadis a function declared in the module or aconstarrow or function expression, painted nothing on the server, because the server seeded the function itself and not its result. The server and the client now both call it. Anasyncinitialiser keeps its existing fallback to React.- A page’s own
useContextwith no Provider paints the context’s default. A page that read a context itself, with nothing providing it, painted nothing; the default given tocreateContextnow shows. When that default is not a plain literal (an object, an array or an expression) and nothing provides the context, the component now falls back to a React island by name (context-no-provider) and does not paint an empty value. Still open: a page that is a React island under a layout’s Provider paints the default and not the provided value (F437). - A state whose initial value reads
childrennow falls back to a React island by name.const [c] = useState(children)compiled as a native component and printed nothing where React prints the child. It is now refused asstate-from-childrenwith the component’s file and line, and the component renders as an island, which paints correctly. This coversprops.children, a destructured or renamedchildren, an expression over it, a lazy initialiser, an alias, the whole props object, rest props,useReducerand an inlined custom hook. A component that does not readchildreninto state is unchanged. - A conditional branch in the browser disposes its effects and refs when it closes. The effects and cleanups of an
x-ifbranch (and of a replacedx-forrow) were kept on the component, so a branch that you removed kept running: after 20 toggles, one change ran 21 text updates on detached nodes. A ref inside a removed branch also kept the detached element, where React sets it tonull. Each branch now owns its effects and refs, and drops them before it leaves the page. The core runtime budget grows by the size of this one hook. - Radix
Presencewith an element child now compiles to native code. The checkbox and radio indicators are the case:Presencerenders its element child while it is present, and nothing when it is not. brust now turns that into a conditional branch, and a callback ref inside a branch is attached once the branch is on the page and detached before it leaves, in React 19’s order. A callback that changes between renders, a ref inside a list row and a component’schildrenstill render with React. - For people who work on brust: CI now compares the HTML of every battery row with React.
bun scripts/battery/ssr-compare.ts --checkbuilds one app with a route for each row, starts it, and compares each row’s served HTML with React’srenderToStringof the same source and props, after a normaliser whose rules are listed in its header. It fails on a difference, and on an allowlisted difference that is no longer there. It found the wrong outputs above (F418 to F425). CI also runs eight served test files that were on main but in no CI step, and a test (scripts/ci-wiring.test.ts) now fails when a file undertests/serveris named neither inci.ymlnor in theserver-testscript.
2.0.0-alpha.23 · 24 October 2026
A patch from the Assets Art team’s second round of issues. It adds one feature: importing a font or an image file gives its served URL, so a stylesheet font can be preloaded. It fixes a list inside a list row in a native component, a lucide icon under a condition, a line break written before every native component, and a gap that a React island added in a flex or grid row.
Changes
- Importing a font or an image gives its served URL, so you can preload a stylesheet font.
import nunito from './fonts/nunito.woff2'is the string/_brust/client/nunito-<hash>.woff2, the same file and name that aurl()of it in a stylesheet is rewritten to, so the file is shipped once. It works for every type brust serves fromclient/:.woff2 .woff .ttf .otf .eot .png .jpg .jpeg .gif .webp .avif .svg .ico. Put it in a layout as<link rel="preload" as="font" type="font/woff2" crossOrigin="" href={nunito} />and it lands in<head>. The string is a build-time constant, so it works in a native component, in a React island, on the server, on Cloudflare Workers and in--target static;@brust/corenow carries the TypeScript declarations for these imports. brust does not preload the stylesheet’s fonts by itself, because a package such as@fontsource-variable/nunitohas one file for eachunicode-rangesubset and the browser should fetch only the subsets a page uses. See Preload a stylesheet font. - A list inside a list row in a native component works in the browser. In alpha.22 and earlier, the inner rows of
items.map(item => <li>{item.tags.map(…)}</li>)had their text bound but were not a list. After the page loaded, every inner row was empty, rows were copied into the next outer row, and the console warned of a first-paint mismatch. The inner list is now a client list of its own, keyed by its ownkey, with the outer row’s item in scope. It matches React on load, when you reorder it and when it reads the outer item. - A lucide icon in a component under a condition no longer fails the build with
nested-instance.{post.interactive && <TryBadge />}, whereTryBadgeholds an icon and no job, was refused with “has a job”. The first compile sees an icon as a server-rendered island, and icons become static SVG only in the final compile; the first compile’s refusal is now a warning. A realnested-instancestill stops the build, and its message names the cause, for example that<TryBadge>holds the server-rendered React island<Hand>, with its position. - No line break is written before a native component’s root. In alpha.22 and earlier, brust wrote a line break before every native component’s root, whatever the JSX around it, so
<p>the end.<Mark /> after</p>was built asthe end., a line break, then the element, and an inline native component showed a space before it. The break is gone, and JSX’s whitespace rule applies at a native component as at any element: a line break between text and the component is dropped, and a space on the same line is kept. The HTML of a native component now equals what React’srenderToStringgives for its surroundings. The built.jinjatemplates also lose the line break after their header comment and after each{% set %}line of the preamble, so a test that pins their exact text sees the change. - A React island no longer adds a gap in a flex or grid row. In alpha.22 and earlier,
<brust-island>was an element with a box, so in a row withgap: 24pxan island that rendered nothing still counted as an item and added a second gap. Every<brust-island>now carriesstyle="display:contents", as<brust-host>,<brust-row>and<brust-if>already did, so it takes no box and the layout matches the same page written with plain React. Check two things when you upgrade: CSS of yours that gavebrust-islanda box (a width, a margin, a border) no longer applies to it, and a test that compares the exact markup of an island sees the new attribute.
2.0.0-alpha.22 · 23 October 2026
Elysia moves from the 2 beta to the 2 release candidate, which is a breaking change for apps that use brust’s actions. A <title>, <meta> or <link> rendered inside a page now goes into <head>, as in React 19, and the Radix Presence now compiles to native code.
Breaking
- Actions now need Elysia 2 release candidate 0 (
2.0.0-rc.0) instead of the beta.@brust/corelistselysiaand@elysia/edenas optional peers at^2.0.0-rc.0, so install them withbun add elysia@rc @elysia/eden@rc; keep one copy of Elysia in the app, becausemountActionschecksinstanceof Elysia. Two things change for your code. AnHTTPErrorsubclass now sets its extra members with anextension()method; thedetail()method is gone. And extra members of an error response are now top-level in the response body (body.max, notbody.detail.max). Elysia rc also requirestypebox,exact-mirrorandopenapi-typesas peers; bun installs them with the two packages, and with another package manager you add them yourself. The create-app template, the pokedex example and the docs are updated to the same version.
Changes
- A
<title>,<meta>or<link>rendered inside a page now goes into<head>. In alpha.21 and earlier it stayed in<body>, so a route could not set its own title. brust now moves it as React 19 does, in the server’s HTML, in the adapters and in a--target staticbuild: the head’s own elements first, then the moved ones in the order they were rendered. A<link>moves only when it has arelother thanstylesheetand a non-emptyhref. Elements insidesvg,math,templateor an island, elements with anitemprop, and elements that carry a client binding or sit in a conditional or list stay where they are rendered. To give each route its own title, drop the<title>from the layout’s<head>, as in React. A title that changes in the browser is not handled yet (F405). - Radix
Presencenow compiles to native code. Before, the content of a Collapsible was an island atPresence. brust now compiles the published@radix-ui/react-presencesource, with React 19’s behaviour, including holding the content in place untilanimationendwhen it closes. It needs React 19: with another major version the component renders with React. Collapsible as a whole is not native yet, and Tabs content is still an island. useLayoutEffectnow runs after the DOM bindings and beforeuseEffect, as in React. When an update re-runs effects, the order is: the page’s bindings, then layout effects, then passive effects. The runtime grows by 147 bytes gzipped in total.- A ref passed to a native child now reaches the caller. The ref a caller put on a native child’s host element was bound by the child itself, so the caller’s
ref.currentstayednull. It now holds the element. - A conditional
{children}inside a specialised component compiles.{isOpen && children}orcond ? children : nullin a component that brust specialises per call site (Radix’sCollapsibleContentImplis one) was refused with a message that named an empty value. It is now a conditional slot, and the refusal, where one remains, names the value.
2.0.0-alpha.21 · 23 October 2026
A patch that starts from problems found while building a production site: every full page now starts with a doctype, small fonts and images in url() are copied instead of inlined, a prop named req compiles, build errors name the right file and component, and a child component in a native list row no longer throws on load. It also fixes a wrong output: a falsy number left of && renders as React renders it.
Changes
- Every full page now starts with
<!doctype html>. In alpha.20 and earlier, a root layout that returned<html>was sent without a doctype, because JSX cannot write one, and browsers rendered the page in quirks mode (document.compatModewasBackCompat), which changes table sizing, the line height of inline images and the height ofbody. A response whose first element, after whitespace and comments, is<htmland that has no doctype now gets one in front. It applies tobrust start, to the adapters and to the pagesbrust build --target staticwrites. A page that already has a doctype, and a fragment, are unchanged. - A relative
url()in a stylesheet is always copied, never inlined. In alpha.20 and earlier, a font or image under the bundler’s size threshold became adata:URI in the CSS, so importing a package such as@fontsource-variable/nunitoproduced one large stylesheet that carried every subset, and the browser could not choose a subset byunicode-range. Every relativeurl()asset is now written asclient/<name>-<hash>.<ext>at any size, with or without minification, and the URL is rewritten to it. A?queryor#fragmenton the URL (?v=3,?#iefix, an SVG font’s#id) is kept. Adata:URI you wrote yourself stays as written. - A component prop named
req,request,cookiesorheadersnow compiles. In alpha.20 and earlier, any such prop was refused withrequest-state-in-render, even for plain data such as<Count req="18,420" />. Request state is now judged by where the value comes from, not by the prop’s name: only the props the router passes to a route component can carry it. A route page that readsreqwhile rendering is still refused. - Build errors name the file and the component that cause them. In alpha.20 and earlier, an error raised inside a component imported from another file printed the page’s file name with the other file’s line and column, and
nested-instancecould name an unrelated sibling. Each error now names the file its line and column point into, andnested-instancenames the component that has the job oruseId. - A child component in a native list row no longer throws
TypeErroron load. In alpha.20 and earlier, a native list whose row root washidden={cond}and held a child component loggedCannot read properties of undefinedwhen the page loaded: the server’s row was not adopted and was cloned again without its item. The server HTML was already right. The row now keeps the server’s markup, the child receives its row’s item, and clicking a button that changeshiddenbehaves as it does in React. - A falsy number left of
&&now renders as React renders it. In alpha.20 and earlier,{n && <X />}withn = 0rendered nothing where React renders0, with no error. When the left side is not provably a boolean, the value is now printed when it is falsy, both in the server’s first paint (also with JavaScript disabled) and in the browser. A left side that is provably a boolean is unchanged. Inside a table or aselect, where that markup is not allowed, a non-boolean left side is rendered with React and the build names the reasonand-falsy-in-table.
2.0.0-alpha.20 · 17 October 2026
A native Radix Progress follows a changing value, and live values reach the elements of a native child’s rest spread. Two HIGH wrong outputs are fixed: a first-click ReferenceError from a prop default, and an undefined argument in a custom hook’s first paint.
New
- A native Radix
Progressroot follows a changingvalue. A bare Radix Progress Root whosevaluechanges in the browser compiles to native code, and the server and the browser paint the same for every kind of value (a non-integer,-0, a large number,nullorundefined, a boolean). The shadcnProgresswrapper is not part of this change. - Live values now reach the elements of a native child’s rest spread. A value that changes at the call site and lands in a native child’s
{...rest}used to make the call site render with React. It now stays native: pressing one item of a roving group updates the other items’aria-checkedandtabindex, equal to React.className,style, event handlers, URL attributes,value, attributes with no known mapping, camelCase SVG attributes and list rows still render with React.
Changes
- A prop default that names a module function no longer throws on the first click. In alpha.18 and alpha.19 the default was printed in the page’s script without declaring what it reads, so a Radix
getValueLabel = defaultGetValueLabeldefault gave aReferenceErroron the first click. The script now declares the module names and imports that prop defaults read. - A custom hook that takes an argument no longer paints the server’s first paint with that argument
undefined. In alpha.19 and earlier, a hook such asfunction useLabel(n) { return 'L' + n }called asuseLabel(1)renderedtitle="Lundefined"where React rendersL1, and a static attribute never recovers after hydration. The server template, the server job module and the page’s script now order their values by what each one reads.
2.0.0-alpha.19 · 17 October 2026
Rows that run in the browser ship only the fields they read from a module-level list, and a page whose derived value was read only by a ref or an effect no longer throws on load. asChild over a plain static component child, and through a static wrapper that passes its rest props on, compile to native code. Two wrong outputs from alpha.18 now render with React instead.
New
- Rows that run in the browser ship only the fields they read from a module-level list. The list is a
constarray of object literals with literal values, declared in the file or imported from a plain data file in the project. A field that no row cell, key, handler, ref initial value or effect dependency reads stays out of the page’s scripts. The page chunk is 4 to 11% smaller on the test pages, and the saving grows with the unread fields. Any use brust does not recognise ships the list whole, as before. asChildover a static component child now compiles to native code when the child only takes the slot’s props. The child must spread its props onto one host element, as a plain link component does in<XTrigger asChild><Link href="/a" /></XTrigger>. The child’s own props win andclassNameis joined, the slot’s first, as Radix’sSlotdoes. A child that brings a handler or astyle, that has state of its own, that is itself polymorphic, or that does not spread its props onto its one element, or a parent whose replaced element carries a handler or a ref, still renders with React.asChildnow works through a static wrapper that hands its rest props to one polymorphic child. A static component that passes all its remaining props to one polymorphic child (for example a package leaf that spreads them into aPrimitiveelement) now counts as polymorphic itself, soasChildat its call site is resolved at build time. A native component such as a Radix item still renders with React. A wrapper that gives that child children of its own, passes the rest to a second place, or spreads it at run time keeps rendering with React.- A ref that nothing reads no longer forces a forwardRef call site to render with React. If a
useRefvalue is only passed asrefto a static or native component, and that component never reads its forwarded ref, the ref is dropped. A child that reads it, composes it or passes it to something that reads it, or a spread in the props, keeps the React fallback. brust devno longer prints achange detectedline when it starts. Before, the first build was reported as a change to the project folder. The line now appears only for a real edit, and it names the file.
Changes
- A derived value that only a ref’s initial value or an effect’s dependencies read is now declared in the page’s script. In alpha.18 and earlier the page threw
ReferenceErroron load for code such asconst first = ITEMS[0]?.name; const r = useRef(first), withfirstused nowhere else. Ref initial values and effect dependencies now count as roots, so the value is declared and the page loads. - Content that reads a context provided inside a cloned component now gets the provided value. In alpha.18 and earlier, when a Provider sat inside a component that brust cloned for one call site, content reading that context got the default value instead. That call site now renders with React, so the output is correct.
- A component that spreads its rest props into a native Provider no longer loses its children. In alpha.18 and earlier the area the Provider renders its children in came out empty. That call site now renders with React and shows them. The same wrapper used with no children also renders with React (a spread may carry children brust cannot see).
- A page can use a copy of a child made for its host element at many call sites. Pages with 20 identical and with 20 distinct call sites are native, give the same bytes on every request and behave like React after each click. A copy costs about 156 B gzip when the sites are identical and about 330 B when they differ. Content spliced in from another module whose source position equals another call site’s is refused by name.
- A written literal
undefinedfor a Radix__scopeprop no longer makes the page render with React. brust reads it as an absent value, the reading it already used elsewhere. Only the literal is exempt. - An object built in a template ignores an own
__proto__key, asObject.assigndoes. Before, a key with that name was copied as an ordinary key. No wrong output was known, because style printing dropped the key. - The hover lift on the docs site’s loader demo and benchmark cards now eases. The transition named
transformwhile the lift moves thetranslateproperty, so it jumped. Both now transitiontranslate. - A prop written after a spread of unknown keys now wins, as in React, and stays native. A function or live prop written after the last spread cannot be replaced by it, so the call site no longer renders with React for that reason. A key written twice, or between spreads, still renders with React. A
useMemothat returns an array of plain values, as RadixToggleGroupdoes, can now be a derived value of a native Provider.
2.0.0-alpha.18 · 17 October 2026
The shadcn Switch page now compiles with no React and loads a tenth of the JavaScript. A few more Radix building blocks compile to native code, and two diagnostics are clearer.
New
- The shadcn
Switchpage compiles with no React. It was one React island with 89 KiB of JavaScript. It now has no island and 10 KiB, and it toggles the same way React does. RadixSwitch.RootandSwitch.Thumbcompile to native code: the thumb’sdata-stateand the root’saria-checkedfollow each toggle. A Radix render prop that is called with a local object now reads that object’s members. ASwitchin a list whose rows come from state renders with React (see Changes). - Radix
RovingFocusGroup(Root,ImplandItem) compiles to native code.composeEventHandlers(user, handler)from a package counts as a function prop, so these components no longer render with React because of “render reads document”. AuseIdinside a native child is fused into its native parent, and two siblings get different, stable ids. The shadcn toggle-group page still renders with React; other blockers remain. A page that uses such a child inside a list row renders with React. - Content that moves into a Provider’s copy can read an import from the page’s module. The shadcn wrapper’s
className={cn(…)}is the example. A component imported from another package scope that is declared in the same module as the Provider (RadixSwitch.ThumbbesideSwitch.Root) is read as the local one. A really foreign scope still renders with React. - A
classNamepassed through{...props}no longer sends the page to React when the component also takes a function prop with a default. Only the function prop’s own name is checked now, soclassName={expr}stays native.
Fixed
- Props that a call site passes as constants stay fixed in every copy of a Provider. A copy made for the Provider, for children carried in its rest, or for a host element now pins the constant props its call site gives it, so a constant is no longer mistaken for a value that changes. The
Progresspage keeps 0 islands. - A function prop is no longer assumed to travel through a path spread.
{...props.cfg}delivers the members ofcfg, not a prop named after the function, so the requirement that the caller may not pass a function now applies where the spread is written.
Changes
- In a list built from state, a Radix-style root that spreads its rest renders with React when a row gives it a value. The case is a
Switch.Root, or a component shaped like it, initems.map(…)overuseStatewith a per-rowid,aria-labelordata-*. Compiled to native code, a row added in the browser showed the first row’s value for those props. brust now refuses it by name (frozen-prop), so the page renders with React and shows each row’s own value. No published version had this wrong output. - In a list built from state, a copy of a child made for its host element never keeps one row’s value for another row. A row added in the browser could show the first row’s value for a prop that differs per row. It was found and fixed before any release, so no published version printed it.
- Two diagnostics are clearer. A diagnostic about a local that a custom hook creates names the variable you wrote and the hook it came from (
stylesRef, fromusePresence), not the generated name. Thesnapshot-remounthint lists every reason a component must mount once, not only the first.
2.0.0-alpha.17 · 17 October 2026
This version closes several cases where a compiled component showed stale or missing output, including a regression from 2.0.0-alpha.16, and it compiles more Radix patterns to native code, including the first shadcn page to move from a React island to static markup. Upgrade if you use a Provider that spreads its props or a component whose props change while the page is open.
New
- The shadcn
Progresspage compiles with no React when its value is constant. It was one React island, about 86 KiB gzipped; it is now static markup with no client JavaScript, and its first paint equals React’s. Radix Progress callsgetValueLabel, a prop whose default is a plain function in its own module, while rendering, and brust now does the same when the call site passes none. The Provider’svalueandmaxare computed from the props through plain functions that return a string, number or boolean. A value that changes while the page is open (the animated demo) renders with React, and the output equals React’s. A call site that passes its own function forgetValueLabel, or forwards it through a spread, also renders with React. - A context with a literal default value, and Radix’s React-version checks in
useIdanduseCallbackRef, compile. A context created with a literal default is read as that value. The check that picks the hook by React version is decided when brust builds, for React’s own hooks only. A context declared in a hook module is read the same way. useReducer, arrow-function components, hooks inside a returned expression and[literals].includes(x)compile.const X = (props) => {…}is read like a function declaration.useReducerbecomes a state value and one dispatch handler when the reducer is an inline function or a function in the same module that brust can prove has no side effects; otherwise the call site renders with React. An unconditionaluseCallback,useMemo,useReforuseIdanywhere in the returned expression runs before it, in source order.["a", "b"].includes(x)on a literal array of at most 16 members compiles to a chain of equality tests.- A live
styleorclassNamepassed through a component that spreads its props reaches the element. A parent that changesstyleorclassNameon a wrapper that forwards{...props}no longer keeps the component from compiling. A wrapper that may render aSlotstill renders with React, because a Slot merges both. The first paint ofstylematches react-dom: declarations in source order, React’s unitless properties, and no attribute at all for an empty style. @radix-ui/react-collection1.2.0 compiles to a small browser feature. brust recognises that exact version by the hash of its published file, so any other version, or a changed file, stays a React island. The items of a collection are the elements in the page, read when they are needed, so they are always current. Items inside an island or raw markup are left out, so a foreign widget never joins the focus order. The feature loads only on pages that use it.- A context field read inside an event handler or an effect compiles.
context.onItemActivate(…)in a handler no longer sends the component to React. The context may appear only as a field read (c.f,c?.f,c.f(…)). Assigning through it, a computed key, destructuring it, or passing it on as a value still renders with React. - Radix scoped context hooks compile. A context hook called with
props.__scope<Name>is read from the scope that Radix’screateXScope()made, identified by where it comes from and never by its name. Nested frames of the same name under a scope, and call sites whose scope brust cannot prove, render with React. useIsHydratedand a context destructured in the component body compile.useSyncExternalStore(subscribe, () => true, () => false)with an emptysubscribeisfalsein the server HTML and in the first hydrated render, thentrueafter mount, and the component’s other effects seefalsefirst, as in React.const { on, flip } = contextis read field by field. Every otheruseSyncExternalStorestill renders with React.- Early-return chains compile.
if (a) return <A />; if (b) return <B />; …becomes one nested conditional, and aforwardRefcomponent with such a chain is read the same way. - A ref that nothing writes, seeded from a live value, is bound once per mount. Radix’s hidden checkbox input (
useRef(checked)) reaches the element through a forwarding spread, anddefaultCheckedordefaultValueare bound on the element so the first value equals React’s. A component that mounts later than its parent, under a condition for example, is seeded from the parent’s current props. - Children passed to a component that spreads
...restare placed under the specialised Provider. The children can then read the Provider’s context. This covers an unlinked static trigger; a native or linked trigger keeps rendering with React. - A local object that spreads the props can itself be spread onto a component.
const commonProps = { ...props, pressed }followed by<Item {...commonProps} />is read as the props spread plus the named entries, under the same rules as props written out. A local object that is reassigned or mutated, or that has an entry that is not a plain value, still renders with React. - A local object built from the rest props and used only as a spread compiles.
const commonProps = { role: "group", dir, ...groupProps }, where every use is{...commonProps}on a JSX element, is not read as a value. It is expanded where it is spread, and the children travel with the rest under the same rules as before. - Children given to a Provider that spreads its rest are placed in the element that receives the rest.
<Root><span>hello</span></Root>, withRoota Provider that writes<button {...rest} />, compiles withhelloinside the button and no React island. This holds when the rest is spread onto exactly one element and the Provider writes no children of its own; otherwise the call site renders with React. - Slot content that uses the calling component’s values, placed inside a child’s root element, compiles with its own copy of the child. The content’s bindings resolve to the caller, as in React, so
<Label on={on}><Thumb on={on} /></Label>stays live instead of rendering with React. Each such call site adds one clone of the child, measured at 193–396 bytes gzipped on the pages checked. Content that arrives through the child’s...restspread, and text-only content that cannot be proven equal to React’s, still render with React. - A condition on a state value whose server value is a known literal no longer needs a per-request computation.
const [control] = useState(null)followed bycontrol ? control.closest("form") : truecompiles without the dead branch, while the browser still evaluates both branches live. - A spread object may contain a conditional and calls of plain functions. A call of a function that brust has proven free of side effects, over plain reads, is read like a literal value.
Fixed
- A Provider that spreads its props no longer drops the children you pass it. In 2.0.0-alpha.16,
<Root><span>hello</span></Root>printed an empty<button>whenRootis a Provider that spreads its rest props onto the button. The children now show. When the rest is spread onto one element and the Provider writes no children of its own, the Provider stays native and the children are placed inside that element; in other cases the call site renders with React. If you used this pattern on alpha.16, upgrade. - A prop that changes while the page is open no longer stays stale in a compiled component. The old value stayed in the rows of a list that is printed once, in a child component that brust does not link to its parent, and in a prop forwarded through a component’s
{...props}spread. It has been present since alpha.1 and printed no warning. A component with state, effects, handlers or refs now follows its changing props in all three places and stays native. For a component without state, and forchildrenor the whole props object, a call site that passes a changing value (state, a store value or a function) renders with React; a constant is unaffected. A list whose source is an imported value or a module constant keeps that rule too. - Slot content inside a static child that is linked to its parent no longer keeps its first value.
<Label on={on}><Thumb on={on} /></Label>kept the firstThumbafteronchanged; the only sign was a console warning. This version first made such a call site render with React, and it now compiles with its own copy of theLabel(see Slot content that uses the calling component’s values, under New). - Slot content that reaches a child’s element through the child’s
...restspread no longer shows a stale or wrong value. A value of the calling component, used in content placed on the child’s root element this way, stayed at its first value or was looked up on the child’s instance, with no warning. Such a call site now renders with React. - A custom hook that returns an object with a handler no longer answers 500.
const t = useToggle(), where the hook returns{ on, toggle }, threwReferenceError: toggle_useToggle1 is not defined. The object is now read member by member (t.on,t.toggle), as a destructuring is. A value the component computes from a handler a hook created, such as{ cb: t.toggle }built per request, and a handler returned inside a computed result, render with React instead of answering 500. An object that holds the component’s own arrow function or function declaration stays native. - Objects keep JavaScript’s key order. Keys were sorted in a style object handed to a React island, in an object read at request time (
Object.keysandObject.entriesover loader, job or store data), and in an object literal passed to a compiled child.{ marginTop: 5, margin: 0 }printedmargin:0;margin-top:5px, so the longhand won where React ends withmargin-top: 0. The order now follows the source, and the first paint equals React’s. - Two requests whose objects differ only in key order no longer share a cached render, and integer-like keys come first. The cache key sorted the keys, so a second request with the same keys in another order could be answered with the page printed in the first order. The cache key now includes the order when it matters. Keys such as
"2"and"10"are listed first in ascending order, then the others in the order written, as JavaScript lists them. classNameorstyleset toundefinedornullleaves no attribute. The browser binder wroteclass=""andstyle="". An explicitclassName=""keeps its empty class.- JSX children given to a component that passes its whole rest to a specialised Provider are no longer lost. They vanished, and an island child threw in a server job, which answered 500. Where the whole rest is handed to the Provider as data, those call sites render with React.
- A prop named like a template word (
loop,range) no longer collides. Radix’sloopprop clashed with a name in the server template.
Security
- The check for modules that write other modules at load time covers
[build] source_rootsand top-level calls. A write to another module from a file in a shared source root, or from a function the module calls at its top level (function init() { B.x = 1 }; init()), was missed. Both are now seen.
Changes
- A
keythat changes, written outside a list, renders the component with React. React remounts the element when its key changes, which resets its state and effects; brust kept the instance. This covers a key written on an element or component, a call-site spread that may carry one ({...{ key: id }}), and a path spread on a component tag ({...props.cfg}) that may carry one. A constantkeyand the keys of a list are unchanged. A spread on a plain HTML element stays as before, because React itself warns when a spread carries a key. - A literal
throwin a compiled component answers 500, as React’s server render does. The production response body carries no message; the server log does. Where the value that selects the throw is a literal at the call site, the throwing branch is dropped. A value that changes after mount renders with React.
2.0.0-alpha.16 · 16 October 2026
Relative imports are now confined to the app root, with a new setting for monorepos, and context Providers that hold state compile to native code. Several cases where the compiled JavaScript broke in the browser are fixed.
New
- A context Provider whose value holds state compiles to native code. A Provider built with
createContext,useState, handlers anduseIdgets its own copy for each place it is used, so the components that read it bind to that copy, with no React island. The content you pass inside the Provider can read the calling component’s props, state, locals and handlers. When brust cannot prove a case, the Provider stays a React island and the build printsspecialise-unsupportedwith the reason; the rest of the page is unaffected. asChildworks on a component that reads the enclosing native Provider. In<CollapsibleTrigger asChild><a /></CollapsibleTrigger>, the trigger’s toggle handler,aria-expandedanddata-statemove onto the<a>, and the child’s own props win, as in Radix’s Slot. A handler written on the trigger or on the child, anasChildcomponent outside any Provider, and a component child that spreads its props render with React.useId()inside an expression compiles. A call that runs on every render, such ascontentId={useId()}in a JSX prop, now compiles. A call that runs only sometimes (a ternary branch, the right side of&&,||,??or||=, a.mapcallback, a nested function) or a call in akeyrenders with React.- More of Radix’s Switch compiles as written. Callback refs, render props, object spreads in values, an exported
useLayoutEffectalias guarded by adocumentcheck, a spread of a local constant object into a Provider, Provider values derived from its state, and calls to module helpers that only return a plain value now compile, and state that nothing ever sets is read as a constant. The shadcnswitchpage itself does not change yet: it still loads one React island (89 KiB).
Fixed
- A value another module changes at load time renders like React. If one app module changed another module’s exported object when it loaded (
LABELS.a = "patched"), the page showed the declared value with no warning. Components that read such a value now render with React, and the output is the same as React’s. Modules that only read the value stay compiled. - A style object built from a parent’s props stays up to date. A child element with
style={{ ...props.style, k: v }}orObject.assign({}, ...)could keep an old style after the parent changed. It now updates in the browser, and keys keep JavaScript’s order, so in{ marginTop: 5, margin: 0 }the later key wins, as in React. An element that appears later (under a condition or in a list) starts from the parent’s current values. - Components with names like brust’s generated code work in the browser. A binding such as
signal,computed,propsor_c1clashed with a name brust generates, so the server page looked right but the component did nothing in the browser. Generated names now avoid every name the component uses. - A variable named like a generated handler (
_h1) no longer breaks the page. The wrong handler could run, or the JavaScript failed with aSyntaxError. - A component variable named
aworks inside an event handler. The generated handler wrapper hid it (for exampleconst a = useRef(null)). - A prop you leave out takes its default. In a compiled child component,
{ defaultOpen = false }did not apply after hydration when the caller omitteddefaultOpen, so an attribute such asaria-expandeddisappeared. An omitted prop and an explicitundefinednow take the default, as in React. An explicitnullstaysnull. - A context value used inside an effect or a handler no longer throws a
ReferenceError. Such a component now renders with React. - Hooks called in unusual ways no longer produce broken JavaScript.
(0, useId)()and(0, useState)(...)compile as the hook.useId.call(null),.apply(...)and any other use of a React hook that is not a direct call render with React. - Cloudflare Worker builds resolve packages for Workers. The Worker bundle resolved packages with Bun’s conditions instead of the
browserandworkerdones, so it could pick the wrong build of a package. - A package that imports
.or..resolves to the directory’s index file. It resolved to the package’s own entry. - Boolean attributes on custom elements match React. On a tag with a
-, the server HTML and the browser now pass attributes through the way React does.
Security
brust shadcn initchecks where the shadcn CLI will write before it runs it. It reads thecomponents.jsonaliases the way the CLI does, through thetsconfig.jsonextendschain, and refuses a target outside the project or behind a symbolic link. A registry URL item is fetched and checked the same way first, and resolver variables such asTS_NODE_PROJECTare removed from the CLI’s environment. A URL item’sregistryDependenciesand npmdependenciesare not checked.
Changes
- Relative imports that leave the app root fail the build. Monorepos list shared directories in
[build] source_roots. An import such as../../shared/Buttonnow fails withunresolved-import(“it leaves the app root”). Addsource_roots = ["../shared"]under[build]inbrust.toml, and both the compiler and the bundler read that directory. An entry that is the app root or contains it (.,..) is refused: list the shared directory itself.brust devrebuilds when a file in a listed directory changes. See Configuration. - The client and Cloudflare Worker bundles fail the build when brust cannot resolve a package import for the browser. Before, brust fell back to Bun’s resolver, which could pick a Node-only build of the package. The
resolve-fallbackerror names the import, the file that imports it and the reason. Builds for Bun keep the warning. brust shadcn initaccepts only@/...and~/...aliases. Any other alias incomponents.json, including one shaped like a package name (@scope/name), is refused with the reason, because the shadcn CLI can resolve it to a workspace package instead of yourtsconfig.jsonpaths. Rename such aliases to@/...or~/....- New dependency:
tsconfig-paths4.2.0, pinned exactly in@brust/core. It is the resolver the shadcn CLI uses, and onlybrust shadcnloads it. - The pokedex template uses a global
app.css, like the blank template. The layout importsapp.css(Tailwind CSS v4), and brust builds it into one hashed stylesheet that each page links once. The prebuiltpublic/app.cssand the step that regenerated it are gone, andbrust devswaps the stylesheet without a reload. The pages look the same. - More children under plain wrappers compile again. Some children that rendered with React since alpha.14 compile again when brust can prove they are plain values: expressions over strings, numbers and booleans, fields of a module constant that is never changed, and calls to built-in methods that do not change their value.
- The shadcn
collapsiblepage still renders with React. Radix’sPresencecomponent, which mounts and unmounts the collapsible content, does not compile yet, so it stays a React island for now.
2.0.0-alpha.15 · 15 October 2026
Four fixes for pages whose server HTML could differ from React, plus components from packages that compile in more places.
Fixed
- Code that runs when a module loads is no longer skipped on the server. If a component’s file changed a value at the top level (
items.push("b"), or a call that registers something), the server could render the value as it was before that line ran. Such a component now renders with React. Files that only declare values, components and functions are unaffected. Values wrapped in React’sforwardRef,memoorcache, or in brust’scache, keep compiling. - Children that show the parent’s state update again. When a component passed children that read its own state to a child component that brust compiles to native code, the children did not update when the state changed. Such a component now renders with React.
- Elements are no longer dropped from the server HTML. An element placed directly in a component’s output, or an element passed as a prop, could be missing or wrong in the server-rendered page. brust now renders these itself only when it can prove the result, and otherwise renders with React.
Changes
- Helpers imported from packages compile as children. A call such as
{formatDate(d)}, whereformatDatecomes from an npm package, compiles again when brust can prove from the package’s source that the helper returns a string, number or boolean, including through re-exports in the package. In alpha.14 these rendered with React. - Package components that render as React islands use the package’s published files. They were bundled from the package’s source maps since alpha.12. The build now resolves packages with the same conditions as Bun’s bundler, including production builds, and a context Provider and the components that read it always share one copy of the package.
2.0.0-alpha.14 · 15 October 2026
The shadcn Toggle compiles to a static page, children that disappeared under plain wrappers render again, and attributes updated in the browser now match the server.
New
- The shadcn Toggle page is static: 87 KB → 5 KB of JavaScript, no React island. Radix’s
useControllableStatehook and itsTogglenow compile as written. When a component spreads its props onto an element and also sets values that change with state (aria-pressed,data-state) or anonClick, the parent binds them in the browser. Hooks that take an options object, call plain helper functions, useuseLayoutEffectoruseInsertionEffect, or log development-only warnings now compile too.
Fixed
- Children of a plain wrapper no longer disappear. A child such as
{icons.home},{list[0]}or a call to an imported helper that returns JSX could render as nothing on the server. brust now renders a child itself only when it can prove the value is plain data, which still covers common cases such as{price.toLocaleString()}and{new Date(d).toLocaleDateString()}. Anything else renders with React. useRef(initialValue)keeps its initial value in compiled components. It started asundefined, so an effect that compared against the previous value ran its change logic on mount.- Attributes updated in the browser match the server’s HTML. Boolean and enumerated attributes such as
hidden,aria-*anddata-*follow the same table on both sides, and the safe-URL check now covers links inside SVG. - Two cases that broke the compiled JavaScript are fixed: reading the whole
propsobject in a handler of a component that also spreads...rest, and a hook whose arguments are computed from other values.
Security
- Loader data cannot overwrite internal per-component values. A key returned by a loader with the shape of brust’s per-instance data is dropped, as job results already were in alpha.13.
Changes
- Some children now render with React instead of being compiled: calls to helpers imported from packages, and method calls on state or list items that brust cannot prove are plain values. The output is the same.
2.0.0-alpha.13 · 15 October 2026
Fixes for attributes and event handlers that did not behave like React, plus internal hardening.
Fixed
aria-*anddata-*attributes set tofalserender like React. A dynamicaria-pressed={false},data-stateor another attribute that React prints as text was dropped from the HTML. It is now printed as"false", on the server and when the value changes in the browser.- Event handlers can call
isPropagationStopped(). Compiled handlers receive the browser’s event, which lacked the methods React adds.event.isPropagationStopped()threw aTypeError. The event now has React’sisPropagationStopped,isDefaultPrevented,persist,nativeEventandisPersistent.
Changes
- The shadcn
selectpage renders as a React page with one island (117 KB, was 118 KB), because more Radix package sources are now read for compilation (switch, checkbox, controllable state), and a context consumer from a package source inside an island keeps its caller in React. - The docs explain when islands become interactive. The time between the first paint and hydration equals a React server-rendered page, and islands keep loading right away by default. Preloading the React chunks was measured and not shipped: it made hydration slightly earlier but the first paint later on slow connections.
- Internal hardening. Server job modules can only be imported by the build’s own job files, and job results live under a reserved prefix that loader data cannot overwrite.
2.0.0-alpha.12 · 15 October 2026
Context Providers that brust can lower, shadcn setup in bun create, no idle workers for static shadcn apps, and fixes for children that disappeared.
New
bun create @brust/app my-app --shadcn button cardcreates the project and runsbrust shadcn initin it, in one command.- Context Providers compile. A component that provides a value with
createContext(or Radix’screateContextScope) and the components that read it now compile without React when the Provider’s value is literal data and the children under it read only props, locals, constants, or module helpers that brust can prove return a string, number or boolean. Anything else keeps the Provider as a React island, with a named reason in the build output. The Radix Progress pages still render as islands.
Fixed
- A JSX constant used as children no longer disappears.
const icon = <Star />(in the same file or imported), passed as{icon}to a component that brust compiles, could render as an empty element on the server. It now renders, using React where brust cannot prove what the value is. - A context consumer with server work inside a React island no longer fails the build. The component that renders it stays React. The shadcn collapsible, dialog and sheet pages are affected: each now renders as a React page with one island, at about the same size as before (89, 101 and 101 KB).
Security
brust shadcn initis safer to run and to copy from. It no longer writes through a symlinkedtsconfig.jsonorcomponents.json. It installs the exact package versions it was tested with, and it warns that a component given as a registry URL installs third-party code. Every command it prints for you to run quotes the folder and component names, so pasting them into a shell cannot run anything else.
Changes
- Static shadcn apps start with no worker processes. Server code that no page uses is no longer written to
jobs.js, and it no longer counts whenbrust startdecides whether it needs workers. The pages are served the same. - A context Provider whose value comes from props, state or a function call stays a React island. brust lowers a Provider only when its value is literal data; any other value keeps the React behaviour exactly.
2.0.0-alpha.11 · 15 October 2026
A one-command shadcn/ui setup, fewer worker processes for static apps, more components that compile, and fixes for builds that failed on valid React.
New
brust shadcn initsets up shadcn/ui in one command. Runbunx brust shadcn init button card dialogin a project. It writescomponents.json, adds the@/*path totsconfig.json(your comments are kept) and installs the four packages the components use. Then it runs the shadcn CLI, at a pinned version, to add the theme and the components you named. A second run skips every step that is already done. Set up shadcn/ui is rewritten around it.
Fixed
- A native component that holds a component with its own server work no longer fails the build. A component with state and a handler that renders a child with a server job or
useIdstoppedbrust buildwithnested-instance. The component that renders it now stays React. - An object constant used in an event handler no longer breaks the build.
const step = { up: 1, down: -1 }inside a component, read in anonClick, was printed as invalid JavaScript and stoppedbrust build. It now compiles and behaves as in React. useIdno longer repeats the same id. A child that callsuseId, passed through a component that renders its children in every row of a list, printed the same id in each row. Such a child now renders with React.
Changes
- An app whose pages are all static no longer starts worker processes. If no page has a loader, a server job, an action, a React island to render on the server or a cache adapter,
brust startserves without workers. It therefore no longer imports your route modules: top-level code in them runs duringbrust build, not at start. - Props spread into a component that does server work now compile. A wrapper that spreads its props into such a child (
{...props}) used to keep the page in React. It now compiles, and the shadcnaspect-ratiopage goes from 74 KB of JavaScript to none. - Components whose children need their own server work run as one job. When a component computes something on the server and so does a child it renders (shadcn’s pagination link inside a button, an input group’s addon), the child now runs inside the parent’s job instead of keeping the page in React. Client JavaScript on the shadcn pages: pagination 87 → 0 KB, button-group 86 → 0 KB, separator 84 → 0 KB, input-group 87 → 4 KB, field 86 → 4 KB.
- A component that passes its own props into a React island compiles. If a wrapper renders an island and passes it
{title},{children}or a condition over its props, the page stays static and only the island loads React. Values from a request are only ever rendered as text or as attribute values, never as markup. Astyleobject, a list over props and a wrapper that also spreads props into the island still render with React.
2.0.0-alpha.10 · 14 October 2026
Mostly fixes: pages that rendered the wrong classes or text, builds that failed on valid React, and one security hardening. Upgrading is recommended.
Fixed
- A component built with
cvagets its default classes when you omit a variant. A shadcn-style<Alert>or<Badge>without avariantprop was rendered by the server without itsdefaultVariantsclasses, because a missing prop reached the class function asnullinstead ofundefined. It now matches React, including nested props, explicitnull, default parameters and??. - A prop named
loop,range,namespace,callerorselfrenders its value. Read asprops.loop(orrest.self), it printed the server template’s own object, such as<loop 0/2>. Those reads now render with React. - Valid React no longer stops the build with
nested-instanceorinstance-prop-path. Shapes such as<Button className={cn('a', props.x)} />in a page, a component with server-computed props inside another inlined component, or an island with per-row props in nested lists now render with React instead of failingbrust build.
Security
server-onlymodules stay on the server. A module that importsserver-onlyand is reached from code that runs in the browser is refused with brust’s own error, including through re-exports and dynamic imports. The build also checks that.brustand.brust/pkg-srcstay inside your app before deleting anything there.
Changes
- Class names built from constants are computed at build time.
cn(…),cva(…),clsxandtailwind-mergecalls whose inputs are constants run once duringbrust build(with the real packages) and the page carries the resulting class string, so the server does less work per request.brust devkeeps computing them per request; the output is the same. - More prop shapes compile. A prop default that reads a module constant (
orientation = DEFAULT_ORIENTATION), and a spread onto an HTML element of a constant whose value is chosen by a condition (const attrs = vertical ? a : b, then{...attrs}).
2.0.0-alpha.9 · 14 October 2026
brust now compiles published library source, more shadcn/ui pages ship no JavaScript, and there is a guide for setting up shadcn/ui. See Set up shadcn/ui and shadcn/ui and libraries.
Fixed
- A props pattern with a quoted key no longer breaks every render.
function C({ 'data-x': dx, ...rest })compiled, but each render of that component failed and the page answered 500. A default that is an immediately called function,{ a = (() => 1)() }, rendered empty. Both, and the related defaults that could not be printed, now render with React (a named fallback), in parameter and body patterns.
Changes
- Published packages are compiled from their own source. When a package ships its original TypeScript in its source maps (every
@radix-ui/*package does), brust compiles the components you use instead of shipping them as a React island. The first one is Radix Label: the label page goes from 85 KB to 4 KB of JavaScript. A package without its source stays an island, as before. @/imports, icons that receive props, and??fallbacks compile.tsconfig.jsonpaths(such as"@/*": ["./*"], which the shadcn CLI writes) resolve like relative imports; a lucide icon that receives{...props}renders as plain SVG;{children ?? <ChevronRight />}renders without React. The spinner, breadcrumb and button pages ship no JavaScript.- Props destructured in the component body.
const { a, b = 1, ...rest } = propscompiles like the same pattern in the parameter list. - Guide: set up shadcn/ui. A step-by-step guide from
bun create @brust/appto shadcn/ui components, and a new “React & libraries” section in these docs.
2.0.0-alpha.8 · 14 October 2026
A fix release. Upgrade if your app uses 2.0.0-alpha.6 or alpha.7.
Fixed
- A page no longer answers HTTP 500 when a React island gets plain HTML elements as children. In 2.0.0-alpha.6 and alpha.7, an island whose JSX children (or element-valued props) were only plain elements, such as
<TooltipTrigger><span>…</span></TooltipTrigger>, made the server render fail with React error #31 and the whole page returned 500. Those children now render as React elements.
Security
- Request data can no longer be turned into elements by the island revive. In 2.0.0-alpha.7, when one component was both a page or layout and a React island that received JSX children from another file, data returned by its loader could reach the code that rebuilds those children, so a loader value shaped like brust’s internal markers could add elements to the page. React’s escaping, the removal of
dangerouslySetInnerHTMLand the island’s own component list still applied. Now a page or layout is never such a host (the caller falls back to React withrevive-host-route-root), only names the compiler declared are rebuilt, and a server render rejects reserved$keys in a host’s inputs.
2.0.0-alpha.7 · 14 October 2026
Every page of the shadcn/ui fixture now builds, lists and conditions made of constants no longer force a React island, and the largest page is smaller. See shadcn/ui and React libraries for the current numbers.
Upgrade note
Rebuild your app after you upgrade. The build output (dist/manifest.json) changed format, from version 2 to 3. A build made with an earlier brust is refused when it starts:
[brust] manifest: manifest version 2 unsupported (want 3): rebuild the app with this brust versionRun brust build again with the new version; nothing else changes in your project.
Changes
- A function or a changing value passed to a React island no longer fails the build. The component that passes it renders with React, like every other shape brust does not lower, and the build prints
island-propas a fallback. Before, such a page stopped witherror island-prop. - Lists over a constant. A component rendered in a
.mapover a module constant or an inline array, whose props do not depend on the row, is rendered once per page instead of making the page a React island (instance-list-path). A table of rows built from a constant array is static. - A component fed by the row of a constant list. A component rendered in a
.mapover a module constant or inline array, whose props read the row, gets one job call per row from the literal instead of falling back. The served HTML of the started page equals the React build’s. - Constant lists, conditions and element props inside an island’s children.
[1, 2, 3].map(n => <li>{n}</li>),Array.from({ length: 4 }, …), a constant condition, and an element passed as a prop (content={<Tooltip />}) are worked out at build time. The scroll-area, carousel, sidebar and chart pages stop being React pages, each keeping only its library island. A prop named$…on an island fails closed. - Smaller island bundles. A package imported by a staged island is now resolved the way your own source is, so it is tree-shaken: the dialog page goes from 114 to 102 KB gzip, and the chart page stays at 240 KB now that it is a static page (without this change it would have grown to 324 KB). One copy of React is bundled across island, runtime and job chunks, for the Bun build, the Cloudflare build and
--target static. forwardRefcomponents.const X = React.forwardRef(function X(props, ref) { … }), an arrow callback,export default forwardRef(…)and alias exports (export { X, X as Root }) compile like any component. A forwardedref={ref}on an HTML element is dropped; any other use of the ref (reading it, passingrefto a component,useImperativeHandle) keeps the component on React (forwardref-ref).- A hand-written
jsx()call is no longer printed as an object. A call tojsx,jsxsorjsxDEVfromreact/jsx-runtimenow falls back to React (jsx-runtime-call). Before, the page compiled static with the element object in its HTML.
2.0.0-alpha.6 · 14 October 2026
This release is about React code you did not write for brust. The compiler now reads what shadcn/ui components are made of, so more of them render as static markup or a native component instead of a React island. See shadcn/ui and React libraries for what compiles and what does not, with the numbers from the build.
You can now write
- Rest props and JSX spread.
function Card({ className, ...props })followed by<div {...props} />compiles. It used to be a React island (prop-pattern,spread-props). - A handler through a child’s rest spread.
<Button onClick={add}>whereButtonspreads its props onto a<button>: the parent binds the handler on that element and becomes a native component, instead of the pair falling back to React. A handler that closes over the child’s own state, and render props, still keep the component a React island. asChildandSlot.const Comp = asChild ? Slot.Root : 'button'is resolved where the component is used:<Button>is a button,<Button asChild><a href="/x">…</a></Button>is the link carrying the button’s props. A value that is not known when you build still makes the component an island.<Pkg.Member>tags.<DialogPrimitive.Root>and aconst Root = DialogPrimitive.Rootalias resolve to the package’s export, which renders as an island like any package component. A member that the package does not have fails withbrust: <package> has no export <path>when the island loads.- Constant children inside an island. Markup between the tags of a React island, when it is constant, is handed to the island as data. The page around it stays static; before, one such island made the whole page one island.
- Components exported by name. A file that exports several components (
Card,CardHeader, …) can have any of them rendered as an island. Before, building such a page failed withNo matching export … for import "default".
What got smaller
- A page loads only the browser runtime it uses. The runtime is a small core plus feature files (
basics,if,for,model,html,island,store). The build records which a page needs and the page links exactly those, withmodulepreload. Before, every page with a native component loaded the whole runtime. See Rendering tiers.
CSS
- Your Tailwind compiles your CSS. The Tailwind version installed in your app builds your stylesheet, not a copy bundled with brust. Tailwind 4.1 is the minimum; an older version stops the build with an error that says so. See CSS.
Measuring shadcn/ui
- A fixture app with the shadcn/ui components, built page by page, writes
docs/shadcn-coverage.mdanddocs/shadcn-coverage.json: tier, islands and client JavaScript per page, and the ranked list of what still blocks. CI fails when the committed copy is stale.
Earlier versions
- 2.0.0-alpha.5 · 13 October 2026. The documentation site on Tailwind (#191–#195), its stylesheet through the brust CSS pipeline (#186),
create-appwrites the current version (#187), and fixes for two flaky tests (server start-up logging #181, a 413 on chunked bodies #183). - 2.0.0-alpha.4 · 13 October 2026. Static export (
--target static, #159), the CSS pipeline and Tailwind (#163, #167), components from packages as islands (#161), build-time evaluation of constant slots (#164, #174), lucide icons as inline SVG (#178), CSS Modules folded into class names (#177), standalone actions (#172), the dev tools panel (#166), and a blank template with Tailwind (#168, #180). - 2.0.0-alpha.3 · 12 October 2026. The Cloudflare Workers runtime (
@brust/core-cf) and cache adapters:@brust/core/cache-adapter,@brust/cache-redis,@brust/cache-cloudflare. - 2.0.0-alpha.2 · 12 October 2026. Follow-ups to the first alpha: cache read stamps for the L1 and job caches, the cross-site guard for actions, large action bodies.
- 2.0.0-alpha.1 · 12 October 2026. The first v2 release: the unified store, Actions served as an Elysia app behind the Rust HTTP server,
bun create @brust/app, and the performance work with its benchmark suite.