lynx-stack

repository·main·Indexed 20 days ago

https://github.com/lynx-family/lynx-stack

The core Frontend stack for the Lynx ecosystem, providing essential tools and libraries including ReactLynx, Rspeedy, and Lynx for Web to enable high-performance cross-platform UI development. The stack includes utilities for error-remapping regression tests, asynchronous external bundle loading via @lynx-js/external-bundle-rsbuild-plugin, and the background-only marker package to enforce Background Thread context. It also features the A2UI Catalog Extractor CLI (@lynx-js/genui) for converting TypeScript component interfaces into A2UI component catalog JSON.

Tokens
256.6K
Snippets
819
Records
1.2K
Agent score
72%

What's inside lynx-stack

  1. Overview of @lynx-js/repl

    main

    The @lynx-js/repl is a pure-browser playground designed for experimenting with Vanilla Lynx. It allows users to write raw Element PAPI code and see real-time rendering without requiring a local toolchain, Node.js, or a compilation server.

    Because it runs entirely in the browser, it is ideal for learners, documentation examples, and quick experiments. However, it is intentionally limited to avoid overlapping with the full rspeedy dev toolchain.

  2. Overview of Testing Library for Lynx

    main

    The Testing Library for Lynx is a unit testing suite designed for the Lynx framework. It follows the same principles and patterns as the standard Testing Library, providing utilities to test components in a way that mimics user interaction.

    It is composed of two primary packages:

    1. @lynx-js/testing-environment: A Lynx-specific implementation of a DOM environment, serving as the equivalent to jsdom.
    2. @lynx-js/react/testing-library: A testing library specifically for React components running on Lynx, equivalent to @testing-library/preact.
  3. Overview of ReactLynx

    main

    ReactLynx is a framework designed to build cross-platform Lynx applications using the React paradigm. It is built on top of modern React implementations and is specifically optimized for the Lynx dual-threaded architecture to ensure instant launch and high UI responsiveness.

    Key features include:

    • React 17+ Alignment: Full support for functional components, Hooks, and Context.
    • Lynx Optimization: A dual-threaded React implementation tailored for Lynx's performance model.
    • Ecosystem Compatibility: Supports popular libraries such as Jotai, Zustand, and TanStack Query, along with Fast Refresh and React DevTools.
  4. Use the Lynx Rust engine bridge for headless environments

    main

    The lynx Rust crate is designed for embedding a prebuilt libLynx_clay runtime into non-windowed (headless) hosts. It allows you to drive Lynx tasks and input events without a standard windowing system.

    Key Capabilities:

    • Load a prebuilt libLynx_clay runtime from Rust.
    • Create headless Lynx views.
    • Provide windowless renderer callbacks.
    • Serve resources (bundles, images, fonts) from Rust via a GenericResourceFetcher.
    • Drive Lynx tasks and input events in a non-windowed host.
  5. Understand the Lynx Web Platform

    main

    The Lynx Web Platform is an implementation of Lynx's native binding APIs using Browser APIs. It aims to provide high-performance solutions with the same appearance and behavior as Lynx on Android and iOS, allowing for cross-platform consistency.

    Key Characteristics

    • Shared Logic: Your Lynx code, ReactLynx runtime code, and JavaScript-implemented Lynx APIs are shared across Web, Android, and iOS.
    • Rendering Pipeline: Unlike native platforms, the Web Platform utilizes the Browser's CSS engine, layout engine, and rendering engine. It uses DOM APIs for rendering, meaning the pixel/rendering pipeline is specific to the browser and does not match the native Android/iOS implementation.
    • UI Elements: While native platforms use platform-specific native elements, the Web Platform uses a set of custom elements to provide similar features.