symfony / ux

Symfony UX initiative: a JavaScript ecosystem for Symfony
https://ux.symfony.com/
MIT License
784 stars 274 forks source link

[LiveComponent] Separation of concerns #1817

Open Martin1982 opened 2 months ago

Martin1982 commented 2 months ago

After being introduced to the live-components there is one thing that struck me. When installing the package I have an entry in my package.json containing;

"@symfony/ux-live-component": "file:vendor/symfony/ux-live-component/assets",

Now when running my builds I need both Yarn and Composer on my front-end containers which increases the software dependencies and build times. It also requires more maintenance to keep this extra package version in line. I couldn't find this package on npmjs.com, which made me wonder. Am I using this wrong? Is this as designed? Or could this be improved?

smnandre commented 2 months ago

This is more a "StimulusBundle + Webpack" thing (i mean it's the case for all the UX packages) .. except if you use AssetMapper :)

More information about the process here: https://symfony.com/bundles/StimulusBundle/current/index.html#how-are-the-stimulus-controllers-loaded

You will probably find some ideas to do it manually (but you will need composer install at one time to fetch the assets)