github formatjs/formatjs react-intl@5.0.0

latest releases: vue-intl@6.5.0, react-intl@6.6.6, intl-messageformat@10.5.12...
3 years ago

5.0.0 (2020-07-03)

Features

  • intl-messageformat: make FormatXMLElementFn non-variadic (f2963bf)
  • react-intl: fail fast when intl Provider is missing (42fa3c1)
  • react-intl: merge chunks in FormatXMLElementFn (1b5892f), closes #1623

BREAKING CHANGES

  • react-intl: This also comes from Dropbox internal developer feedback. FormattedMessage has a default English renderer that masks Provider setup issues which causes them to not be handled during testing phase.
  • intl-messageformat: This effectively change the signature for formatter
    function from (...chunks) => any to (chunks) => any. This solves a
    couple of issues:
  1. We received user feedback that variadic function is not as ergonomic
  2. Right now there's not way to distinguish between 2 chunks that have
    the same tag, e.g <b>on</b> and <b>on</b>. The function would
    receive 2 chunks that are identical. By consoliding to the 1st param we
    can reserve additional params to provide mode metadata in the future
  • react-intl: This turns rich text formatting callback function to
    non-variadic. So (...chunks) => React.ReactNode becomes (chunks) => React.ReactNode. This solves a couple of issues:
  1. We receive feedback that variadic callback fn is not ergonomic
  2. This solves the missing key issue when we render rich text
  3. This allows us to utilize extra param to distinguish when 2 React
    element are exactly the same except for their indices, e.g <b>one</b> and <b>one</b> and you want to render them differently

Don't miss a new formatjs release

NewReleases is sending notifications on new releases.