You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello Symfony Team and thanks for all your work, it's amazing !
I noticed that stimulus-bundle recipe adds lines in assets/bootstrap.js file and these differ depending on Composer dependencies.
{
"bundles": {
"Symfony\\UX\\StimulusBundle\\StimulusBundle": ["all"]
},
"add-lines": [
{
"file": "assets/bootstrap.js",
"content": "import { startStimulusApp } from '@symfony/stimulus-bridge';\n\n// Registers Stimulus controllers from controllers.json and in the controllers/ directory\nexport const app = startStimulusApp(require.context(\n '@symfony/stimulus-bridge/lazy-controller-loader!./controllers',\n true,\n /\\.[jt]sx?$/\n));",
"position": "top",
"requires": "symfony/webpack-encore-bundle"
},
{
"file": "assets/bootstrap.js",
"content": "import { startStimulusApp } from '@symfony/stimulus-bundle';\n\nconst app = startStimulusApp();",
"position": "top",
"requires": "symfony/asset-mapper"
},
]
}
I was wondering if it was possible to update the recipe to add content but this time the dependency would not be from the symfony/* namespace but pentatrion/vite-bundle ?
I am the maintainer of this bundle that allows to integrate Vite into a Symfony application. Vite natively uses ESM, the @symfony/stimulus-bridge package is only compatible with commonjs and cannot be used. (it uses require.context)
as an example I would like the symfony/stimulus-bundle recipe to make changes to the bootstrap.js file to make it look like this.
// assets/bootstrap.jsimport{startStimulusApp,registerControllers}from"vite-plugin-symfony/stimulus/helpers";constapp=startStimulusApp();registerControllers(app,import.meta.glob('./controllers/*_controller.js',{query: "?stimulus",/** * always true, the `lazy` behavior is managed internally with * import.meta.stimulusFetch */eager: true,}))
It's been about 1 year since I made Vite compatible with the stimulus-bundle ecosystem and Symfony UX and the integration is now stable.
Currently the whole thing works but it requires additional work from the developer. In order to improve the developer experience I would like to intervene on certain recipes.
So I would like to know if a PR from me could be accepted?
Hello Symfony Team and thanks for all your work, it's amazing !
I noticed that stimulus-bundle recipe adds lines in
assets/bootstrap.js
file and these differ depending on Composer dependencies.I was wondering if it was possible to update the recipe to add content but this time the dependency would not be from the
symfony/*
namespace butpentatrion/vite-bundle
?I am the maintainer of this bundle that allows to integrate Vite into a Symfony application. Vite natively uses ESM, the
@symfony/stimulus-bridge
package is only compatible with commonjs and cannot be used. (it uses require.context)the project documentation is here: https://symfony-vite.pentatrion.com
as an example I would like the symfony/stimulus-bundle recipe to make changes to the bootstrap.js file to make it look like this.
It's been about 1 year since I made Vite compatible with the stimulus-bundle ecosystem and Symfony UX and the integration is now stable.
Currently the whole thing works but it requires additional work from the developer. In order to improve the developer experience I would like to intervene on certain recipes.
So I would like to know if a PR from me could be accepted?
My request concerns
symfony/stimulus-bundle
: documentationsymfony/ux-react
,symfony/ux-vue
andsymfony/ux-vue
: documentationand the github: https://github.com/lhapaipai/symfony-vite-dev
Thank you and have a good evening
The text was updated successfully, but these errors were encountered: