Skip to content

Turbo Bundle

Two small, framework-agnostic Hotwire Turbo helpers. A TypeScript lifecycle orchestrator for the browser and a frame-redirect listener for Symfony, each usable on its own.
Terminal window
composer require silarhi/turbo-bundle # PHP half
pnpm add @silarhi/turbo # JS half

The two halves solve different problems and only meet on redirect following: the server turns a frame redirect into a Turbo-Location header, the browser handler follows it.

One lifecycle hook pair

onMount / onUnmount run on Drive renders, frame loads and Stream mutations alike. TurboHandler

Morph-aware

Stream renders are diffed per node (mount wins, never a double mount); Drive, frame and stream morphs can opt into per-element refresh. Morph mutations

Frame-redirect following

A redirect inside a Turbo Frame becomes a full Drive visit instead of a frame swap, DELETE redirects too. Frame redirects

turbo_frame Twig filter

Extend a lean frame template only when the request targets a matching frame. The filter

Framework-optional

The bundle wires everything with zero configuration; the classes also work with Symfony components alone. Without the framework