Skip to content

devarda/react-blitz-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React on Blitz

A React 18 + TypeScript app that runs on Blitz's experimental JavaScript engine (blitz-script, the Boa-based engine from the js-engine branch / DioxusLabs/blitz PR #491) — no Chromium, no WebKit, no webview.

It exercises the interactive-app contract end to end:

  • Card flip on click (CSS transition, 2D scaleX fallback — no 3D transforms yet)
  • :hover states on list items and buttons
  • "Load more" list (paged state updates)
  • Controlled filter input (typing re-renders the filtered list, with an empty state when nothing matches)
  • Viewport readout from window.innerWidth/innerHeight at mount

Running it

The app is prebuilt: dist/{index.html,bundle.js} are committed, so you don't need node to run it.

It needs a few small DOM additions on top of the js-engine branch (classList, closest, dataset, hidden, innerWidth/innerHeight, DOM interface constructors, getModifierState, selectionStart/End, window-event dispatch), plus an event-driver fix so macOS editing keybindings (Backspace etc.) dispatch input events — available as a patch series on the react-dom-apis branch.

git clone --branch react-dom-apis https://github.com/devarda/blitz.git blitz
cd blitz
cargo run --release --example preact_script ../react-blitz-demo/dist/index.html

(preact_script is the tree's script-enabled viewer example — it loads any HTML file with blitz-script active.)

Rebuilding the bundle

Only needed when src/ changes (requires node):

bash build.sh   # tsc --noEmit + esbuild -> dist/bundle.js

About

React 18 running on Blitz's experimental blitz-script JS engine (Boa) — no Chromium, no WebKit, no webview

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages