Skip to content

Commit dfe969d

Browse files
committed
build: reordered bundles loading functions
1 parent ed45b4d commit dfe969d

4 files changed

Lines changed: 53 additions & 32 deletions

File tree

bundles/all/src/index.ts

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,6 @@ export async function loadAll(engine: Engine): Promise<void> {
191191
await loadFull(e);
192192

193193
await Promise.all([
194-
loadEmittersShapeCanvas(e),
195-
loadEmittersShapePath(e),
196-
loadEmittersShapePolygon(e),
197-
198194
loadHsvColorPlugin(e),
199195
loadHwbColorPlugin(e),
200196
loadLabColorPlugin(e),
@@ -220,7 +216,6 @@ export async function loadAll(engine: Engine): Promise<void> {
220216
loadBackgroundMaskPlugin(e),
221217
loadBlendPlugin(e),
222218
loadCanvasMaskPlugin(e),
223-
loadInfectionPlugin(e),
224219
loadManualParticlesPlugin(e),
225220
loadMotionPlugin(e),
226221
loadPoissonDiscPlugin(e),
@@ -235,11 +230,6 @@ export async function loadAll(engine: Engine): Promise<void> {
235230
loadExportJSONPlugin(e),
236231
loadExportVideoPlugin(e),
237232

238-
loadExternalParticleInteraction(e),
239-
loadExternalPopInteraction(e),
240-
loadLightInteraction(e),
241-
loadParticlesRepulseInteraction(e),
242-
243233
loadGradientUpdater(e),
244234
loadOrbitUpdater(e),
245235

@@ -275,5 +265,18 @@ export async function loadAll(engine: Engine): Promise<void> {
275265
loadSpiralShape(e),
276266
loadSquircleShape(e),
277267
]);
268+
269+
await Promise.all([
270+
loadExternalParticleInteraction(e),
271+
loadExternalPopInteraction(e),
272+
loadLightInteraction(e),
273+
loadParticlesRepulseInteraction(e),
274+
275+
loadInfectionPlugin(e),
276+
277+
loadEmittersShapeCanvas(e),
278+
loadEmittersShapePath(e),
279+
loadEmittersShapePolygon(e),
280+
]);
278281
});
279282
}

bundles/basic/src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ export async function loadBasic(engine: Engine): Promise<void> {
1919
{ loadHslColorPlugin },
2020
{ loadRgbColorPlugin },
2121
{ loadMovePlugin },
22+
2223
{ loadCircleShape },
24+
2325
{ loadFillColorUpdater },
2426
{ loadOpacityUpdater },
2527
{ loadOutModesUpdater },
@@ -29,7 +31,9 @@ export async function loadBasic(engine: Engine): Promise<void> {
2931
import("@tsparticles/plugin-hsl-color"),
3032
import("@tsparticles/plugin-rgb-color"),
3133
import("@tsparticles/plugin-move"),
34+
3235
import("@tsparticles/shape-circle"),
36+
3337
import("@tsparticles/updater-fill-color"),
3438
import("@tsparticles/updater-opacity"),
3539
import("@tsparticles/updater-out-modes"),

bundles/full/src/index.ts

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,44 +15,50 @@ export async function loadFull(engine: Engine): Promise<void> {
1515

1616
await engine.register(async e => {
1717
const [
18-
{ loadDestroyUpdater },
19-
{ loadRollUpdater },
20-
{ loadTiltUpdater },
21-
{ loadTwinkleUpdater },
22-
{ loadWobbleUpdater },
23-
{ loadTextShape },
18+
{ loadSlim },
2419
{ loadExternalTrailInteraction },
2520
{ loadAbsorbersPlugin },
2621
{ loadEmittersPlugin },
2722
{ loadEmittersShapeCircle },
2823
{ loadEmittersShapeSquare },
29-
{ loadSlim },
24+
{ loadTextShape },
25+
{ loadDestroyUpdater },
26+
{ loadRollUpdater },
27+
{ loadTiltUpdater },
28+
{ loadTwinkleUpdater },
29+
{ loadWobbleUpdater },
3030
] = await Promise.all([
31-
import("@tsparticles/updater-destroy"),
32-
import("@tsparticles/updater-roll"),
33-
import("@tsparticles/updater-tilt"),
34-
import("@tsparticles/updater-twinkle"),
35-
import("@tsparticles/updater-wobble"),
36-
import("@tsparticles/shape-text"),
31+
import("@tsparticles/slim"),
32+
3733
import("@tsparticles/interaction-external-trail"),
34+
3835
import("@tsparticles/plugin-absorbers"),
3936
import("@tsparticles/plugin-emitters"),
4037
import("@tsparticles/plugin-emitters-shape-circle"),
4138
import("@tsparticles/plugin-emitters-shape-square"),
42-
import("@tsparticles/slim"),
43-
]);
4439

45-
await loadSlim(e);
40+
import("@tsparticles/shape-text"),
41+
42+
import("@tsparticles/updater-destroy"),
43+
import("@tsparticles/updater-roll"),
44+
import("@tsparticles/updater-tilt"),
45+
import("@tsparticles/updater-twinkle"),
46+
import("@tsparticles/updater-wobble"),
47+
]);
4648

4749
await Promise.all([
50+
loadSlim(e),
51+
4852
loadDestroyUpdater(e),
4953
loadRollUpdater(e),
5054
loadTiltUpdater(e),
5155
loadTwinkleUpdater(e),
5256
loadWobbleUpdater(e),
5357

5458
loadTextShape(e),
59+
]);
5560

61+
await Promise.all([
5662
loadExternalTrailInteraction(e),
5763

5864
loadAbsorbersPlugin(e),

bundles/slim/src/index.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ export async function loadSlim(engine: Engine): Promise<void> {
1515

1616
await engine.register(async e => {
1717
const [
18+
{ loadBasic },
19+
1820
{ loadExternalParallaxInteraction },
1921
{ loadExternalAttractInteraction },
2022
{ loadExternalBounceInteraction },
@@ -29,19 +31,23 @@ export async function loadSlim(engine: Engine): Promise<void> {
2931
{ loadParticlesAttractInteraction },
3032
{ loadParticlesCollisionsInteraction },
3133
{ loadParticlesLinksInteraction },
34+
3235
{ loadEasingQuadPlugin },
36+
{ loadInteractivityPlugin },
37+
3338
{ loadEmojiShape },
3439
{ loadImageShape },
3540
{ loadLineShape },
3641
{ loadPolygonShape },
3742
{ loadSquareShape },
3843
{ loadStarShape },
44+
3945
{ loadLifeUpdater },
4046
{ loadRotateUpdater },
4147
{ loadStrokeColorUpdater },
42-
{ loadBasic },
43-
{ loadInteractivityPlugin },
4448
] = await Promise.all([
49+
import("@tsparticles/basic"),
50+
4551
import("@tsparticles/interaction-external-parallax"),
4652
import("@tsparticles/interaction-external-attract"),
4753
import("@tsparticles/interaction-external-bounce"),
@@ -56,23 +62,25 @@ export async function loadSlim(engine: Engine): Promise<void> {
5662
import("@tsparticles/interaction-particles-attract"),
5763
import("@tsparticles/interaction-particles-collisions"),
5864
import("@tsparticles/interaction-particles-links"),
65+
5966
import("@tsparticles/plugin-easing-quad"),
67+
import("@tsparticles/plugin-interactivity"),
68+
6069
import("@tsparticles/shape-emoji"),
6170
import("@tsparticles/shape-image"),
6271
import("@tsparticles/shape-line"),
6372
import("@tsparticles/shape-polygon"),
6473
import("@tsparticles/shape-square"),
6574
import("@tsparticles/shape-star"),
75+
6676
import("@tsparticles/updater-life"),
6777
import("@tsparticles/updater-rotate"),
6878
import("@tsparticles/updater-stroke-color"),
69-
import("@tsparticles/basic"),
70-
import("@tsparticles/plugin-interactivity"),
7179
]);
7280

73-
await loadBasic(e);
74-
7581
await Promise.all([
82+
loadBasic(e),
83+
7684
loadInteractivityPlugin(e),
7785

7886
loadEasingQuadPlugin(e),

0 commit comments

Comments
 (0)