LottieFiles / dotlottie-web

Official LottieFiles player for rendering Lottie and dotLottie animations in the web. Supports React, Vue, Svelte, SolidJS and Web Components.
https://developers.lottiefiles.com/docs/dotlottie-player/
MIT License
193 stars 11 forks source link

feat: 🎸 freezeOnOffscreen render config #297

Closed theashraf closed 3 months ago

theashraf commented 4 months ago

Related to #277

changes: Introduce freezeOnOffscreen render configuration for:

This auto freezes and unfreezes the animation when it's offscreen and not visible to the user, saving resources by stopping the animation loop when it's not in view.

changeset-bot[bot] commented 4 months ago

🦋 Changeset detected

Latest commit: bfb189168517e0f1eaa834190bc6802f96028d7d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages | Name | Type | | ----------------------------- | ----- | | @lottiefiles/dotlottie-web | Minor | | @lottiefiles/dotlottie-react | Patch | | @lottiefiles/dotlottie-solid | Patch | | @lottiefiles/dotlottie-svelte | Patch | | @lottiefiles/dotlottie-vue | Patch | | @lottiefiles/dotlottie-wc | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

github-actions[bot] commented 4 months ago

Coverage Report for @lottiefiles/dotlottie-web (packages/web)

Status Category Percentage Covered / Total
🟢 Lines 54.6% / 30% 540 / 989
🟢 Statements 53.27% / 30% 562 / 1055
🟢 Functions 55.42% / 30% 143 / 258
🟢 Branches 58.62% / 30% 367 / 626
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
packages/web/src/dotlottie.ts 72.65% 64.95% 69.76% 75.4% 134, 138-141, 166, 207-209, 211, 246, 254, 299, 322, 326, 407, 423, 427, 456, 471-472, 487, 509-512, 545, 550, 560, 588, 588, 590-593, 597, 602-605, 612, 612, 614-617, 621, 621, 623-626, 693, 693, 695-698, 702, 752, 779, 783, 793, 803, 803, 805-811, 815, 825, 829, 831-833, 832, 835, 839, 841-843, 842, 845, 849-851, 853-855, 857-860, 864, 866, 870, 872, 876, 878, 882, 884, 888, 890, 894, 903, 905-911, 906-911, 908-911, 910, 913, 917, 917, 919, 921, 923-925, 923-924, 927, 931-957, 932, 934-936, 935, 938-940, 939, 942-944, 943, 946-948, 947, 950-952, 951, 954-956, 955, 972, 976-977, 979-982, 986, 990, 994
packages/web/src/offscreen-observer.ts 100% 90% 100% 100%
packages/web/src/utils.ts 100% 85% 100% 100%
packages/web/src/worker/dotlottie.ts 63.02% 62.01% 70.27% 68.62% 14, 243, 261, 322, 382, 387, 394, 401, 401, 403-404, 408, 422, 422, 424-425, 429, 461, 461, 463-464, 468, 478, 485, 485, 487-488, 492, 492, 494, 496-497, 518, 525, 532, 532, 534-535, 539, 546, 546, 548-549, 565, 572, 582, 609, 633, 633, 635, 637, 639, 643, 643, 645, 647, 649, 653, 653, 655, 657, 659, 661, 665, 665, 667, 669, 673, 673, 675, 679, 679, 681, 685-687, 689-691, 693-696, 700, 702, 706, 708, 712, 714, 718, 720, 724, 726, 730, 734-760, 735, 737-739, 738, 741-743, 742, 745-747, 746, 749-751, 750, 753-755, 754, 757-759, 758
Generated in workflow #1274
github-actions[bot] commented 4 months ago

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
@lottiefiles/dotlottie-web 38.45 KB (+2.51% 🔺) 770 ms (+2.51% 🔺) 2.9 s (+156.12% 🔺) 3.7 s
@lottiefiles/dotlottie-web WASM 386.62 KB (0%) 7.8 s (0%) 0 ms (+100% 🔺) 7.8 s
@lottiefiles/dotlottie-react 42.12 KB (+1.79% 🔺) 843 ms (+1.79% 🔺) 1.7 s (-8.41% 🔽) 2.5 s
@lottiefiles/dotlottie-vue 45.43 KB (+1.91% 🔺) 909 ms (+1.91% 🔺) 3.1 s (+39.91% 🔺) 4 s
@lottiefiles/dotlottie-wc 45.83 KB (+2.07% 🔺) 917 ms (+2.07% 🔺) 2 s (+14.96% 🔺) 2.9 s
@lottiefiles/dotlottie-svelte 46.32 KB (+1.96% 🔺) 927 ms (+1.96% 🔺) 1.6 s (+17.79% 🔺) 2.5 s
@lottiefiles/dotlottie-solid 45.21 KB (+1.94% 🔺) 905 ms (+1.94% 🔺) 1.1 s (-21.42% 🔽) 2 s