kellpossible / cargo-i18n

A Rust Cargo sub-command and libraries to extract and build localization resources to embed in your application/library
MIT License
120 stars 25 forks source link

Reduce number of dependencies #131

Open kellpossible opened 4 days ago

kellpossible commented 4 days ago

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 commented 4 days ago

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 commented 5 hours ago

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