Skip to content

v0.0.28

Choose a tag to compare

@Kinfe123 Kinfe123 released this 24 Nov 11:18
· 4 commits to main since this release
61c03e5

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/server wraps HTML from any renderer's string
    renderer in the island element and its props (renderIslandMarkup), and
    @farm.js/islx/islands/client hydrates it with a renderer's one hydrate function
    (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 ($$typeof is
    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-wide WeakMap. On a long guide page
    in Farm's islands benchmark, server CPU per request drops by about a tenth.