symfony/ux-live-component
Symfony UX Live Components let Twig components auto-update on the frontend as users interact, inspired by Livewire and Phoenix LiveView. Build reactive interfaces without writing JavaScript.
Architecture fit — poor for a Laravel codebase, strong for Symfony. symfony/ux-live-component is a Symfony UX package, not a framework-agnostic PHP library. It is the server-rendered, stateful-component model analogous to Livewire: a Twig component is dehydrated to the DOM, user interactions fire AJAX requests back to a Symfony controller, the component re-hydrates, re-renders, and the response is merged client-side via morphdom. That architecture is conceptually identical to Livewire, but every implementation dependency is Symfony-specific: TwigComponent, HttpKernel, the DI container, Serializer/PropertyInfo for LiveProp hydration, the routing import for /_components, and a Stimulus controller registered through assets/controllers.json (AssetMapper or Webpack Encore). None of that maps onto Laravel's container, Blade compiler, or Vite integration. There is no adapter path — using this in a Laravel app means running Symfony alongside Laravel.
Integration feasibility — feasible only as a second runtime, not as a package install. Two viable shapes: (a) a standalone Symfony service owning a slice of UI (forms, wizards, dashboards) embedded into the Laravel app via reverse proxy, iframe, or shared-session SSO; (b) a broader Symfony adoption where Live Components is one of several UX packages. Both carry real cost: dual auth/session bridging, dual asset pipelines, dual deploy cadence, and CORS/same-origin configuration because 3.x removed CSRF tokens and now relies on same-origin/CORS plus an X-Requested-With: XMLHttpRequest header check. If the estate is Laravel-only, the correct recommendation is Livewire, and this package should be scored as "reference architecture / competitive benchmark," not as a dependency. The 23.58 composite score and 0 dependents largely reflect that ecosystem mismatch, not package quality.
Technical risk — moderate-to-high, concentrated in version drift and security churn. Evidence from the changelog:
LegacyLivePropMetadata removed, PropertyInfo compat layer dropped). The 2.8 change to automatic serializer (de)hydration and to parent→child re-render semantics is the kind of break that silently changes behavior in production forms.symfony/ux. Operational consequence: you cannot watch this repo for triage signal, and your CVE response clock is tied to the monorepo's release train, not yours.Key questions to resolve before any commitment
Stack fit matrix
| Target stack | Fit | Notes |
|---|---|---|
| Symfony 7.4+ / PHP 8.4, Twig + AssetMapper | Strong | Native path; install bundle, import routes with /_components prefix, add live to assets/controllers.json |
| Symfony 6.x / 7.0–7.3 | Blocked on 3.x | Pin to a 2.x line and accept a maintenance branch |
| Laravel + Blade + Livewire | None | Duplicate concept, incompatible runtime; use Livewire |
| Laravel + Symfony sidecar | Conditional | Works only with explicit session/auth bridge and CORS design |
| Laravel + Twig via twigbridge | Not recommended | TwigComponent relies on Symfony DI, kernel events, and the Serializer; twigbridge gives you templating, not the component runtime |
Migration path
data-model), the code does not. Re-implement on the Symfony side, or keep the feature in Laravel.Compatibility checklist before first commit
prefix: /_components (the 2.6 change made the prefix mandatory).X-Requested-With: XMLHttpRequest present on all component requests (3.1 requirement) — check proxies and API gateways don't strip it.LiveProp holds Doctrine entities, confirm the serializer configuration — 2.8 made serializer (de)hydration opt-in via useSerializerForHydration: true.Sequencing
Maintenance. You inherit a dependency on a fast-moving monorepo release train with a documented history of BC breaks and security-driven behavior changes. Budget for a named owner who reads the Symfony UX changelog every release, plus a pinned minor version and a tested upgrade window. Because the repo is a read-only split, your team cannot patch locally upstream — you either vendor a fork (expensive) or wait for the monorepo.
Support. No commercial support tier; community channels only, with the Symfony core team as de facto maintainers and Mercure.rocks as sponsor. That is adequate governance for a low-criticality UI layer and inadequate for a revenue-critical checkout flow without a fallback path.
Scaling. The model is server-render-per-interaction. Each keystroke-with-data-model, action, and child-component update is an HTTP request that re-hydrates props, re-runs the component, and re-renders a template. Consequences: application servers, not CDNs, absorb interaction load; request payloads carry dehydrated prop state (large props mean large requests, partly mitigated by the 2.8 fingerprint performance fix); and the 2.5 batching change means concurrent interactions serialize into one request — better for consistency, worse for perceived latency on slow actions. Mitigations available in-package: loading="defer"|"lazy" (2.17), min_length/min_value input modifiers (2.28) to suppress unnecessary requests, and |norender on model updates.
Failure modes to instrument
typed to live in assets/controllers.json is a classic silent-no-op: page renders, nothing is interactive. Add a smoke test asserting interactivity, not just HTTP 200.X-Requested-With requirement breaks behind gateways that normalize headers.Ramp-up. A competent Laravel developer already holds the mental model (props, actions, server round trips) and will read Live Component templates fluently, since Twig and Blade are near-isomorphic for the constructs this package uses. The real cost is Symfony: container wiring, attribute-based configuration (#[AsLiveComponent], #[LiveProp]), the Serializer/Normalizer stack, and the AssetMapper pipeline — call it three to six weeks to first productive contribution and roughly a quarter to genuine ownership of a production surface. Add a half-day per developer on the morphdom/data-live-id and hydration-invalidation semantics, which are the non-obvious parts. If the team has no Symfony footprint whatsoever, that ramp cost should be weighed against simply using Livewire, which the team already knows.
How can I help you explore Laravel packages today?