Skip to content
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

Provide Javascript-only bindings for dotlottie-rs #169

Open
theashraf opened this issue Jun 5, 2024 · 0 comments
Open

Provide Javascript-only bindings for dotlottie-rs #169

theashraf opened this issue Jun 5, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@theashraf
Copy link
Member

theashraf commented Jun 5, 2024

Currently, the dotlottie-rs player provides WASM/Kotlin/Swift bindings. The WASM bindings are isomorphic and can run in both the browser and Node.js or any WASM runtime. But, it requires an additional step to load the WASM file either from a CDN or by self-hosting it within the user's application.

While this is the optimal approach for loading the player on the web (since the user doesn't need to load a large JavaScript file and can asynchronously load the WASM file), it may not be suitable for specific use cases. This includes scenarios when the user cannot load the WASM file over their application server or from a CDN.

To address these limitations, we propose exporting JavaScript-only bindings.

Proposed Solution:
Modify the Makefile to include instructions for Emscripten to output no WASM when make wasm is executed.
Build Configurations:
Ensure make wasm generates both WASM-only and JavaScript-only bindings.
For JavaScript-only bindings, pass the -sWASM=0 flag in the Emscripten command to disable WASM output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant