The New FluentBundle API

I’ve published @fluent/bundle 0.14 which now exposes the new API for FluentBundle, FluentResource, FluentNumber, and FluentDateTime. The final design is a result of 3 iterations and a lot of feedback from stakeholders and implementors. Thank you for your help. I hope the new API will serve well its purposes.

In summary: format is now called formatPattern and has stricter requirements regarding its arguments. It may also throw if errors are not passed as the third argument. addMessages has been removed in favor of addResource, which takes an instance of FluentResource. The static FluentResource.fromString() method has been removed in favor of simply using the constructor: new FluentResource(text).

Please consult the @fluent/bundle changelog for details:

1 Like

Hi,

Thanks for all your hard work on this project!

I noticed today that the Wiki hasn’t been updated to reflect these changes. Normally I’d submit a PR, but the wiki says to provide feedback here on Discourse, so I thought I’d follow instructions first :slight_smile:

1 Like

Thanks for bringing this up! As I read through the wiki page you linked to, I realized it hadn’t been updated in a while. I’m sorry if it was misleading when you found it first. I’ve just updated it to reflect the current APIs, package names, and URLs.

1 Like

Thanks very much for the quick updates! It is much clearer now, thanks! Yes, it was a little misleading but I had already got a handle on it from the React bindings wiki page, so it wasn’t a big problem and I soon found the detailed release notes where it diverged, which helped tremendously :slight_smile:
I know how hard it can be to remember to update every single piece of documentation when making changes, so I want to say that I was (and still am! :wink:) impressed with the documentation and examples :+1:

1 Like