tsparticles / vue3

Vue.js tsParticles official component
MIT License
106 stars 6 forks source link

fix: use event syntax for particlesLoaded #31

Closed Joepocalyptic closed 10 months ago

Joepocalyptic commented 10 months ago

Fixes #30.

Also cleaned up the two examples to remove dead code and use Nuxt best practices.

Joepocalyptic commented 10 months ago

Should be all set now. Sorry for the trouble; this is pretty much my first time contributing to an external project. 😅

matteobruni commented 10 months ago

Don't worry, these are mainly questions to understand what has been done, the changes were minor fixes, nothing to worry about since the project was building and running

matteobruni commented 10 months ago

I've changed the base branch, since this contains a breaking change and can't be released as a minor version. I have other plans for the major release as I said in the linked issue and this will be released there too.

Joepocalyptic commented 10 months ago

Perfect, thank you!

Joepocalyptic commented 10 months ago

On the topic of the next major release, maybe it could be implemented with Vue Demi as opposed to having two separate repositories for Vue 2 and 3? That'd be much easier to maintain if you don't plan on dropping the Vue 2 release once it goes EOL.

matteobruni commented 10 months ago

Didn't know about this project, this is very interesting and could be good for the next major release. Instead of having @tsparticles/vue2 @tsparticles/vue3 packages, only @tsparticles/vue package could exist.

Joepocalyptic commented 10 months ago

I managed to write a proof-of-concept with this PR as a base using vue-demi (I've been meaning to experiment with it regardless): https://github.com/Joepocalyptic/vue-particles/tree/main/packages/vue-particles

Apparently vue-demi works by adjusting which functions to use based on the user's environment; what this means is that you actually can't precompile the SFC since it needs to go straight through the user's build pipeline (e.g. Vite).

I replaced the Vite bundler with unjs/unbuild configured to simply copy the Vue SFC in-place. This is actually how most Vue component libraries work nowadays, regardless.

matteobruni commented 10 months ago

Really nice, if you want to submit a PR targeting the dev branch, you're welcome to do it, and thanks for the suggestion anyway.