v2.2.3

@ericf ericf released this Jan 15, 2017 · 2 commits to master since this release

Bug Fixes

  • Fixed build to remove await keyword for Microsoft Edge (#814)

Improvements

The build has been upgraded to use rollup@0.41.4 which fixes issues with ES3 Babel transforms and Babel helpers which has reduced the build file size significantly (#814, #788, #687).

File Before After Delta
react-intl.min.js 47.10 kb 41.61 kb -11.66%
react-intl.min.js.gz 13.31 kb 11.51 kb -13.52%

Changelog

Downloads

v2.2.2

@ericf ericf released this Dec 29, 2016 · 14 commits to master since this release

Bug Fixes

  • Fixed <FormattedMessage> missing key prop warning (#787)

Changelog

Downloads

v2.2.1

@ericf ericf released this Dec 28, 2016 · 17 commits to master since this release

Bug Fixes

  • Fixed <IntlProvider>'s textComponent prop type definition (#786, @fson)

Changelog

Downloads

v2.2.0

@ericf ericf released this Dec 23, 2016 · 21 commits to master since this release

Bug Fixes

  • Made context default to empty object for Inferno/Preact (#757, @longlho)

Enhancements

React Native

React Native is now officially supported by leveraging a simple, clever approach thought-up by @steida and implemented by @mschipperheyn. The major issue with React Native support is that the React Intl components must render an element, which defaults to <span>. In React Native, this needs to be <Text>.

To get around this issue, <IntlProvider> now accepts a textComponent prop (which defaults to "span". In a React Native environment, this can be set to Text:

import React from 'react';
import {View, Text} from 'react-native';
import {IntlProvider, FormattedDate} from 'react-intl':

const now = Date.now();

export default () => (
  <IntlProvider
    locale='en'
    textComponent={Text}
  >
    <View>
      <Text>Today is: <FormattedDate value={now}/></Text>
    </View>
  </IntlProvider>
);

(#600, #739, @steida, @mschipperheyn)

Note on Testing

If you're manually mocking context.intl in your tests, you'll need to be sure to add a textComponent prop which React Intl now relies on.

const mockedIntlContext = {
  intl: {
    textComponent: 'span'
  }
};

Ideally you shouldn't need to muck context.intl manually, see the docs on Testing with React Intl.

Other Enhancements

  • Ported examples to use create-react-app (#669, #673, @iswanj)

  • Added Jest snapshot testing example (#683, @zouxuoz)

  • Removed propTypes from production builds to reduce file size (#701, @mbrevda)

  • Updated Travis config, remove Node 0.12 and 5, add Node 7. Testing Node: 4.2, 6, and 7 (#713)

  • Switched to Jest for running tests (#713)


Changelog

Downloads

v2.1.5

@ericf ericf released this Sep 1, 2016 · 61 commits to master since this release

Enhancements

  • Added helpful error to dist build when React is undefined (#616)

  • Added npm run watch scripts to examples (#624 @jiayihu)


Changelog

Downloads

v2.1.4

@ericf ericf released this Aug 22, 2016 · 69 commits to master since this release

Bug Fixes

  • Fixed how default formatting options are applied to formatTime() and <FormattedTime>. (#597 @budde377)

  • Fixed example in README to be clearer. (#606 @yangsu)

Enhancements

  • Added module entry to package.json for Webpack 2. (#571 @taion)

Changelog

Downloads

v2.1.3

@ericf ericf released this Jun 14, 2016 · 104 commits to master since this release

Bug Fixes

  • Fixed <FormattedRelative> to update when props.value changes (#495)

Enhancements

  • Development scripts now use cross-env so Windows developers can develop and build React Intl. (#475 @cramhead)

Changelog

Downloads

v2.1.2

@ericf ericf released this Apr 29, 2016 · 128 commits to master since this release

Bug Fixes

  • Use separate delimiter and placeholder in <FormattedMessage> for IE8 support (#441 @amccloud)

Changelog

Downloads

v2.1.1

@ericf ericf released this Apr 25, 2016 · 133 commits to master since this release

Bug Fixes

  • Properly apply defaultProps to <IntlProvider> (#435)

Changelog

Downloads

v2.1.0

@ericf ericf released this Apr 20, 2016 · 137 commits to master since this release

Perf Improvements

shouldIntlComponentUpdate

Improved the perf of shouldIntlComponentUpdate util which now checks if context.intl is the same as nextContext.intl before doing a shallow compare of their filtered props.

(#421)

Nested <IntlProvider>s

Creating Intl* formatter instances is expensive, so <IntlProvider> memoizes the Intl* constructors to reuse the formatter instances. These memoized formatters are now shared with nested <IntlProvider> instances.

This sharing should increase the rendering perf of component architectures which use nested <IntlProvider> instances.

(#421)

Bug Fixes

  • Removed calls to Object.assign (#403)

Changelog

Downloads