Weave Code
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
Stimulus Bundle

Stimulus Bundle Laravel Package

symfony/stimulus-bundle

Symfony bundle that integrates Hotwired Stimulus into your app, wiring up controllers, auto-loading, and UX bridges with Symfony tooling. Ideal for adding modest JavaScript behavior to Twig and Symfony UX components without a heavy frontend setup.

Deep Wiki
Context7

symfony/stimulus-bundle integrates Hotwired Stimulus into Symfony applications, giving you a clean, convention-driven way to attach JavaScript behavior to your HTML without building a full SPA. It streamlines controller discovery and asset wiring so you can progressively enhance pages while staying aligned with Symfony UX tooling.

Use it to organize frontend interactions as reusable Stimulus controllers, loaded and configured automatically, with sensible defaults and first-class Symfony support.

  • Auto-registers Stimulus controllers from your project and vendor packages
  • Generates and manages the Stimulus bootstrap (loader) for your app
  • Integrates with Symfony asset tooling (Webpack Encore / AssetMapper)
  • Supports lazy-loading and controller configuration via controllers.json
  • Works seamlessly with Symfony UX components and progressive enhancement
Frequently asked questions about Stimulus Bundle
Can I use symfony/stimulus-bundle in Laravel for adding Stimulus.js controllers?
No, this package is explicitly designed for Symfony and won’t work in Laravel. Laravel’s architecture (Blade, service container, routing) is fundamentally different from Symfony’s, causing dependency conflicts and undefined behavior. You’ll need a Laravel-specific solution like `laravel-stimulus` or a custom Webpack setup.
What are the risks of trying to force symfony/stimulus-bundle into Laravel?
Major risks include runtime errors from missing Symfony services, broken asset compilation, and security vulnerabilities due to mismatched framework abstractions. The package relies on Symfony’s bundle system, configuration layers, and Twig integration—none of which exist in Laravel. Maintenance would require constant manual fixes, making it unsustainable.
Are there Laravel alternatives to symfony/stimulus-bundle for Stimulus.js?
Yes, consider `laravel-stimulus` or integrating Stimulus directly via Webpack Encore or Vite. These solutions are designed for Laravel’s ecosystem, supporting Blade templates, Laravel Mix, and Laravel’s service container without framework conflicts. They also align with Laravel’s progressive enhancement philosophy.
Will symfony/stimulus-bundle work with Laravel’s Blade templating?
No, this bundle is built for Twig and Symfony’s templating system. Blade and Twig have different syntax and rendering pipelines, so Stimulus controllers auto-registered by the bundle won’t function in Laravel. You’d need to manually wire controllers in Blade, which defeats the bundle’s automation benefits.
Does symfony/stimulus-bundle support Laravel’s asset pipelines (Mix/Vite)?
No, the bundle is tightly coupled with Symfony’s asset tooling (AssetMapper, Webpack Encore). Laravel’s asset pipelines (Mix, Vite) use different configuration structures and compilation processes, so the bundle’s auto-loading and asset wiring features won’t work. You’d need to manually configure Stimulus in Laravel’s pipeline.
Can I use symfony/stimulus-bundle alongside Laravel’s Symfony UX components?
No, Symfony UX components are designed for Symfony and rely on its ecosystem. The bundle and Symfony UX share dependencies and conventions that conflict with Laravel’s architecture. Instead, use Laravel’s native frontend tools like Livewire or Alpine.js, which are optimized for Laravel’s workflow.
How does symfony/stimulus-bundle handle controller auto-registration in Symfony?
The bundle auto-discovers Stimulus controllers in Symfony’s `src/Controller` and vendor directories, generating a `controllers.json` manifest for lazy-loading. Laravel lacks this directory structure and Symfony’s service autowiring, so the bundle’s auto-registration logic would fail entirely. You’d need to manually define controllers in Laravel.
Will symfony/stimulus-bundle work with Laravel’s service container?
Absolutely not. The bundle relies on Symfony’s dependency injection container, which is incompatible with Laravel’s container. Stimulus controllers would fail to resolve dependencies, and Symfony’s event system (used for asset management) wouldn’t integrate. Laravel’s container uses a different syntax and lifecycle.
Are there performance concerns with symfony/stimulus-bundle in Laravel?
Yes, even if you bypass compatibility issues, the bundle’s asset wiring and lazy-loading features would introduce overhead. Symfony’s asset pipeline is optimized for its framework, while Laravel’s pipelines (Mix/Vite) are streamlined for its architecture. Forcing the bundle into Laravel could slow down asset compilation and increase bundle size unnecessarily.
Where can I find Laravel-specific documentation for Stimulus integration?
For Laravel, start with the [Stimulus.js official docs](https://stimulus.hotwired.dev/) and explore packages like `laravel-stimulus` on GitHub. Laravel’s community also recommends custom Webpack/Vite setups for Stimulus, with examples in the [Laravel Mix documentation](https://laravel.com/docs/mix). Avoid Symfony-specific guides—they won’t apply.
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport