Skip to content

[LiveComponent] Add StimulusBundle dependency #931

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

stof
Copy link
Member

@stof stof commented Jun 8, 2023

Q A
Bug fix? yes/
New feature? no
Tickets
License MIT

As this bundle implements its feature using stimulus, it should enforce that the bundle is available.

As this bundle implements its feature using stimulus, it should enforce that the bundle is available.
@weaverryan
Copy link
Member

Hey Stof!

There is no actual reference or usage of the Stimulus classes inside of LiveComponents. I agree that you'll need StimulusBundle in practice (because its recipe will set up the app for you), but I can't see where it's strictly required. Can you point?

Thanks!

@stof
Copy link
Member Author

stof commented Jun 8, 2023

The whole JS logic is implemented through a Stimulus controller: https://github.com/symfony/ux/blob/2.x/src/LiveComponent/assets/src/live_controller.ts

Without stimulus, the live component will not be live. This is exactly what has been reported by someone on Slack.

@stof
Copy link
Member Author

stof commented Jun 8, 2023

hmm, apparently, the min PHP version for StimulusBundle is higher than for other UX bundles. This does not help defining such dependencies.

@stof
Copy link
Member Author

stof commented Jun 8, 2023

Actually, many other UX packages are relying on Stimulus for their JS logic, so it might make sense for them to have this dependency as well.

@weaverryan
Copy link
Member

Hmm, I see. It’s weird to me to make a package like this rely on StimulusBundlewhen it doesn’t really need it (you could get stimulus running manually and it would work). In practice, that’s not actually doing to happen, so your PR would make life easier in practice.

@smnandre
Copy link
Member

Done in #1946

@smnandre smnandre closed this Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants