跳到正文
Hacker News· burnrate·· 3 天前AI 评分50

Proa:Rust 高性能 Web 框架,支持快速 SSR 与多目标渲染

Show HN: Proa – A Rust web framework with fast SSR and multi-target rendering

AI 导读

Proa 是一个 Rust Web 框架,围绕可组合的多目标渲染编程模型构建,同一类型化组件可同时渲染 HTML、Markdown 等目标。其渲染 p50 为 23.5 µs,比 React renderToString 的 5.56 ms 快 237 倍(8-vCPU AMD EPYC-Milan VPS 实测)。

正文 · 原文

An extremely performant, batteries-included Rust web framework built around a new programming model for composable, multi-target rendering.

Get startedWatch intro

One object. Every render target.

HTML, Markdown, and other render targets, from one typed component.

Watch multi-target rendering

ProductCard::new(product)
impl<L: DataLoader> MdRenderSync<L> for ProductCard {
    fn render_md(self, cx: &mut WebContext<L>) -> Result<(), WriteError> {
        md_sync! { r###"
            # {self.product.name}

            {Link::new("Buy now", self.product.url)}
            "###
        }
        .render_md(cx)
    }
}
md_sync! { r###"
    [{self.label}]({self.href})
    "###
}
impl<L: DataLoader> WebRenderSync<L> for ProductCard {
    fn render(self, cx: &mut WebContext<L>) -> Result<(), WriteError> {
        html_sync! {
            <article data-product-card>
                <h2>{self.product.name}</h2>
                {Link::new("Buy now", self.product.url)}
            </article>
        }
        .render(cx)
    }
}
html_sync! {
    <a href={self.href} data-link>
        {self.label}
    </a>
}

Build fast, information-dense apps.

Explore re-creations of GitHub, Sentry, and Airbnb, built in Proa with fast server rendering and selective interactivity.

View ShowcaseBenchmarks

oven-sh/bun

CodeIssues5k+Pull requests1.9kActionsSecurityInsights

[tracking] Zig/C++ fork: Rust->Zig port progress #31136

ClosedMaurerAntonwants to merge 8 commits intooven-sh:main

Conversation9Commits8Checks1Files changed16+461-10

23.5 us

Proa render p50

5.56 ms

React renderToString p50

237x

faster

Warm production p50s measured on an 8-vCPU AMD EPYC-Milan VPS.

Independent demos. Not affiliated with or endorsed by GitHub, Sentry, or Airbnb.

The numbers behind the speed.

Server-render latency across 17 renderers and three workloads. Proa leads the component frameworks; React takes 13.2 to 35.4 times as long.

Build your design system.

Proa UI offers Shadcn style Proa components. Source in your repo, in typed Rust. Theme it, compose it, ship it.

Browse Components

  1. Single or multiple open panels, with a CSS-only build that ships no JavaScript at all.

  2. InvoiceStatusAmount
    INV-2041Paid$1,499.00
    INV-2042Pending$399.00
    INV-2043Paid$399.00
    INV-2044Refunded$399.00

    Header, body, footer, and caption parts that compose into dense record views.

  3. Solid, outline, ghost, and link variants across three sizes and three intents.

  4. Used in your deploy URL.

    Server render by default

    Ship islands only when needed

    Labels, descriptions, and error text wired to any control, in either orientation.

  5. Deploy preview

    Pushed 2 minutes ago to main.

    Render
    41µs
    Client JS
    0kB

    Built from source in your repo.

    Header, content, and footer slots for the surface most product screens are built from.

  6. March 2026

    MoTuWeThFrSaSu

    Single and range selection, month paging, and keyboard navigation, rendered as plain HTML.

  7. Weekly requests36.2k

    Area, bar, line, donut, and stacked series drawn as pure SVG on the server.

  8. Grouped one-time-code slots with separators, size variants, and a caret you can style.

  9. ME

    You

    Can an agent add a settings page to this app?

    9:41

    AI

    Proa

    Yes. Every component is typed Rust in your repo, so the compiler checks the edit before it ever reaches a browser.

    9:41

    ME

    You

    How much JavaScript does that ship?

    9:42

    Message bubbles, avatars, timestamps, and typing indicators for assistant surfaces.

  10. Syntax highlighting done on the server, so no highlighter ships to the browser.

  11. 58components, every one with a live example, a props table, and Rust you can copy.

Scroll sideways or use the arrow keys to move through the component demos.

Everything people want from a modern web app, without the render tax underneath it.

A component system and a framework surface, not a templating engine.

Framework

Framework primitives beyond template glue.

Proa keeps streaming, request data, routing, metadata, and response control inside the same typed WebContext as your components.

Streaming SSR, in order or out of order

Flush HTML in document order when sequence matters, or let Suspense boundaries stream ready chunks out of order when slow data should not block the page.

DataLoader-backed WebContext

Every render has typed access to request-scoped data, response metadata, route state, and loader caching through the same WebContext components already receive.

Typed SSR framework semantics

Layouts, routing, metadata, static assets, forms, mutations, and progressive navigation compose through the same Rust component model instead of template glue.

Interactivity

Add interactivity without giving up native SSR.

Keep the page as server-rendered HTML, then opt specific controls into client behavior with typed signals and event handlers. Proa compiles only the moving pieces into JavaScript.

RSJS islands

Use signal(...), bind_value, typed events, and named handlers in Rust. The compiler lowers the client behavior.

Tiny per-island JavaScript

Each hydrated RSJS island emits a small vanilla-JS module plus seed state, served with a shared runtime around 1.3 KB gzipped.

Adoption

Keep the stack you already have. Move one route first.

Go Axum-native for Proa routing and responses, or call Proa over FFI from Node, Go, Python, Ruby, or Java.

Run alongside your existing app

Proxy one route to Proa, leave the rest on Next.js or Rails, then compare latency and cost in production.

Security by default

Auto-escaped output, cross-origin request protection, security headers, and fixed-upstream proxying are part of the framework surface.

Accessibility at compile time

WCAG and WAI-ARIA checks run during cargo build so common markup defects fail before deploy.

来源:Hacker News · proa.so