npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@flightdev/ui

v4.0.0

Published

Flight Universal UI Core - Base types, adapters, and registry for 18+ UI frameworks

Downloads

13

Readme

@flightdev/ui

The universal UI framework layer for Flight. Provides server-side rendering (SSR) and hydration support for 18+ UI frameworks.

Table of Contents


Installation

npm install @flightdev/ui

Then install the adapter for your framework:

npm install @flightdev/ui-react    # React 18+
npm install @flightdev/ui-vue      # Vue 3
npm install @flightdev/ui-angular  # Angular 17+
npm install @flightdev/ui-svelte   # Svelte 5
npm install @flightdev/ui-solid    # Solid.js
npm install @flightdev/ui-qwik     # Qwik

Quick Start

import { defineUI, renderPage, toHTML } from '@flightdev/ui';
import { react } from '@flightdev/ui-react';

// Define UI configuration
const ui = defineUI(react());

// Render a component
const result = await renderPage(ui, {
    component: App,
    props: { user: { name: 'John' } },
});

// Generate full HTML document
const html = toHTML(result, {
    title: 'My App',
    lang: 'en',
});

Architecture

The UI system is organized into three tiers based on feature support:

Tier 1: Full Support

Full SSR, streaming, hydration, and islands architecture support.

| Adapter | Package | Streaming | Islands | Resumable | |---------|---------|-----------|---------|-----------| | React 18+ | @flightdev/ui-react | Yes | Yes | No | | Vue 3 | @flightdev/ui-vue | Yes | Yes | No | | Angular 17+ | @flightdev/ui-angular | Yes | Yes | No | | Svelte 5 | @flightdev/ui-svelte | No | Yes | No | | Solid.js | @flightdev/ui-solid | Yes | Yes | No | | Qwik | @flightdev/ui-qwik | Yes | Yes | Yes |

Tier 2: Standard Support

SSR and hydration with framework-specific optimizations.

| Adapter | Package | |---------|---------| | Preact | @flightdev/ui-preact | | Lit | @flightdev/ui-lit | | Marko | @flightdev/ui-marko | | Stencil | @flightdev/ui-stencil | | Mithril | @flightdev/ui-mithril | | Inferno | @flightdev/ui-inferno |

Tier 3: HTML-First

Server-rendered HTML with minimal JavaScript.

| Adapter | Package | |---------|---------| | HTMX | @flightdev/ui-htmx | | Alpine.js | @flightdev/ui-alpine | | Hotwire | @flightdev/ui-hotwire | | Stimulus | @flightdev/ui-stimulus | | Petite-vue | @flightdev/ui-petite-vue | | Vanilla | @flightdev/ui-vanilla |


Adapter Registry

The adapter registry provides dynamic loading and capability queries.

Registering Adapters

import { adapterRegistry, registerBuiltinAdapters } from '@flightdev/ui';

// Register all built-in adapters
registerBuiltinAdapters();

Getting Adapters

// Get adapter by name
const adapter = await adapterRegistry.get('react');

// Get adapter metadata
const metadata = adapterRegistry.getMetadata('vue');
console.log(metadata.tier);       // 'tier-1'
console.log(metadata.framework);  // 'vue'

Querying Capabilities

// List adapters by tier
const tier1 = adapterRegistry.listByTier('tier-1');
// ['react', 'vue', 'angular', 'svelte', 'solid', 'qwik']

// List adapters by capability
const streaming = adapterRegistry.listByCapability('streaming');
// ['react', 'vue', 'angular', 'solid', 'qwik', 'marko']

// Check if adapter has capability
const hasStreaming = adapterRegistry.hasCapability('react', 'streaming');
// true

Rendering

String Rendering

Render a component to an HTML string:

const result = await adapter.renderToString({
    component: App,
    props: { data },
});

console.log(result.html);            // Rendered HTML
console.log(result.hydrationData);   // State for client hydration
console.log(result.timing);          // Performance metrics

Streaming Rendering

For adapters with streaming support:

const { stream, done, abort } = adapter.renderToStream(
    { component: App, props: {} },
    { url: request.url },
    {
        onShellReady: () => {
            response.writeHead(200, {
                'Content-Type': 'text/html',
                'Transfer-Encoding': 'chunked',
            });
        },
        onError: (error) => {
            console.error('Render error:', error);
        },
    }
);

const reader = stream.getReader();
while (true) {
    const { done: readerDone, value } = await reader.read();
    if (readerDone) break;
    response.write(value);
}
response.end();

Hydration Scripts

Generate client-side hydration code:

const result = await adapter.renderToString({ component: App, props: {} });
const hydrationScript = adapter.getHydrationScript(result);

const html = `
<!DOCTYPE html>
<html>
<body>
    <div id="app">${result.html}</div>
    ${hydrationScript}
</body>
</html>
`;

API Reference

defineUI

Create a UI configuration object.

function defineUI(
    adapter: UIAdapterV2 | UIAdapterV1,
    options?: {
        streaming?: boolean;
        hydration?: 'full' | 'partial' | 'progressive' | 'none';
        islands?: boolean;
        defaultIslandStrategy?: IslandHydrationStrategy;
    }
): UIConfig;

renderPage

Render a component with the configured adapter.

function renderPage(
    config: UIConfig,
    component: Component,
    context?: RenderContext
): Promise<RenderResult>;

toHTML

Generate a full HTML document from a render result.

function toHTML(
    result: RenderResult,
    options?: {
        lang?: string;
        title?: string;
        meta?: Record<string, string>;
        charset?: string;
        viewport?: string;
    }
): string;

BaseUIAdapter

Base class for creating custom adapters.

import { BaseUIAdapter } from '@flightdev/ui';
import type { Component, RenderResult, RenderContext } from '@flightdev/ui';

class MyAdapter extends BaseUIAdapter {
    readonly id = 'my-adapter';
    readonly name = 'My Adapter';
    readonly framework = 'my-framework';
    readonly tier = 'tier-2' as const;

    async renderToString(
        component: Component,
        context?: RenderContext
    ): Promise<RenderResult> {
        // Implementation
    }

    getHydrationScript(result: RenderResult): string {
        // Implementation
    }

    getClientEntry(): string {
        // Implementation
    }
}

Documentation

For detailed documentation on each adapter and advanced patterns:


License

MIT