Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a bundle #12

Closed
reyostallenberg opened this issue Mar 22, 2021 · 4 comments
Closed

Create a bundle #12

reyostallenberg opened this issue Mar 22, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@reyostallenberg
Copy link

Can I help somehow to create a bundle of this? So you can install it in an existing app

@k3ssen
Copy link
Owner

k3ssen commented Mar 23, 2021

Certainly! I initially created this repository as an example/concept, but if it helps anyone I'd love to see a bundle created out of it :D
I had the intention to do it myself, but I kinda kept postponing it, so any input would be helpful.

I did apply this repository in some small projects to find some edge-cases and bugs. My hopes were that I could apply this repository to some larger new project in order to have it more thoroughly tested, but so far I didn't had the chance to do so.
If this would be converted to a bundle I'm not confident (yet) it would sufficiently fit the need for most people. When someone installs this as a bundle, he/she will probably want to have the ability to override certain parts. Symfony services can be overwritten fairly easy, but I image this is going to be a bit more tricky for Vue components. Any ideas are very much appreciated.

@reyostallenberg
Copy link
Author

So now I have to find some time :(

I agree the hardest part would be override certain parts of the Vue components, we'll see

@k3ssen
Copy link
Owner

k3ssen commented Apr 4, 2021

Having an Eastern-weekend and louzy weather are the perfect conditions for making a start with this :)

I barely had any experience with using assets inside a vendor-bundle, so I was afraid I would hit a wall there and would need to pre-build stuff that would be included by using something like assets:install. I think that would be terrible, since there wouldn't be any flexibility.

As it turns out, if there's a Resources/assets/package.json in a vendor-bundle, a reference will automatically be added to the package.json in the root after installing the bundle with composer (probably because of webpack-encore). And after running yarn install it will actually create a node_module out of the Resources/assets. This might be common knowledge, but I haven't stumbled upon this before, so I find this really cool.
This'll enable users to choose how they want to implement things in a fairly easy way.

For now I created a bundle-version of this project in https://github.com/k3ssen/SymfonyVuetified/tree/bundle

Unfortunately, using Vue, Vuetify and Typescript in a Symfony-project requires quite a few file-modifications, which results in a lengthy 'getting started' guide. I've added a command for making some automatic file-changes possible, but that should only be suitable for new projects.

I need to do some more testing (and hopefully find some time to write some automated tests) and add the bundle to packagist, but at least I made it work in this demo: https://github.com/k3ssen/SymfonyVuetified/tree/demo

@k3ssen
Copy link
Owner

k3ssen commented Apr 5, 2021

I've added this repo to packagist. merged the bundle-branch into master and tagged it, so it can now be installed as bundle into existing symfony projects.

As for overwriting/overriding stuff: there are improvements to be made in this area, but at least Symfony makes it do-able to override services. For now the vue components are made globally available, which makes them quite easy to overwrite.

@k3ssen k3ssen added the enhancement New feature or request label Apr 25, 2021
@k3ssen k3ssen closed this as completed Jun 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants