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 masksProvider
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:
- We received user feedback that variadic function is not as ergonomic
- 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:
- We receive feedback that variadic callback fn is not ergonomic
- This solves the missing key issue when we render rich text
- 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