Strata is a Rust-powered library that converts typed, non-interactive content into safe, deterministic HTML fragments for use within React Server Components, reducing the serialization overhead of large static element trees.

Stars

7

7-day growth

No data

Forks

0

Open issues

0

License

MIT

Last updated

2026-07-29

AI repository intelligence
FR-AI / ANALYSIS

Why it is worth attention

It provides a specialized, optimized representation for large static interiors that do not need per-element React ownership, potentially improving performance in RSC frameworks while maintaining a strong security boundary.

Who it is for

  • React Server Components developers
  • CMS/platform teams building with React
  • Performance-conscious web developers
  • React framework authors exploring transport optimizations

Use cases

  • Rendering large articles and documentation pages inside a React Server Component
  • Serving CMS-driven read-only content with minimal React overhead
  • Displaying code listings or large read-only descriptions in a React app

Strengths

  • Built with Rust for fast, deterministic HTML generation and strong safety guarantees
  • Security-by-design with allowlisted tags, attributes, and URL protocols, plus output size limits
  • Produces byte-identical output with a BLAKE3 content hash for cache-friendly integration
  • Works seamlessly with React Server Components, allowing Client Components around the static fragment to remain interactive

Considerations

  • Early exploration stage – document format and API may change before version 1.0
  • Only suitable for non-interactive content; cannot include Client Components, event handlers, or state inside fragments
  • Requires a native Rust binary per platform, which may complicate deployment in some environments

README quick start

Strata

Rust-powered static HTML fragments for React Server Components.

Strata turns typed, non-interactive content into safe, deterministic HTML. React continues to own composition, Client Components and application state. Strata handles static interiors that do not need element-by-element React ownership.

Status: early exploration. The document format and API may change before 1.0.

Why Strata?

Large static content can expand into a much larger serialized React element tree. Strata provides a narrower representation:

typed content → Rust renderer → safe HTML → React-owned boundary

This does not replace React Server Components or Flight. It gives an RSC framework an optimized representation for host-only regions such as articles, documentation, CMS content, code listings and large read-only descriptions.

Background

Strata grew out of the representation-aware transport idea explored in RSC or Raw Data? Designing a Representation-Aware UI Transport. The package is a small experiment around one piece of that idea: carrying safe HTML fragments through a React-owned RSC boundary when a subtree does not need element-by-element React ownership.

Install

pnpm add @farming-labs/strata

Install only @farming-labs/strata. It automatically installs and loads the native binary for the current operating system and CPU architecture. Packages named @farming-labs/strata-* are platform-specific optional dependencies and should not be installed directly.

Render a document

import { render } from "@farming-labs/strata";

const content = {
  type: "document",
  children: [
    {
      type: "element",
      tag: "article",
      attributes: { class: "prose" },
      children: [
        {
          type: "element",
          tag: "h1",
          children: [{ type: "text", value: "Representation-aware UI" }],
        },
        {
          type: "element",
          tag: "p",
          children: [
            {
              type: "text",
              value: "React owns the boundary. Strata renders the interior.",
            },
          ],
        },
      ],
    },
  ],
};

const fragment = render(content);

fragment.html;
fragment.hash;
fragment.nodeCount;
fragment.bytes;

Text and attribute values are escaped. Elements, a

Description

RSC Static Renderer: A Performant & Efficient Rust-powered HTML for static React boundaries

Related repositories

Similar projects matched by category, topics, and programming language.

react
Featured
react GitHub avatar

react

React is a JavaScript library for building user interfaces with declarative, component-based, and cross-platform design.

Web DevelopmentFrontend Frameworks
246,741
TanStack
Featured
TanStack GitHub avatar

router

TanStack Router is a type-safe, data-driven React router with built-in caching, prefetching, and nested layouts, while TanStack Start extends it into a full-stack SSR framework.

Web DevelopmentFrontend Frameworks
14,861
NUber-dev
Featured
NUber-dev GitHub avatar

YTubic

YTubic is a fast, responsive, open-source YouTube Music desktop client for Windows, Linux, and macOS that uses direct InnerTube API communication and aggressive caching to provide instant navigation and playback.

Web DevelopmentFrontend Frameworks
226