Skip to content

Commit a3916e4

Browse files
committed
Update examples
1 parent a6a8b61 commit a3916e4

File tree

5 files changed

+19
-45
lines changed

5 files changed

+19
-45
lines changed

examples/initial-locale/package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
"build": "react-scripts build"
99
},
1010
"dependencies": {
11-
"react": "^16.8.6",
12-
"react-dom": "^16.8.6",
13-
"react-intl": "^2.8.0",
11+
"react": "^16.12.0",
12+
"react-dom": "^16.12.0",
13+
"react-intl": "^3.6.0",
1414
"react-intl-redux": "file:../..",
15-
"react-redux": "^7.0.2",
16-
"react-scripts": "2.1.8",
17-
"redux": "^4.0.1"
15+
"react-redux": "^7.1.3",
16+
"react-scripts": "3.2.0",
17+
"redux": "^4.0.4"
1818
},
1919
"devDependencies": {
20-
"del-cli": "^1.1.0"
20+
"del-cli": "^3.0.0"
2121
}
2222
}

examples/initial-locale/src/index.js

+5-9
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,22 @@
11
/* globals document */
2-
import { addLocaleData, FormattedMessage } from 'react-intl'
2+
import { FormattedMessage } from 'react-intl'
33
import { createStore, combineReducers } from 'redux'
44
import { IntlProvider, intlReducer } from 'react-intl-redux'
55
import { Provider } from 'react-redux'
6-
import itLocaleData from 'react-intl/locale-data/it'
7-
import zhLocaleData from 'react-intl/locale-data/zh'
86
import React from 'react'
97
import ReactDOM from 'react-dom'
108

11-
addLocaleData([...itLocaleData, ...zhLocaleData])
12-
139
const reducer = combineReducers({
14-
intl: intlReducer,
10+
intl: intlReducer
1511
})
1612
const initialState = {
1713
intl: {
1814
defaultLocale: 'zh',
1915
locale: 'it',
2016
messages: {
21-
'app.greeting': 'Ciao!',
22-
},
23-
},
17+
'app.greeting': 'Ciao!'
18+
}
19+
}
2420
}
2521
const store = createStore(reducer, initialState)
2622

examples/multiple-languages/package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@
1010
"dependencies": {
1111
"intl": "^1.2.5",
1212
"prop-types": "^15.7.2",
13-
"react": "^16.8.6",
14-
"react-dom": "^16.8.6",
15-
"react-intl": "^2.8.0",
13+
"react": "^16.12.0",
14+
"react-dom": "^16.12.0",
15+
"react-intl": "^3.6.0",
1616
"react-intl-redux": "file:../..",
17-
"react-redux": "^7.0.2",
18-
"react-scripts": "2.1.8",
19-
"redux": "^4.0.1"
17+
"react-redux": "^7.1.3",
18+
"react-scripts": "3.2.0",
19+
"redux": "^4.0.4"
2020
},
2121
"devDependencies": {
22-
"del-cli": "^1.1.0",
22+
"del-cli": "^3.0.0",
2323
"redux-devtools": "^3.5.0",
2424
"redux-devtools-dock-monitor": "^1.1.3",
2525
"redux-devtools-log-monitor": "^1.4.0"

examples/multiple-languages/src/index.js

-5
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
/* eslint-env browser */
2-
import { addLocaleData } from 'react-intl'
32
import { IntlProvider } from 'react-intl-redux'
43
import { Provider } from 'react-redux'
5-
import itLocaleData from 'react-intl/locale-data/it'
6-
import zhLocaleData from 'react-intl/locale-data/zh'
74
import React from 'react'
85
import ReactDOM from 'react-dom'
96

107
import Greeting from './components/Greeting'
118
import SwitchLocale from './components/SwitchLocale'
129
import store, { DevTools } from './store'
1310

14-
addLocaleData([...itLocaleData, ...zhLocaleData])
15-
1611
const UPDATE_LOCALES = 'UPDATE_LOCALES'
1712

1813
class App extends React.Component {

package.json

-17
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
"@babel/preset-env": "^7.7.1",
3131
"@babel/preset-react": "^7.7.0",
3232
"@babel/register": "^7.7.0",
33-
"ava": "^2.4.0",
3433
"babel-jest": "^24.9.0",
3534
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
3635
"cross-env": "^6.0.3",
@@ -52,7 +51,6 @@
5251
"lint-staged": "^9.4.3",
5352
"npm-run-all": "^4.1.5",
5453
"prettier-eslint-cli": "^5.0.0",
55-
"raf": "^3.4.1",
5654
"react": "^16.12.0",
5755
"react-dom": "^16.12.0",
5856
"react-intl": "^3.6.0",
@@ -83,14 +81,6 @@
8381
"Android > 2",
8482
"last 2 ChromeAndroid versions"
8583
],
86-
"ava": {
87-
"require": [
88-
"@babel/register",
89-
"raf/polyfill",
90-
"jsdom-global/register",
91-
"./test/helpers/enzyme-config"
92-
]
93-
},
9484
"eslintConfig": {
9585
"extends": [
9686
"concise",
@@ -119,12 +109,5 @@
119109
"eslint --fix",
120110
"git add"
121111
]
122-
},
123-
"nyc": {
124-
"reporter": [
125-
"html",
126-
"lcov",
127-
"text"
128-
]
129112
}
130113
}

0 commit comments

Comments
 (0)