Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Ux Router Laravel Package

symfony/ux-router

Symfony UX Router brings Symfony routing to JavaScript, letting you generate URLs from route names and parameters, match current routes, and navigate client-side. It integrates with Turbo and Stimulus to eliminate hardcoded URLs in dynamic Symfony apps.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

What shipped in v3.6.0

  • feature #1234 — Add Symfony UX Router package: the package itself is new to the UX monorepo. Its purpose is to expose server-side route definitions to JavaScript, so front-end code can generate URLs by route name instead of hard-coding paths. This is the entire value proposition; everything else in the release is supporting work.
  • feature #4076 — Fall back to the application default locale: localized route generation now degrades to the app default locale instead of producing nothing or erroring when no locale is supplied. Removes a class of i18n edge-case defects.
  • bug #4082 — Dump routes when the container is built without a dump directory: fixes a build-time failure in environments where the route-dump path is absent or non-writable. This is the operationally significant line in the changelog.
  • minor #4086 — Tooling dependency updates: CI/lint housekeeping; no runtime surface.

Architecture fit

The first thing a TPM has to flag: this is not a Laravel package. symfony/ux-router is a Symfony UX component. It assumes Symfony's routing layer, the UX front-end conventions (Twig, AssetMapper or Encore, Stimulus/Turbo), and the Symfony container build lifecycle. The brief framed this as a "Laravel/PHP package," and that framing is wrong in a way that changes the recommendation — there is no Laravel service provider, no facade, no Blade directive, no published config. On a Laravel codebase the functional equivalent is Ziggy, which already occupies this niche and is Laravel-native. If the estate is Laravel, this release is not adoptable without a bridge we would have to own.

If the estate is Symfony (or mixed with a Symfony-owned front end), fit is good: the package is deliberately thin and sits on top of the router rather than replacing it.

Integration feasibility

  • Low integration cost inside Symfony — install, enable the bundle, dump routes at build, consume the generated JS. No schema, no persistence, no runtime service dependency in the request path.
  • Route dumping is coupled to container compilation. That coupling is the main feasibility constraint: it forces a decision about where the dump happens (build stage vs. container boot) and whether that path is writable.
  • The v3.6.0 bug fix implies teams were hitting the no-dump-directory case in real deployments, i.e. the naive setup does not survive read-only or slim production images.

Technical risk

  • Maturity: the package is newly introduced. Treat the JS-facing API as unstable for at least a couple of minor cycles, regardless of the 3.x version number (UX packages version in lockstep with the monorepo, so the major number overstates the package's own stability).
  • Naming/contract drift: route names become a cross-language contract. Renaming a Symfony route silently breaks JS callers with no compile-time signal. This is a genuine long-term maintenance tax, not a one-off setup cost.
  • Build coupling: route-dump failures are build failures. On a monorepo or a multi-tenant setup, one bad route definition can block every build.
  • Low blast radius otherwise: no data, no auth surface, no network calls. Worst case is broken links, not broken transactions.

Key questions to answer before committing

  1. Is the target codebase Symfony or Laravel? If Laravel — stop, evaluate Ziggy instead.
  2. Do we already generate front-end URLs some other way (hard-coded strings, a hand-rolled helper, Ziggy)? What is the migration cost of the contract change?
  3. Where does the container get built, and is the dump directory writable there? What happens in the read-only production image?
  4. How many locales are live, and does the new default-locale fallback match our intended SEO/canonical behavior?
  5. Who owns route naming as a public contract once JS depends on it?
  6. Is there an upgrade policy for a package that ships in lockstep with the UX monorepo?

Integration Approach

Stack fit

  • Symfony 6.4/7.x + UX front end (Twig + AssetMapper or Encore): natural fit, adopt within the normal dependency flow.
  • Symfony back end with a decoupled SPA (React/Vue via API): partial fit — route generation is useful only for the routes the SPA actually needs; most API URLs are better handled by an OpenAPI-generated client.
  • Laravel: not a fit. The nearest equivalent is Ziggy; do not attempt to port this package's internals into a Laravel app.
  • Mixed estate: viable only where the Symfony app owns the rendered front end.

Migration path

  1. Inventory existing front-end URL construction (grep for hard-coded paths and any helper functions). This defines the real scope — usually larger than expected.
  2. Introduce the package alongside the existing mechanism; dual-run. Do not delete the old path in the same change.
  3. Convert route-by-route, highest-traffic routes first, so regressions surface early.
  4. Decommission the old helper only after a full release cycle with no link-related incidents.

Compatibility

  • Requires a compatible Symfony routing/UX baseline; verify against the pinned Symfony version before scheduling.
  • Front-end build must be able to consume generated JS — AssetMapper or Encore, depending on the app's asset strategy.
  • Localized apps should verify the new default-locale fallback against current behavior, since it changes output for calls that previously omitted a locale.

Sequencing

  1. Spike (1–2 days): single route, generated in JS, validated in a staging build.
  2. Resolve the dump-directory question in CI and in the production image before widening adoption — this is the gate, not an afterthought.
  3. Pilot on one team/one feature area for a full release cycle.
  4. Roll out broadly; add a lint/test that fails the build when a JS-referenced route name no longer exists.
  5. Re-evaluate the package API at the next UX minor release; expect churn.

Operational Impact

Maintenance

  • Small dependency surface, but it tracks the UX monorepo release cadence, which is frequent. Budget a recurring (small) upgrade ritual rather than a one-time integration.
  • The route-name contract needs an owner. Without one, renames accumulate as silent breakage.
  • Route dump artifacts are build outputs — they need to be in the build cache key, or stale dumps will ship.

Support

  • Community-maintained, GitHub-issue-driven. No vendor SLA. Acceptable for a thin URL-generation utility; not acceptable if it becomes load-bearing for a revenue-critical flow without a fallback.
  • Internal knowledge will be concentrated in whoever does the spike — deliberately spread it.

Scaling

  • Scales well at runtime: generation is client-side string assembly from a dumped map; no per-request server cost.
  • The map grows with route count. Large apps should expect the dump to become a non-trivial bundle asset and consider scoping which routes are exposed.
  • Multi-tenant/multi-locale setups multiply the map; the default-locale fallback helps but does not eliminate the need to reason about which locale a link should carry.

Failure modes

  • Build failure, no dump directory — the exact defect fixed in #4082. Read-only or slim production images are the trigger. Mitigation: pin ≥3.6.0 and assert writability in CI.
  • Silent link breakage from route renames — no compile-time error. Mitigation: a route-name existence test.
  • Wrong locale in generated URLs — partially mitigated by #4076; still verify canonical/SEO behavior for the default-locale path.
  • Stale dump — artifact cached across a route change. Mitigation: include route files in the cache key.
  • Lockstep upgrade drag — a UX monorepo bump forces this package forward even when nothing relevant changed.

Ramp-up

  • Symfony-fluent engineers: under a day to first productive use; the concept is simple and the API is small.
  • Laravel-only engineers: effectively a new framework surface — days, not hours, and only worth it if the estate is moving to Symfony anyway.
  • The real ramp-up cost is organizational, not technical: agreeing the route-name contract and the build-time dump step.

TPM recommendation

Pin ≥3.6.0 if the stack is Symfony — the dump-directory fix removes a real deployment failure mode and the locale fallback removes a real i18n defect. If the stack is Laravel, this release does not change the assessment: it is not the right tool, and Ziggy remains the comparator. Either way, treat the package as early-stage and gate broad adoption behind the build-environment and route-name-contract questions above.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
cgv/localized-resource