Skip to content

[BootstrapAdminUI] Expose as ux bundle #362

Open
Jibbarth wants to merge 10 commits into
Sylius:mainfrom
Jibbarth:feature/asset-mapper
Open

[BootstrapAdminUI] Expose as ux bundle #362
Jibbarth wants to merge 10 commits into
Sylius:mainfrom
Jibbarth:feature/asset-mapper

Conversation

@Jibbarth
Copy link
Copy Markdown

Hello 👋

This is a draft/Poc to expose the BootstrapAdminUi as an Ux bundle, to let the app using asset-mapper/importmap importing dependencies.

It helps me to review symfony/symfony-docs#21292

It could fix #200. I tested to add a custom controller in assets/controllers and referencing it inside a template works well directly.

The scss to css move has been made by an AI, and it kinda work, except for the dark theme. But the toggler works :)

The benefits of this solution is that we do no longer have to build assets for bootstrap-admin-ui and version them in the public folder. It will be the final app that build things.

Let me know if there is any interests on this, to continue works.

We could at the end have a assetmapper config, beside to a webpack-encore config for users who prefer it.

@loic425
Copy link
Copy Markdown
Member

loic425 commented Apr 24, 2026

@Jibbarth This is very interesting, will you be able to finish this great work?

@Jibbarth Jibbarth marked this pull request as ready for review May 13, 2026 14:35
@Jibbarth
Copy link
Copy Markdown
Author

Hello @loic425, PR updated 😊

Let me know if you have any question

@Jibbarth Jibbarth force-pushed the feature/asset-mapper branch from 7e61e94 to b2715ab Compare May 13, 2026 15:03
Copy link
Copy Markdown
Author

@Jibbarth Jibbarth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self review 👀

import { Controller } from '@hotwired/stimulus';
import ApexCharts from 'apexcharts';

export default class extends Controller {
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could be lazy, as used only on dashboard page

Comment thread assets/admin_entry.js
@@ -0,0 +1,4 @@

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove empty line, or indicate this is for "demo" purpose (how to extend entrypoint)

Comment thread assets/app.js
@@ -1 +1,2 @@
import './scripts/statistics_chart.js';
// App entrypoint - Leave empty unless need to override entrypoint from BootstrapAdminUi
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 maybe remove this file, or use it instead admin_entry

Comment thread assets/controllers.json
@@ -0,0 +1,2 @@

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove empty line

Comment thread composer.json
"Sylius\\UiTranslations\\": "src/UiTranslations/src/"
}
},
"autoload": {},
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo: double check if we can keep the autoload here. I think it'll be simplier for IDE integration

"@popperjs/core": "^2.9.2",
"@tabler/core": "^1.4.0",
"@tabler/core/dist/css/tabler.min.css": "^1.4.0",
"apexcharts": "^4.4.0",
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this used by the bundle, or only by the app around ? I guess it could be drop 🤔

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be good to introduce a tool to check those dependencies, I asked Copilot and it seems to be able to do so and tell us what is realy used or not.
It can be introduced in another PR.

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.

[BootstrapAdminUi] Add custom stimulus controller

3 participants