Joepocalyptic / nuxt-particles

Run lightweight, heavily customizable particle simulations in your Nuxt project with tsParticles.
https://nuxt-particles.joeypereira.dev
MIT License
29 stars 3 forks source link

fix: opt in to `import.meta.*` properties #17

Closed danielroe closed 3 months ago

danielroe commented 3 months ago

This is a very early PR to make this module compatible with changes we expect to release in Nuxt v5.

In Nuxt v3.7.0 we added support for import.meta.* (see original PR) and we've been gradually updating docs and moving across from the old process.* patterned variables.

As I'm sure you're aware, these variables are replaced at build-time and enable tree-shaking in bundled code. This change affects runtime code (that is, that is processed by the Nuxt bundler, like vite or webpack) rather than code running in Node. So it really doesn't matter what the string is, but it makes more sense in an ESM-world to use import.meta rather than process.

(It might be worth updating the module compatibility as well to indicate it needs to have Nuxt v3.7.0+, but I'll leave that with you if you think this is a good approach.)

netlify[bot] commented 3 months ago

Deploy Preview for nuxt-particles ready!

Name Link
Latest commit 5e07c8aca7fee9011e74c2d4b208395b79b17290
Latest deploy log https://app.netlify.com/sites/nuxt-particles/deploys/660181238c6ca70009858e67
Deploy Preview https://deploy-preview-17--nuxt-particles.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Joepocalyptic commented 3 months ago

Thanks so much, Daniel! Looks good to me.

I think the best way forward is to set a version constraint for Nuxt v3.7.0; anyone using an earlier version can stay on the module version v0.2.0.