Repository navigation
Releases
Releases · farming-labs/islx
v0.0.30
0.0.30
dispose(scope)on the runtime fromcreateIslandRuntime(@farm.js/islx/islands/client)
unmounts only the islands underscope, and drops the ones there still waiting for their
strategy. Islands already removed from the document go too. A framework that swaps part of a
page on navigation disposes that part and keeps the rest running. Without a scope it disposes
every island, as before.
v0.0.29
0.0.29
resolveIslandMarkup(@farm.js/islx/islands/server) returns an island's markup in parts: the
value scripts to write first, the<f-island>element with its attributes unescaped, and the
props script with its text escaped. A renderer that builds elements, or renders an island inside
its page's own render, can write the wire format without going through a string.
renderIslandMarkupjoins the same parts, and its output is unchanged.
v0.0.28
0.0.26 and 0.0.27 were tagged but never reached npm, so their changes ship to npm for the first time in 0.0.28. All three are listed below.
0.0.28
- A page whose islands take plain JSON props hydrates without the code that revives the rest:
slots, server trees, actions, promises, streams, tagged values and form state. The runtime loads
it with the first island, form state or action result that needs it. A form in a server
component loads the action call path on its first submit. The dist has one chunk per browser
module, so an app's bundler can leave both out of a page's first load. On the dash page of
Farm's islands benchmark, islx's first-load code goes from 13.2 to 6.2 KB brotli, and the page
is fully hydrated 32 ms sooner at 1.6 Mbit/s. - Islands for any renderer.
@farm.js/islx/islands/serverwraps HTML from any renderer's string
renderer in the island element and its props (renderIslandMarkup), and
@farm.js/islx/islands/clienthydrates it with a renderer's onehydratefunction
(createIslandRuntime,defineIslandRenderer). Strategies, held clicks, the codec's tagged
values, values sent once and server actions work as they do with React.examples/renderers
has adapters for Preact, Vue, Svelte and Solid. Slots, promise props, server trees and form
state stay in@farm.js/islx/react, which is unchanged.
0.0.27
- Islands of one response encode a value they all receive once. A docs layout that passes its
navigation tree to a sidebar and a mobile menu no longer encodes the tree twice. Only values that
hold no action, slot, promise or cycle are reused, and never across responses. On the docs section
of Farm's islands benchmark, server CPU per request drops by about 15%.
0.0.26
- An island carries React's client reference marker (
$$typeofis
Symbol.for("react.client.reference")), as a"use client"export does under React Server
Components. Code written for Server Components that walks an element tree outside a render, such
as an MDX-to-Markdown converter, skips it instead of calling it and failing on its hooks. - A server tree keeps the sizes of its static elements for one render in a map that ends with it,
instead of writing every element of every page into a module-wideWeakMap. On a long guide page
in Farm's islands benchmark, server CPU per request drops by about a tenth.
v0.0.23
- A rebuilt server tree page keeps its component type across navigations, so the next page of the
same layout updates the page on screen in place, as React Server Components do. Before, React
unmounted and remounted the whole page on every navigation, losing client state and DOM nodes. - A client component whose props hold nothing to split (no server elements, promises or streams)
gets them without a copy. Server rendering of island-heavy pages takes about 29% less time on a
300-page docs app.
v0.0.21
Server actions take and return what React Server Components let them.
- A value the codec cannot carry (an element, a plain function, a class instance, a local symbol)
can be an action argument. The action gets a stand-in it can only return, and the browser gets
the same object back, as a temporary reference. Reading or changing the stand-in throws. - An action bound with
.bindin the browser can be sent to another action, and an action the
browser sent can be bound again on the server and returned. - An action can return an inline action that captured values. Before, the call answered 500.
v0.0.20
v0.0.19
More of what React Server Components send travels, in props and action results.
- A
MaporSetcan hold elements and promises: elements render with their client components
live. Before, an island failed its render and an action answered 500. - Global symbols (
Symbol.for), errors, generators and other self-iterators,Blobs and
FormDatatravel. An error arrives without its message, as in a React production build, and an
island's server render sees the same error. AFilearrives as aBlob. - Wire: new tags
y,Z,i,bandf(see SPEC).
v0.0.18
- With the React renderer installed (as in Farm), a server action that returns an object whose
promise settles to that object answers, and the promise gives back the same object. Before, the
response never ended. A result that holds itself and an element or a promise keeps its cycle
too: before,result.selfwas a separate copy.
v0.0.17
A promise that settles to the object holding it works, as under React Server Components.
- A server action can return an object whose promise settles to that object: the promise
settles to the same object in the browser. Before, the server sent it again without end and its
event loop stalled. A stream's chunks can refer to the object holding the stream too. - A client component can receive such a prop, and its promise (or stream chunk) gives back the
same object, on the server render and in the browser. Before, React's server render overflowed
its stack. - A promise or stream that appears twice in a result, or twice in one island's props, is one
promise or stream in the browser.
v0.0.16
Elements that arrive later render, as under React Server Components.
- A client component given a promise that resolves to elements renders them, client components
inside included, and they hydrate. Before, the promise rejected in the browser. - A client component that reads a stream prop while rendering on the server gets its own copy of
the stream, and elements in its chunks render and hydrate. Before, the server render failed
with "ReadableStream is locked". - A server action's promises and streams can settle to elements. They render inside the
framework'srun, with the request's context. Before, the browser got a rejection. - An island in Suspense content that React reveals after the document is parsed hydrates. React
batches reveals, and before, such an island stayed inert.