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

add optional wasm feature with web-time dependency #17

Merged
merged 3 commits into from
Jan 28, 2025

Conversation

JL710
Copy link
Contributor

@JL710 JL710 commented Jan 28, 2025

This PR adds an optional wasm feature. This feature is optional. If it is active the implementation of AnimationTime is switched from std::time::Instant to web-time::Instant.

As background. This PR is supposed to fix an issue in the iced dev branch which utilities lilt and can not compile to wasm as of now.

@hecrj
Copy link

hecrj commented Jan 28, 2025

There's no need for the optional feature, since web-time simply re-exports the std types directly on native.

At the same time the library will simply re-export std::time when not using the wasm32-unknown-unknown target and will not pull in any dependencies.

Copy link
Owner

@cyypherus cyypherus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like hecrj mentioned - let's just use the web-time types directly in place of std with no feature flag. Thank you for the PR!

This is based on the fact that web-time only exports std::time if it is not on wasm.
@JL710
Copy link
Contributor Author

JL710 commented Jan 28, 2025

@hecrj thanks for pointing that out. I was not aware of that.

@cyypherus cyypherus merged commit b0d7455 into cyypherus:main Jan 28, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants