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

Reduce number of dependencies #131

Open
kellpossible opened this issue Sep 13, 2024 · 6 comments
Open

Reduce number of dependencies #131

kellpossible opened this issue Sep 13, 2024 · 6 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@kellpossible
Copy link
Owner

It would be good to reduce the number of dependencies in the default build.

For example dashmap use in i18n-embed-fl could be replaced with a HashMap in a lock, etc, and only enabled using an optional feature if performance is really required by the end user at the cost of increased compile times. The chances are for almost every project, the compile time of dashmap far outweighs any benefits it brings to the runtime of the macro.

@kellpossible kellpossible added enhancement New feature or request help wanted Extra attention is needed labels Sep 13, 2024
@kellpossible
Copy link
Owner Author

kellpossible commented Sep 13, 2024

rust-embed should be an optional dependency for i18n-embed, in a sense, the crate has outgrown its utility as simply being a means to embed localizations with the I18nAssets trait and FileSystemAssets making it possible to load them at runtime. And it would be nice to use i18n-embed-fl without rust-embed dependency too.

@mrtryhard
Copy link
Contributor

Chances are that lazy-static can be removed if std::sync::OnceLock is used instead. See the section in the README.md

@alerque
Copy link

alerque commented Sep 18, 2024

Switching to OnceLock should be possible now, but doing so would bump the MSRV, correct?

@mrtryhard
Copy link
Contributor

I couldn't find the current MSRV but I'm confident that it would probably bump higher the current MSRV to a minimum of 1.70.

@mrtryhard
Copy link
Contributor

@alerque I've took time today to dig a bit for the current msrv, and I think it's fine to use OnceLock without it bumping the msrv.

root Cargo.toml -> depends on clap => msrv == 1.74
i18n-build -> depends on rust-embed => msrv  == 1.70
i18n-config -> depends on tinystr => msrv == 1.67.0 (OK, no lazy_static anyways)
i18n-embed -> depends on rust-embed => msrv == 1.70
i18n-embed-fl -> depends on rust-embed => msrv == 1.70

I am not yet 100% familiar with the dependencies but it does look OK.

@kellpossible
Copy link
Owner Author

Thanks @mrtryhard and @alerque ! I'd be very happy for a PR to remove lazy_static

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

No branches or pull requests

3 participants