Skip to content
This repository was archived by the owner on Jan 4, 2018. It is now read-only.

Commit 1ef8df3

Browse files
committed
Patch intl polyfill on runtime. Fixes #47, fixes #44
1 parent a533b08 commit 1ef8df3

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

lib/index.js

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,20 @@ import ReactDOM from 'react-dom'
55
import { Provider } from 'react-redux'
66
import Root, { store } from './Root'
77

8-
ReactDOM.render(
9-
<Provider store={store}>
10-
<Root />
11-
</Provider>
12-
, document.getElementById('app'))
8+
// All modern browsers, expect `Safari`, have implemented
9+
// the `ECMAScript Internationalization API`.
10+
// For that we need to patch in on runtime.
11+
if (!global.Intl)
12+
require.ensure(['intl'], require => {
13+
require('intl')
14+
start()
15+
}, 'IntlBundle')
16+
else start()
17+
18+
function start () {
19+
ReactDOM.render(
20+
<Provider store={store}>
21+
<Root />
22+
</Provider>
23+
, document.getElementById('app'))
24+
}

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,19 @@
2828
"babel-runtime": "^5.8.29",
2929
"classnames": "^2.2.0",
3030
"history": "^1.13.0",
31+
"intl": "^1.0.1",
3132
"parse-link-header": "^0.4.1",
3233
"purecss": "^0.6.0",
3334
"react": "^0.14.1",
3435
"react-dom": "^0.14.1",
35-
"react-intl": "2.0.0-pr-3",
36+
"react-intl": "2.0.0-beta-1",
3637
"react-pure-render": "^1.0.2",
3738
"react-redux": "^4.0.0",
3839
"react-router": "^1.0.0-rc3",
3940
"redux": "^3.0.4",
4041
"redux-devtools": "^3.0.0-beta-3",
41-
"redux-devtools-log-monitor": "^1.0.0-beta-3",
4242
"redux-devtools-dock-monitor": "^1.0.0-beta-3",
43+
"redux-devtools-log-monitor": "^1.0.0-beta-3",
4344
"redux-router": "^1.0.0-beta3",
4445
"redux-thunk": "^1.0.0",
4546
"whatwg-fetch": "^0.10.0"

0 commit comments

Comments
 (0)