From d0e83afcb978dfb96482b6d54eb003933d4664d5 Mon Sep 17 00:00:00 2001 From: Ray Schamp Date: Wed, 7 Mar 2018 15:16:46 -0500 Subject: [PATCH 01/24] Allow building only a single view --- dev-server/index.js | 2 +- webpack.config.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dev-server/index.js b/dev-server/index.js index d5a5c1b9a94..9060d6e4a4e 100644 --- a/dev-server/index.js +++ b/dev-server/index.js @@ -6,7 +6,7 @@ var webpack = require('webpack'); var compiler = webpack(require('../webpack.config.js')); var handler = require('./handler'); var log = require('./log'); -var routes = require('../src/routes.json').concat(require('../src/routes-dev.json')); +var routes = require('../src/routes.json').concat(require('../src/routes-dev.json')).filter(route => !process.env.VIEW || process.env.VIEW === route.view); // Create server var app = express(); diff --git a/webpack.config.js b/webpack.config.js index 725aa572b92..3240b234343 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -13,6 +13,8 @@ if (process.env.NODE_ENV !== 'production') { routes = routes.concat(require('./src/routes-dev.json')); // eslint-disable-line global-require } +routes = routes.filter(route => !process.env.VIEW || process.env.VIEW === route.view); + let VersionPlugin = function (options) { this.options = options || {}; return this; From 61c2bb148acbb67c36a4ace07df3a4bfeac13783 Mon Sep 17 00:00:00 2001 From: Ray Schamp Date: Wed, 7 Mar 2018 15:51:07 -0500 Subject: [PATCH 02/24] Use country data from an NPM package To prepare to upgrade react-telephone-input which removed this module --- package.json | 1 + src/components/forms/phone-input.jsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index ffb23459bf8..a11a94be20c 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "classnames": "2.2.5", "cookie": "0.2.2", "copy-webpack-plugin": "0.2.0", + "country-telephone-data": "0.5.5", "create-react-class": "15.6.2", "css-loader": "0.23.1", "eslint": "4.7.1", diff --git a/src/components/forms/phone-input.jsx b/src/components/forms/phone-input.jsx index 69d8ab23fb4..acb1e00613e 100644 --- a/src/components/forms/phone-input.jsx +++ b/src/components/forms/phone-input.jsx @@ -1,4 +1,4 @@ -const allCountries = require('react-telephone-input/lib/country_data').allCountries; +const allCountries = require('country-telephone-data').allCountries; const classNames = require('classnames'); const ComponentMixin = require('formsy-react-components').ComponentMixin; const createReactClass = require('create-react-class'); From 34f39b1c0b750f90654b7e612ae33586c9b737c9 Mon Sep 17 00:00:00 2001 From: Ray Schamp Date: Thu, 8 Mar 2018 10:04:58 -0500 Subject: [PATCH 03/24] Update to React 16, and dependent packages The Splash page renders with this commit. --- package.json | 16 ++++++++-------- src/components/carousel/carousel.jsx | 3 +-- src/components/carousel/legacy-carousel.jsx | 2 +- src/components/forms/form.jsx | 6 +++--- src/components/forms/general-error.jsx | 2 +- src/components/nestedcarousel/nestedcarousel.jsx | 2 +- 6 files changed, 15 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index a11a94be20c..fda9116f760 100644 --- a/package.json +++ b/package.json @@ -55,8 +55,8 @@ "exenv": "1.2.0", "fastly": "1.2.1", "file-loader": "0.8.4", - "formsy-react": "0.19.5", - "formsy-react-components": "0.11.1", + "formsy-react": "1.1.4", + "formsy-react-components": "1.0.0-beta.3", "git-bundle-sha": "0.0.2", "glob": "5.0.15", "google-libphonenumber": "1.0.21", @@ -80,15 +80,15 @@ "postcss-loader": "2.0.10", "prop-types": "15.6.0", "raven-js": "3.0.4", - "react": "15.5.4", - "react-dom": "15.5.4", - "react-intl": "2.1.2", + "react": "16.2.0", + "react-dom": "16.2.0", + "react-intl": "2.4.0", "react-modal": "3.1.11", "react-onclickoutside": "6.7.1", - "react-redux": "4.4.5", + "react-redux": "5.0.7", "react-responsive": "3.0.0", - "react-slick": "0.12.2", - "react-telephone-input": "3.8.6", + "react-slick": "0.20.0", + "react-telephone-input": "4.3.4", "redux": "3.5.2", "redux-thunk": "2.0.1", "sass-lint": "1.5.1", diff --git a/src/components/carousel/carousel.jsx b/src/components/carousel/carousel.jsx index 5438d414f6c..464203ef9ed 100644 --- a/src/components/carousel/carousel.jsx +++ b/src/components/carousel/carousel.jsx @@ -2,8 +2,7 @@ const classNames = require('classnames'); const defaults = require('lodash.defaults'); const PropTypes = require('prop-types'); const React = require('react'); -const Slider = require('react-slick'); - +const Slider = require('react-slick').default; const Thumbnail = require('../thumbnail/thumbnail.jsx'); const frameless = require('../../lib/frameless.js'); diff --git a/src/components/carousel/legacy-carousel.jsx b/src/components/carousel/legacy-carousel.jsx index d5ab1dbf8c6..24e978d3f6c 100644 --- a/src/components/carousel/legacy-carousel.jsx +++ b/src/components/carousel/legacy-carousel.jsx @@ -5,7 +5,7 @@ const classNames = require('classnames'); const defaults = require('lodash.defaults'); const PropTypes = require('prop-types'); const React = require('react'); -const Slider = require('react-slick'); +const Slider = require('react-slick').default; const Thumbnail = require('../thumbnail/thumbnail.jsx'); diff --git a/src/components/forms/form.jsx b/src/components/forms/form.jsx index 1514787b7d8..dbe6d485704 100644 --- a/src/components/forms/form.jsx +++ b/src/components/forms/form.jsx @@ -27,7 +27,7 @@ class Form extends React.Component { } render () { return ( - { this.formsy = form; @@ -36,13 +36,13 @@ class Form extends React.Component { {...this.props} > {React.Children.map(this.props.children, child => { - if (!child) return child; + if (!child) return null; if (child.props.name === 'all') { return React.cloneElement(child, {value: this.state.allValues}); } return child; })} - + ); } } diff --git a/src/components/forms/general-error.jsx b/src/components/forms/general-error.jsx index 270e3ca39e9..5c1de465537 100644 --- a/src/components/forms/general-error.jsx +++ b/src/components/forms/general-error.jsx @@ -25,4 +25,4 @@ GeneralError.propTypes = { showError: PropTypes.func }; -module.exports = Formsy.HOC(GeneralError); +module.exports = Formsy.withFormsy(GeneralError); diff --git a/src/components/nestedcarousel/nestedcarousel.jsx b/src/components/nestedcarousel/nestedcarousel.jsx index fb5b41b8c9d..821224ef730 100644 --- a/src/components/nestedcarousel/nestedcarousel.jsx +++ b/src/components/nestedcarousel/nestedcarousel.jsx @@ -2,7 +2,7 @@ const classNames = require('classnames'); const defaults = require('lodash.defaults'); const PropTypes = require('prop-types'); const React = require('react'); -const Slider = require('react-slick'); +const Slider = require('react-slick').default; const Thumbnail = require('../thumbnail/thumbnail.jsx'); From f375130190844f0d0813b0e8dca1bf25fbcf966f Mon Sep 17 00:00:00 2001 From: Ray Schamp Date: Thu, 8 Mar 2018 10:45:13 -0500 Subject: [PATCH 04/24] Remove unrecognized props from Input In the process, make Input into a stateless component, since apparently this state isn't ever changed. --- src/components/forms/input.jsx | 48 +++++++--------------------------- 1 file changed, 10 insertions(+), 38 deletions(-) diff --git a/src/components/forms/input.jsx b/src/components/forms/input.jsx index a9992a40c59..d4f59941852 100644 --- a/src/components/forms/input.jsx +++ b/src/components/forms/input.jsx @@ -1,4 +1,3 @@ -const bindAll = require('lodash.bindall'); const classNames = require('classnames'); const FRCInput = require('formsy-react-components').Input; const omit = require('lodash.omit'); @@ -11,43 +10,16 @@ const inputHOC = require('./input-hoc.jsx'); require('./input.scss'); require('./row.scss'); -class Input extends React.Component { - constructor (props) { - super(props); - bindAll(this, [ - 'handleInvalid', - 'handleValid' - ]); - this.state = { - status: '' - }; - } - handleValid () { - this.setState({ - status: 'pass' - }); - } - handleInvalid () { - this.setState({ - status: 'fail' - }); - } - render () { - return ( - - ); - } -} +const Input = props => ( + +); Input.propTypes = { className: PropTypes.string, From 79665e5986cf2310e711c6b0b62a95ca9f441a60 Mon Sep 17 00:00:00 2001 From: Ray Schamp Date: Thu, 8 Mar 2018 10:45:24 -0500 Subject: [PATCH 05/24] Fix warnings on About --- src/views/about/about.jsx | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/src/views/about/about.jsx b/src/views/about/about.jsx index 9dc2fbc8087..12ca85f1f5f 100644 --- a/src/views/about/about.jsx +++ b/src/views/about/about.jsx @@ -25,11 +25,11 @@ const About = () => (