Search by

omnibridge / react

GlitchArt

A page of a site as a React component and its props, the same from any framework: the first visit an HTML shell holding the page, a visit within the site the page in JSON (header X-Omnibridge), the JavaScript side rendering it and following the site's links without reloading.

1.x-dev 2026-10-17 09:33 UTC

This package is auto-updated.

Last update: 2026-10-17 12:28:28 UTC


README

A page of a site as a React component and its props, the same from any framework (plan 0, rule 13). Symfony and Laravel give the page alike; React renders it.

  • PHP (Omnibridge\React, framework-free): Page (component, props, url, version) and Protocol::answer(). The first visit is an HTML shell holding the page (data-page on the root element); a visit within the site (header X-Omnibridge) gets the page in JSON; a front end of another version reloads (409, X-Omnibridge-Location). The application turns the answer into its own response, its shell around the root element.
  • JavaScript (js/, @omnibridge/react, plain ES modules): createApp() renders the page of the shell, Link and the links of the page under the prefix are followed without reloading (visit()), back and forward restore the pages seen, fetchPage() asks a page without showing it (a feed's next batch), usePage() reads the page shown.

lesringostars uses it for its blog and its articles, given by its Symfony site and by its Laravel copy from the same screens (lesringostars-react).

Tests

docker run --rm -v "$PWD":/app -w /app lesringostars-laravel-app vendor/bin/phpunit tests