In bug 1642415, we’re hitting a problem with our understanding of what a Bundle is. This is in a way related to the message and term references thread here, but also not strictly identical.
Problem recap: We have 15 resources, each in two locations. If we have missing strings, we iterate over 2**15 combinations, and cache each. And all it takes for that is a single missing string in the last resource.
In that bug, I’m proposing to only have one Bundle per language. We do more IO on fallback scenarios, but add all Resources for that one language to the same bundle instance. We just re-yield the same instance each tiime. There’s a few interesting pros about that, in the scenario above in particular:
We only iterate over two versions of the bundle, and when we reiterate, we find all strings on the first iteration.
We also have better chances to resolve message and term references correctly, at least within a single language. There’s an option to extend this to work across languages, if we moved the language from bundle to pattern.
There’s also a caveat, and that is that we loose the ability to warn about conflicting resources in a bundle. Note, only the fluent-rs implementation actually gives feedback on that at this point, AFAIK.
Now, I see a few ways forward, but figured an open and documented conversation here would be best:
- Find some other way to fix bug 1642415.
- Be fine with no runtime checks on conflicting resources, either stopping to produce them in fluent-rs, or by not reporting them in the gecko bindings.
- Add another option to
addResource
likeignoreDuplicates
. We’d not ignore them on the first resource suite, but on the following ones. - Something I missed.
The latter option sounds easy on the JS/Python front, but Rust doesn’t seem to like that at all from an API POV?
Any opinions or concerns from other implementations?