Skip to content

[BootstrapAdminUi] Add an importmap_entrypoint option to replace the prebuilt Symfony UX assets - #416

Open
loic425 wants to merge 2 commits into
Sylius:mainfrom
loic425:feat/bootstrap-admin-ui-importmap-entrypoint
Open

loic425 wants to merge 2 commits into
Sylius:mainfrom
loic425:feat/bootstrap-admin-ui-importmap-entrypoint

Conversation

@loic425

@loic425 loic425 commented Nov 24, 2026

Copy link
Copy Markdown
Member

Based on #402: only the last commit belongs to this PR.

Using your own Stimulus application in the Bootstrap admin panel currently means disabling both symfony_ux hookables, adding a hookable and writing its template. This brings it closer to the Shadcn Admin UI, where the layout hookable takes an entrypoint configuration:

sylius_bootstrap_admin_ui:
    importmap_entrypoint: app
  • When set, both symfony_ux hookables get an entrypoint configuration: the stylesheets one loads the importmap in the <head> (no FOUC for the imported stylesheets), the javascripts one no longer starts the prebuilt Stimulus application.
  • It can also be set per hook with Twig Hooks (configuration: { entrypoint: 'app' }), like in Shadcn.
  • null by default: nothing changes for existing apps. The importmap() call lives in its own template, so apps without AssetMapper never compile it.
  • Only the hookable configuration is prepended: an enabled: false prepended by the bundle would be overridden by config/app.php, imported by the application.

…th AssetMapper

- Expose the copy-to-clipboard and theme-switcher Stimulus controllers to AssetMapper and add them to stimulus.controller_paths, like ShadcnAdminUi does
- Add a conflict on symfony/asset-mapper < 6.4, which stays optional
- Document the assets/controllers.json file and the assets/controllers/ directory required by StimulusBundle
- Load the importmap in the stylesheets hook to avoid a flash of unstyled content
- Add an Assets page to the Bootstrap Admin UI documentation
…prebuilt Symfony UX assets

- Add a "sylius_bootstrap_admin_ui.importmap_entrypoint" option, null by default
- When set, both symfony_ux hookables get an "entrypoint" configuration: the stylesheets one loads the importmap in the <head> and the javascripts one no longer starts the prebuilt Stimulus application
- Document the option instead of disabling the hookables by hand
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