Skip to content

Commit 6286ded

Browse files
committed
feat: Use tsparticles v3
1 parent 1be6b87 commit 6286ded

File tree

9 files changed

+3576
-1361
lines changed

9 files changed

+3576
-1361
lines changed

docs/content/1.getting-started/2.configuration.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ this option unless the [Total Blocking Time](https://web.dev/tbt/) web vital is
2929

3030
The `mode` option allows you to choose which bundle of the tsParticles library to use. The default value is `full`.
3131
`slim` uses the
32-
[`tsparticles-slim`](https://www.npmjs.com/package/tsparticles-slim)
32+
[`@tsparticles/slim`](https://www.npmjs.com/package/@tsparticles/slim)
3333
package, while `basic` uses the
34-
[`tsparticles-basic`](https://www.npmjs.com/package/tsparticles-basic)
34+
[`@tsparticles/basic`](https://www.npmjs.com/package/@tsparticles/basic)
3535
package. See their respective documentation for more information.
3636

3737
If you are not using certain advanced features of the tsParticles library, you may want to try out the `slim` or `basic`
@@ -67,7 +67,7 @@ component is rendered, you must manually initialize the tsParticles library (suc
6767
</template>
6868
6969
<script setup lang="ts">
70-
import { tsParticles } from 'tsparticles-engine'
70+
import { tsParticles } from '@tsparticles/engine'
7171
import { loadFull } from 'tsparticles' // or whichever bundle you wish to use
7272
7373
if (process.client) {
@@ -84,9 +84,9 @@ If bundle sizes are of the utmost importance, this is likely the best option for
8484
```vue
8585
<!-- ... -->
8686
<script setup lang="ts">
87-
import { tsParticles } from 'tsparticles-engine'
88-
import { loadStarShape } from 'tsparticles-shape-star'
89-
import { loadPolygonPath } from 'tsparticles-path-polygon'
87+
import { tsParticles } from '@tsparticles/engine'
88+
import { loadStarShape } from '@tsparticles/shape-star'
89+
import { loadPolygonPath } from '@tsparticles/path-polygon'
9090
9191
await loadStarShape(tsParticles)
9292
await loadPolygonPath(tsParticles)

docs/content/1.getting-started/3.faq.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
These are some frequently asked questions about the `nuxt-particles` module.
44

5-
## Why not use `vue3-particles`?
5+
## Why not use `@tsparticles/vue3`?
66

7-
The `vue3-particles` package (alias `particles.vue3`) is the first-party Vue 3 wrapper around the `tsParticles` library, but
7+
The `@tsparticles/vue3` package is the first-party Vue 3 wrapper around the `tsParticles` library, but
88
it has some flaws.
99

1010
The `tsParticles` library modifies the global scope upon initialization; it is not done on a per-component basis. Therefore,
1111
loading the provided component multiple times will cause a "flash" on all existing particle containers without complicated
1212
workarounds. This is an antipattern to Vue's isolated, component-based paradigm, and is therefore not ideal.
1313

14-
The component provided by this module solves this by keeping track of whether or not the library is initialized on a
14+
The component provided by this module solves this by keeping track of whether the library is initialized on a
1515
global level. If it has already been initialized, any subsequent component instances will not attempt to reload it.
1616
This is made possible using Nuxt's built-in `useState` composable.
1717

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,23 @@
4141
"lint": "eslint ."
4242
},
4343
"dependencies": {
44-
"@nuxt/kit": "^3.7.4",
45-
"defu": "^6.1.2",
46-
"tsparticles": "^2.12.0",
47-
"tsparticles-basic": "^2.12.0",
48-
"tsparticles-engine": "^2.12.0",
49-
"tsparticles-slim": "^2.12.0"
44+
"@nuxt/kit": "^3.11.1",
45+
"defu": "^6.1.4",
46+
"tsparticles": "^3.3.0",
47+
"@tsparticles/basic": "^3.3.0",
48+
"@tsparticles/engine": "^3.3.0",
49+
"@tsparticles/slim": "^3.3.0"
5050
},
5151
"devDependencies": {
5252
"@nuxt/devtools": "latest",
5353
"@nuxt/eslint-config": "^0.2.0",
54-
"@nuxt/module-builder": "^0.5.2",
55-
"@nuxt/schema": "^3.7.4",
56-
"@nuxt/test-utils": "^3.7.4",
54+
"@nuxt/module-builder": "^0.5.5",
55+
"@nuxt/schema": "^3.11.1",
56+
"@nuxt/test-utils": "^3.12.0",
5757
"@types/node": "^18.18.4",
5858
"changelogen": "^0.5.5",
59-
"eslint": "^8.51.0",
60-
"nuxt": "^3.7.4",
59+
"eslint": "^8.57.0",
60+
"nuxt": "^3.11.1",
6161
"vitest": "^0.34.6"
6262
}
63-
}
63+
}

playground/app.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919

2020
<script setup lang="ts">
2121
import { ref, useRuntimeConfig } from '#imports'
22-
import {loadFull} from 'tsparticles'
23-
import {tsParticles} from 'tsparticles-engine'
22+
import { loadFull } from 'tsparticles'
23+
import { tsParticles } from '@tsparticles/engine'
2424
2525
const { mode } = useRuntimeConfig().public.particles
2626

playground/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"private": true,
3-
"name": "my-module-playground",
3+
"name": "nuxt-particles-playground",
44
"type": "module",
55
"scripts": {
66
"dev": "nuxi dev",
77
"build": "nuxi build",
88
"generate": "nuxi generate"
99
},
1010
"devDependencies": {
11-
"nuxt": "latest"
11+
"nuxt": "^3.11.1"
1212
}
1313
}

0 commit comments

Comments
 (0)