Reference
Runtime Model
Understand how RGX reuses one browser instance, turns requests into fragments, and dispatches updates.
One shared instance
RGX is designed to be mounted once per page. `Recyclr.mount(document)` can delegate clicks and submits from the document root without stacking controllers or listeners.
The Stimulus wrapper remains available as an adapter, but the runtime itself is not tied to it.
const Recyclr = require('recyclrjs');
Recyclr.mount(document);
Request lifecycle
A request follows the same short path every time: fetch the page, parse the response, evaluate the swap rules, render the fragment, then dispatch an update event.
- Fetch HTML from a normal server route.
- Parse response markup with `DOMParser`.
- Extract one or more fragments from the response.
- Swap the target regions and keep browser history in sync.
Loading and busy states
Loading, disabled, and background states are built into the runtime so the shell feels deliberate instead of flickery.
That keeps the browser polite during slower requests and gives the site room to show progress indicators when it matters.