Skip to content

feat(examples): add full-stack OpenUI Lynx chat#778

Open
vishxrad wants to merge 3 commits into
mainfrom
visharad/lynx-openui-chat-example
Open

feat(examples): add full-stack OpenUI Lynx chat#778
vishxrad wants to merge 3 commits into
mainfrom
visharad/lynx-openui-chat-example

Conversation

@vishxrad

@vishxrad vishxrad commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a full-stack ReactLynx chat example using Lynx's official @lynx-js/genui OpenUI integration.
  • Render streamed OpenUI Lang with the matching Lynx component library.
  • Add a Next.js backend that builds the Lynx OpenUI system prompt, validates chat history, streams model output, and keeps provider credentials server-side.
  • Support native Lynx and Rspeedy web previews, LAN-aware backend discovery, multi-turn history, OpenUI actions, stop/clear controls, and fallback states.
  • Keep the shared examples CI unchanged on Node 20 by making the generic Lynx build native-only; retain build:all for the full Node 22 web/native build.
  • Document local setup, mobile previewing with Lynx Explorer, networking configuration, and production validation.
  • Link the example from the OpenUI documentation and adopters page.

Why

Lynx now officially supports OpenUI. This example provides an end-to-end reference comparable to the existing React Native example, showing how to connect a native ReactLynx chat shell, model streaming, and generative component rendering.

@lynx-js/genui@0.0.6 requires Node 22 for the full web/native build, while the repository's existing examples workflow intentionally runs on Node 20. Following the Vercel Eve harness pattern, the engine requirement remains explicit, the generic build exercises the Node-20-compatible native bundle, and build:all keeps the full Node 22 validation path.

Developer impact

Developers can clone the repository, configure an API key, and run a complete OpenUI-powered Lynx chat application on the web or a mobile device. The backend and renderer use the same @lynx-js/genui version, keeping the generated component contract aligned.

The composer uses Lynx's supported native input event bridge. This avoids the web preview's incomplete textarea element bridge, which prevented typed values from reaching ReactLynx state.

Validation

  • pnpm --filter openui-lynx check:all
  • pnpm --filter openui-lynx build:all
  • Frozen-lockfile install with CI's pnpm 9.0.6 under Node 20
  • Verified the shared CI build path produces the native Lynx bundle and Next backend under Node 20.20.2
  • Verified build:all produces web and native bundles plus the backend under Node 22.23.1
  • Manually verified typing and submission in the Rspeedy web preview
  • Manually verified a streamed model response renders as OpenUI components

Linear issue

@vishxrad vishxrad marked this pull request as ready for review July 15, 2026 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant