Skip to content

feat: re-export IntlLangMemoizer from the fluent crate - #406

Open
Goldloli wants to merge 1 commit into
projectfluent:mainfrom
Goldloli:feat/reexport-intl-lang-memoizer
Open

Goldloli wants to merge 1 commit into
projectfluent:mainfrom
Goldloli:feat/reexport-intl-lang-memoizer

Conversation

@Goldloli

Copy link
Copy Markdown

What does this change?

Re-exports intl_memoizer::concurrent::IntlLangMemoizer from the fluent umbrella crate:

use fluent::{concurrent, FluentResource, IntlLangMemoizer};

let bundle: concurrent::FluentBundle<FluentResource> = /* ... */;
fn takes_bundle(_: fluent::bundle::FluentBundle<FluentResource, IntlLangMemoizer>) {}

Users of a concurrent FluentBundle currently have to add the intl-memoizer crate as a direct dependency just to name the bundle type (see #256). With this change the full type can be spelled using only the fluent crate, while the re-export is the same type that fluent_bundle::concurrent::FluentBundle is built on.

As discussed in #256, only IntlLangMemoizer is re-exported here — LanguageIdentifier is left out, since it also appears through unic-langid/fluent-langneg and there was no consensus on re-exporting it.

Refs #256.

Changes

  • fluent/Cargo.toml: add intl-memoizer (already a workspace dependency, and already a transitive dependency through fluent-bundle, so no extra build cost).
  • fluent/src/lib.rs: pub use intl_memoizer::concurrent::IntlLangMemoizer; with rustdoc and a doctest that constructs a concurrent bundle and passes it to a function taking the full type.

Verification

Ran locally with Rust 1.99.1:

  • cargo build -p fluent → Finished dev profile ... in 18.01s
  • cargo test -p fluent → 3 passed; 0 failed (includes the new doctest)
  • cargo test -p fluent --all-features → 3 passed; 0 failed
  • cargo clippy -p fluent --all-features -- -Dwarnings → no warnings (CI runs this across the workspace)
  • cargo fmt --check → clean (CI runs rustfmt with nightly)

No behaviour changes; this is a public API addition only.

Users of a concurrent FluentBundle currently have to add the intl-memoizer
crate as a direct dependency just to name the bundle type. Re-export
intl_memoizer::concurrent::IntlLangMemoizer from the umbrella fluent crate
so the full type can be spelled as
fluent::bundle::FluentBundle<FluentResource, fluent::IntlLangMemoizer>.

The re-export is documented with a doctest covering the concurrent bundle
type. LanguageIdentifier is intentionally not re-exported, as discussed in
projectfluent#256.

Refs projectfluent#256
@Goldloli

Goldloli commented Nov 5, 2026

Copy link
Copy Markdown
Author

Gentle ping on this one — it re-exports IntlLangMemoizer from fluent-bundle per the discussion in #256. Let me know if anything else is needed.

@Goldloli

Goldloli commented Nov 5, 2026

Copy link
Copy Markdown
Author

Hi — gentle ping. This re-export follows the maintainer guidance in #256 (IntlLangMemoizer only); happy to adjust if anything else is needed.

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.

1 participant