survos/js-twig-bundle
A Symfony bundle from Survos that streamlines integrating JavaScript into Twig templates, with helpers and configuration for managing scripts, assets, and dynamic front-end behavior alongside your Twig views.
path(), stimulus_* and ux_icon helpers. Product implication: partial-refresh and interactive flows (search filters, pagination, modals, inline edits) can reuse the exact markup already approved for server rendering instead of a second JS template set. Scope decisions should assume "one template, two renderers" — that is the core value proposition, and it shrinks the surface of any UI feature that needs to be re-rendered without a full page load.Consider adoption when:
Look elsewhere when:
For executives: This is a small integration bundle that would let us render the same Twig templates in the browser that we already render on the server, so interactive features stop requiring a second copy of the markup and a separate JavaScript build pipeline. The strategic value is optionality: it lets us add responsiveness to the existing server-rendered product without committing to a single-page-app rewrite. The risk side is maturity — the project has no meaningful community traction, one ecosystem's worth of maintenance, and a recent release whose only note describes a workaround ("hack") rather than a feature. Recommendation: fund a time-boxed pilot on one or two interactive surfaces, keep it out of critical paths, and hold a decision point comparing it against a small internal helper. It is not core infrastructure.
For engineering: Adopt only if we are on Symfony with Twig, AssetMapper and Stimulus already in use. Pin the version, read the diff for the 1.6.0 "remove dumps" hack since it indicates the codebase carries debug residue and unreviewed workarounds, and confirm PHP/Symfony constraints in composer.json before upgrading. Prioritize two validation tasks: (1) an escaping/XSS comparison between server Twig and Twig.js for any user-supplied values passed through path(), stimulus_* and ux_icon; (2) a feature-parity check on the specific templates we intend to share, since unsupported filters or macros fail silently at runtime rather than at build time. Without a build step, asset and cache behavior differs from our usual pipeline — expect debugging friction. Keep the fallback documented up front: JSON endpoints plus small client-side templates, or a thin in-house render helper, so a maintenance stall is a contained cost rather than a blocked roadmap item.
How can I help you explore Laravel packages today?