Commit Graph

5 Commits

Author SHA1 Message Date
b9e45afea0 Merge pull request #1 from kennethnym/add-example
Add example: Bun HTTP server showcasing jrx JSX-to-JSON rendering
2026-02-28 01:01:35 +00:00
e4d11b68c5 Fix null type error in Input registry component
Co-authored-by: Ona <no-reply@ona.com>
2026-02-28 01:00:31 +00:00
968faac7f5 Fix counter, add input binding, syntax highlighting, dark mode
- Fix increment button: custom action handler instead of no-op setState
- Toggle visibility on Show/Hide Details button via $cond
- Input uses $bindState + useBoundProp for two-way binding
- Add shiki syntax highlighting (catppuccin-latte/mocha dual theme)
- Dark mode via prefers-color-scheme with CSS variables
- Layout: Live UI left, JSX Source + JSON Output stacked right

Co-authored-by: Ona <no-reply@ona.com>
2026-02-28 00:56:59 +00:00
af85ad3b07 Add example: Bun HTTP server showcasing jrx JSX-to-JSON rendering
Bun React app with HMR that demonstrates jrx's render() pipeline.
Shows JSX source, live UI via @json-render/react, and JSON output
side by side.

- example/specs/simple.tsx: flat Stack > Text + Button
- example/specs/full.tsx: nested layout with state, events,
  visibility conditions, and watchers
- Uses defineCatalog + defineRegistry from @json-render/react
- Fix package.json exports to match actual tsup output (.js/.cjs
  instead of .mjs/.js)

Co-authored-by: Ona <no-reply@ona.com>
2026-02-28 00:48:37 +00:00
Kenneth Nym
f36256dda9 Initial implementation of jrx - JSX factory for json-render
JSX factory that compiles JSX trees into json-render Spec JSON.
Framework-agnostic custom jsx-runtime, no React dependency at runtime.

- jsx/jsxs/Fragment via jsxImportSource: "jrx"
- render() flattens JrxNode tree into { root, elements, state? } Spec
- Auto key generation (type-N) with explicit key override
- Full feature parity: visible, on, repeat, watch as reserved props
- Function components via component() or plain functions
- @json-render/core as peer dependency

Co-authored-by: Ona <no-reply@ona.com>
2026-02-27 00:31:52 +00:00