-
-
Couldn't load subscription status.
- Fork 13
lottie: Support configurable preset-players #137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
1f0a789 to
88da68d
Compare
88da68d to
b3b2b8b
Compare
|
Vercel build is just due to break change of wasm url path. We can ignore until we release preset package. |
b3b2b8b to
83959ce
Compare
1. Common TestCDN environment:
NPM environment:
2. Regression Test
3. Module bundler compatibility
4. Framework compatibility
|
bb23c44 to
919de7e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces configurable preset players for the ThorVG Lottie Player, allowing developers to choose optimized builds based on their specific use case requirements. The implementation provides four distinct variants: standard and lite versions for both software and OpenGL renderers.
Key changes include:
- Added preset-based build system with four variants (sw, gl, sw-lite, gl-lite)
- Refactored codebase into base player class with preset-specific implementations
- Updated build process to generate multiple WASM builds with different loader configurations
Reviewed Changes
Copilot reviewed 17 out of 18 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
wasm_setup.sh |
Orchestrates building all WASM variants with different configurations |
wasm_build.sh |
Handles preset-specific WASM compilation with different loader options |
src/base-player.ts |
Core player functionality extracted into reusable base class |
src/lottie-preset-player.ts |
Preset-specific player implementation with hardcoded renderer |
src/lottie-player.ts |
Simplified to extend base player with configurable renderer |
rollup.config.js |
Updated build configuration to support multiple preset variants |
package.json |
Added export paths for all preset variants |
example/*.html |
Updated examples to demonstrate different preset usage |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
919de7e to
75f2f82
Compare
75f2f82 to
3e30b05
Compare
3e30b05 to
3a80792
Compare
3a80792 to
e20dd5b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the beneift of separating BasePlayer and PresetPlayer?
Added support for multiple Lottie player presets to provide optimized bundle sizes and renderer options for different use cases: - Standard : single renderer with all loaders (jpg, png, webp, ttf) - Lite : single renderer with minimal loaders (png only) Usage: import '@thorvg/lottie-player/sw' # Standard software renderer import '@thorvg/lottie-player/gl' # Standard OpenGL renderer import '@thorvg/lottie-player/sw-lite' # Lite software renderer import '@thorvg/lottie-player/gl-lite' # Lite OpenGL renderer This allows developers to choose the optimal player configuration based on their performance and bundle size requirements. issue: thorvg/thorvg#3481
Created dedicated example pages for each Lottie web player preset to demonstrate the different configurations and their capabilities.
e20dd5b to
7ac16d4
Compare
7ac16d4 to
cd32dbc
Compare
cd32dbc to
8a7c764
Compare
|
@hermet Following your recommendation, I revised the endings throughout the document for consistency. |
8a7c764 to
38afbcd
Compare
ThorVG Lottie Player Presets
Overview
ThorVG Lottie Player now supports multiple preset configurations to optimize bundle size and performance for different use cases. This update introduces four distinct player variants:
Bundle Size Comparison
Feature Comparison
(WASM + JS)
sw(641 +46)
gl(635+59)
sw-lite(243+45)
gl-lite(236+58)
Project Build
npm run build # See `example/` after build to run Lottie player demoCDN Usage
Standard Software Renderer
Standard WebGL Renderer
Lite Software Renderer (Minimal Features)
Lite WebGL Renderer (Minimal Features)
NPM Usage
Standard Software Renderer
Standard WebGL Renderer
Lite Software Renderer (Minimal Features)
Lite WebGL Renderer (Minimal Features)