Ripple UI Framework

repository·main·Indexed 27 days ago

https://github.com/ripple-ts/ripple

A TypeScript-first UI framework centered around .tsrx files, featuring fine-grained reactivity, scoped styles, and a small runtime. It combines JSX developer experience with template-native control flow. The ecosystem includes @ripple-ts/tree-sitter for parsing support and @ripple-ts/adapter-bun for serving metaframework apps.

Tokens
72.2K
Snippets
225
Records
472
Agent score
91%

What's inside Ripple

  1. Overview of @ripple-ts/adapter

    main
    The @ripple-ts/adapter package provides shared adapter primitives, runtime helpers, and type contracts used by Ripple metaframework environment-specific adapters. It is designed to be used by developers building or extending adapters for runtimes such as Node.js (@ripple-ts/adapter-node) or Bun (@ripple-ts/adapter-bun).
  2. Introduction to Ripple

    main
    Ripple is a compiler-driven language and UI framework built on TSRX (a superset of TypeScript). It uses a .tsrx syntax that provides a JSX-like templating language with a declarative blend of structure and control flow. Ripple is designed for high performance, fine-grained rendering, and low memory usage, while offering full TypeScript, Prettier, and ESLint support for .tsrx modules.
  3. Key Features of Ripple

    main

    Ripple provides several core capabilities for building modern UIs:

    • Reactive Primitives: Built-in reactivity via track and &[] lazy destructuring.
    • Reactive Objects: Support for fully reactive arrays and objects using RippleArray and RippleObject.
    • Component-Based Architecture: Reusable components with props and children.
    • Statement Containers: Use @{...} for local setup within components.
    • Performance: Fine-grained rendering with optimized bundle size and memory usage.
    • Developer Experience: Full TypeScript integration, VSCode support (diagnostics, syntax highlighting, IntelliSense), and default support for Prettier and ESLint for .tsrx modules.
  4. Explore the Ripple ecosystem of libraries

    main

    Ripple has an ecosystem of community-driven libraries for common tasks such as routing, UI components, charting, and state management.

    Warning: Ripple is currently not production-ready. It may undergo breaking changes at any time. Use these libraries for exploration and building use-cases, but do not rely on them for production environments.

  5. Compare Ripple to Svelte

    main

    When comparing Ripple to Svelte, note the following distinctions:

    • Type Safety: Ripple follows a TypeScript-first approach.
    • Syntax: Ripple uses a JSX-like syntax rather than Svelte's HTML-based templates.
    • File Structure: Ripple allows for multiple components within a single file.
    • Reactivity: While reactivity concepts are similar, the syntax implementation differs.
  6. Explore Ripple ecosystem libraries

    main

    The Ripple ecosystem includes several community-driven libraries for routing, UI components, charts, and state management.

    Warning: Ripple is currently not production-ready and may undergo breaking changes at any time. Use these libraries for exploration and development, but avoid relying on them for production environments.

  7. Understand recursive-context benchmark measurements

    main

    The benchmark evaluates performance across six specific operations designed to stress component overhead, context lookup, and DOM reconciliation:

    • MOUNT: Measures the time to go from an empty DOM to a fully painted tree (exercises creation and subscription).
    • UPDATE_ROOT: Mutates the root context value, forcing every leaf to re-read (exercises lookup and re-rendering).
    • UPDATE_PARTIAL: Mutates state on a mid-node (depth 5), affecting only its 32 descendant leaves (tests scoped updates).
    • PARTIAL_UNMOUNT: Toggles a visible flag on a mid-node to drop its subtree (exercises per-block teardown).
    • PARTIAL_REMOUNT: Flips the visible flag back on to reconstruct the subtree (exercises scoped mounting).
    • UNMOUNT: Performs a full teardown via the framework's unmount API.
  8. Compare Ripple to React

    main

    Ripple differs from React in several key architectural and syntactical ways:

    • Control Flow: Instead of using wrapper components for logic, Ripple templates support inline directives like @if, @for, @switch, and @try.
    • Reactivity: Uses built-in reactivity via track() and &[] (lazy destructuring) instead of the useState/useEffect pattern.
    • Styling: Supports scoped CSS natively without requiring CSS-in-JS libraries.
    • Rendering: Uses fine-grained reactivity instead of a Virtual DOM.
  9. Deploy the TSRX MCP Endpoint

    main

    The TSRX MCP Endpoint is a deployment-neutral HTTP endpoint designed for remote MCP clients that support Streamable HTTP. It is mounted at /mcp and provides @tsrx/mcp functionality in a remote-safe mode.

    Remote Mode Capabilities:

    • Documentation
    • Prompts
    • Formatting
    • Compilation
    • Diagnostic analysis tools

    Note: Remote mode omits local filesystem/project tools such as inspect-project, detect-target, and validate-tsrx-file.

    To integrate with a custom HTTP runtime, you can import handleRequest from src/handler.js and adapt it to your environment.

  10. Compare Ripple to Solid

    main

    Ripple shares some similarities with Solid but introduces specific features:

    • Component Model: Components are ordinary functions that return TSRX.
    • Collections: Includes built-in reactive collections such as RippleArray and RippleSet.
    • Control Flow: Returned templates support directive-style control flow.
  11. Understand @tsrx/core limitations

    main

    When using @tsrx/core, keep in mind the following non-goals:

    • No runtime code emission: @tsrx/core does not emit runtime code; code generation is handled by framework-specific packages like @tsrx/ripple.
    • No runtime: This package does not include reactivity, rendering, or DOM code.
    • Format agnostic: It does not lock consumers to a specific output format, allowing multiple compile targets to share the same parser and analysis.