- What does ruvents/frujax-bundle actually do?
- It is a Symfony bundle that adds server-side support for Frujax, a PJAX-style approach to AJAX-driven page navigation. Instead of returning a full HTML document on every request, your controllers can return just the partial fragment that changed, and the client swaps it into the page. The bundle is meant to wire this up with minimal configuration so you do not have to hand-roll request detection and partial rendering logic.
- Can I use ruvents/frujax-bundle in a Laravel application?
- No. It is built as a Symfony bundle and depends on Symfony's bundle registration, dependency injection container, and HTTP kernel request/response cycle, none of which exist in Laravel. If you are working in Laravel and want the same partial-navigation behaviour, look at Livewire, htmx, Laravel's Inertia adapter, or a PJAX/Turbo-style front end instead.
- How do I install ruvents/frujax-bundle with Composer?
- Install it with composer require ruvents/frujax-bundle and let Symfony Flex register the bundle if a recipe is available. On a non-Flex setup you add the bundle manually to config/bundles.php and clear the cache afterwards. Check the package's composer.json on GitHub or Packagist first, since the exact version constraint determines which Symfony releases you can pair it with.
- Which Symfony versions does ruvents/frujax-bundle support?
- The repository description does not pin a Symfony version range, so verify the symfony/* constraints in the package's composer.json before adopting it. Because small bundles like this are often not updated for every major release, confirm compatibility with your current Symfony version and with the next one you plan to upgrade to. If the constraints are loose or stale, test the upgrade on a branch before rolling it out.
- How does the bundle know a request is an AJAX or PJAX navigation?
- Frujax works by distinguishing navigation requests from normal full-page loads, typically via request headers sent by the client-side Frujax script. The bundle hooks into that signal so your controller can return a partial template rather than a layout-wrapped response. This keeps a single route serving both the initial page load and subsequent in-page transitions.
- Do I still need a JavaScript library on the front end?
- Yes. This package only provides the server-side half of the equation: detecting navigation requests and returning partial responses. The browser still needs the Frujax client script (or a compatible PJAX/Turbo-style library) to intercept links, fetch the fragment, swap the DOM container, and update the history API. Plan for both pieces before you start integrating it into a Symfony app.
- How do I test Frujax partial responses in a Symfony functional test?
- Use Symfony's WebTestCase and KernelBrowser, then send the same navigation header your front end sends so the request is treated as an AJAX transition. Assert that the response body contains your fragment markup but not the full layout chrome, such as the header or footer blocks. Add a second assertion for a plain request to confirm the full page still renders correctly.
- Is ruvents/frujax-bundle actively maintained and safe for production?
- Before committing, check the GitHub repository for recent commits, tagged releases, open issues, and whether pull requests are being merged. Packages of this size often see sporadic activity, so pin an exact version in composer.json and keep an eye on the Symfony major-version upgrades you depend on. If maintenance looks thin, weigh that risk against a more established alternative.
- What are the alternatives to Frujax for PJAX-style navigation in Symfony?
- Symfony UX Turbo is the most common first-party option and covers the same partial-page-swap ground with a larger community. htmx, Swup, and barba.js paired with server-rendered fragments are also widely used, and Hotwire/Turbo Drive works the same way. If you are evaluating from a Laravel background, the closest concepts are Livewire's partial updates and Inertia's page visits.
- Will partial responses break HTTP caching or reverse proxies?
- They can if a shared cache stores a fragment and then serves it to a full page load, or the other way around. Make sure the navigation header is part of your cache key strategy, for example by adding a Vary header for that request header, and keep the same URL returning both variants. Test through your proxy or CDN layer, not just locally, before shipping to production.