diff --git a/frontend/package.json b/frontend/package.json index a23f964d..2d45d021 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -26,6 +26,7 @@ "lodash.uniq": "^4.5.0", "querystring": "^0.2.0", "react": "^15.3.2", + "react-a11y": "^0.3.3", "react-dom": "^15.3.2", "react-hot-loader": "^3.0.0-beta.6", "react-intl": "^2.1.5", diff --git a/frontend/src/index.js b/frontend/src/index.js index af547af9..25517994 100644 --- a/frontend/src/index.js +++ b/frontend/src/index.js @@ -1,6 +1,13 @@ +const a11y = require('react-a11y'); const ReactDOM = require('react-dom'); const React = require('react'); +if (process.env.NODE_ENV !== 'production') { + a11y(React, { + ReactDOM + }); +} + const render = () => { const Root = require('./root'); diff --git a/frontend/yarn.lock b/frontend/yarn.lock index fd8da6be..98980240 100644 --- a/frontend/yarn.lock +++ b/frontend/yarn.lock @@ -4054,7 +4054,7 @@ object-keys@^1.0.10, object-keys@^1.0.8: version "1.0.11" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d" -object.assign@^4.0.4: +object.assign@^4.0.3, object.assign@^4.0.4: version "4.0.4" resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.0.4.tgz#b1c9cc044ef1b9fe63606fc141abbb32e14730cc" dependencies: @@ -5001,6 +5001,12 @@ rc@^1.0.1, rc@^1.1.6, rc@~1.1.0: minimist "^1.2.0" strip-json-comments "~1.0.4" +react-a11y: + version "0.3.3" + resolved "https://registry.yarnpkg.com/react-a11y/-/react-a11y-0.3.3.tgz#310edd466b81371d76cd1dc9a5d90758dbac3840" + dependencies: + object.assign "^4.0.3" + react-addons-test-utils@^15.3.2: version "15.3.2" resolved "https://registry.yarnpkg.com/react-addons-test-utils/-/react-addons-test-utils-15.3.2.tgz#c09a44f583425a4a9c1b38444d7a6c3e6f0f41f6" diff --git a/ui/docs/index.js b/ui/docs/index.js index af547af9..25517994 100644 --- a/ui/docs/index.js +++ b/ui/docs/index.js @@ -1,6 +1,13 @@ +const a11y = require('react-a11y'); const ReactDOM = require('react-dom'); const React = require('react'); +if (process.env.NODE_ENV !== 'production') { + a11y(React, { + ReactDOM + }); +} + const render = () => { const Root = require('./root'); diff --git a/ui/package.json b/ui/package.json index d619426b..63407399 100644 --- a/ui/package.json +++ b/ui/package.json @@ -14,7 +14,8 @@ "dependencies": { "classnames": "^2.2.5", "lodash.flatten": "^4.4.0", - "react": "^15.3.2" + "react": "^15.3.2", + "react-a11y": "^0.3.3" }, "devDependencies": { "ava": "^0.16.0", diff --git a/ui/webpack/development.js b/ui/webpack/development.js index 3277d699..ff219536 100644 --- a/ui/webpack/development.js +++ b/ui/webpack/development.js @@ -1,3 +1,4 @@ +const pkg = require('../package.json'); const base = require('./base.js'); const entries = require('./entrypoints'); const webpack = require('webpack'); @@ -24,7 +25,14 @@ module.exports = Object.assign(base.config, { return all; }, {}), plugins: base.config.plugins.concat([ - new webpack.HotModuleReplacementPlugin() + new webpack.HotModuleReplacementPlugin(), + new webpack.DefinePlugin({ + 'process.env': { + NODE_ENV: JSON.stringify(process.env.NODE_ENV || 'development'), + APP_NAME: JSON.stringify(pkg.name), + APP_VERSION: JSON.stringify(pkg.version) + } + }) ]), devtool: 'source-map', devServer diff --git a/ui/yarn.lock b/ui/yarn.lock index f6b29439..56318ca2 100644 --- a/ui/yarn.lock +++ b/ui/yarn.lock @@ -3911,7 +3911,7 @@ object-keys@^1.0.10, object-keys@^1.0.8: version "1.0.11" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d" -object.assign@^4.0.4: +object.assign@^4.0.3, object.assign@^4.0.4: version "4.0.4" resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.0.4.tgz#b1c9cc044ef1b9fe63606fc141abbb32e14730cc" dependencies: @@ -4907,6 +4907,12 @@ rc@^1.0.1, rc@^1.1.6, rc@~1.1.0: minimist "^1.2.0" strip-json-comments "~1.0.4" +react-a11y: + version "0.3.3" + resolved "https://registry.yarnpkg.com/react-a11y/-/react-a11y-0.3.3.tgz#310edd466b81371d76cd1dc9a5d90758dbac3840" + dependencies: + object.assign "^4.0.3" + react-addons-test-utils@^15.3.2: version "15.3.2" resolved "https://registry.yarnpkg.com/react-addons-test-utils/-/react-addons-test-utils-15.3.2.tgz#c09a44f583425a4a9c1b38444d7a6c3e6f0f41f6"