Skip to content

[ShadcnAdminUi] Only configure StimulusBundle when it is enabled - #414

Closed
loic425 wants to merge 1 commit into
Sylius:mainfrom
loic425:fix/shadcn-stimulus-bundle-guard
Closed

loic425 wants to merge 1 commit into
Sylius:mainfrom
loic425:fix/shadcn-stimulus-bundle-guard

Conversation

@loic425

@loic425 loic425 commented Nov 23, 2026

Copy link
Copy Markdown
Member

SyliusShadcnAdminUiBundle prepends stimulus.controller_paths whenever AssetMapper is available, without checking that StimulusBundle is enabled. symfony/stimulus-bundle is required by the package, but if the bundle is missing from config/bundles.php, the container compilation fails with:

There is no extension able to load the configuration for "stimulus"

  • Only prepend the stimulus configuration when StimulusBundle is in kernel.bundles.
  • The asset_mapper path is still exposed, so the theme stylesheet keeps working.
  • Add a unit test for both cases.

Same guard as in the BootstrapAdminUi auto-registration (#402).

@loic425
loic425 force-pushed the fix/shadcn-stimulus-bundle-guard branch from 078c8bd to 6c62060 Compare November 23, 2026 15:25
@loic425

loic425 commented Nov 25, 2026

Copy link
Copy Markdown
Member Author

Closing: this guard fixes nothing. Prepending a configuration for an extension that is not registered does not break the container compilation; Symfony only throws "There is no extension able to load the configuration" when loading a config file (or through ContainerConfigurator::extension()), not for prependExtensionConfig(). Besides, without StimulusBundle the admin already fails on stimulus_controller() in the templates, so there is no real case to protect.

@loic425 loic425 closed this Nov 25, 2026
@loic425
loic425 deleted the fix/shadcn-stimulus-bundle-guard branch November 25, 2026 08:03
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.

1 participant