From 93333306f501f8d844642e7cd96366cac5647684 Mon Sep 17 00:00:00 2001 From: Richard Stevens Date: Fri, 29 Sep 2017 20:46:25 +0100 Subject: [PATCH 1/5] Updating components to React16 --- .babelrc | 14 +++++++++++++- circle.yml | 2 +- package.json | 17 ++++++++--------- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/.babelrc b/.babelrc index 86c445f..f7da561 100644 --- a/.babelrc +++ b/.babelrc @@ -1,3 +1,15 @@ { - "presets": ["es2015", "react"] + "presets": [ + ["env", { + "target": { + "browsers": [ + "not ie <= 8", + "last 2 iOS major versions", + "last 2 Firefox major versions", + "last 2 Safari major versions", + "> 10% in UK" + ] + } + }] + ] } diff --git a/circle.yml b/circle.yml index 84a88de..66f042b 100644 --- a/circle.yml +++ b/circle.yml @@ -5,7 +5,7 @@ dependencies: cache_directories: - node_modules override: - - npm install -g npm@3.9.0 + - npm install -g npm@3.9.4 - npm install test: override: diff --git a/package.json b/package.json index 487c62f..e442627 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@holidayextras/static-site-generator", - "version": "6.2.6", + "version": "7.0.0", "description": "Holiday Extras Static Site Generator in metalsmith / react", "repository": { "type": "git", @@ -38,20 +38,19 @@ "metalsmith-assets": "^0.1.0", "metalsmith-markdown": "^0.2.1", "prismic.io": "^3.1.3", - "metalsmith-react-tpl": "^1.0.0", + "metalsmith-react-tpl": "richardstevens/metalsmith-react-tpl#react@16", "mkdirp": "^0.5.1", "moment": "^2.11.1", "publish": "^0.5.0", - "react": "^0.14.3", - "react-dom": "^0.14.3", - "react-redux": "^5.0.4", + "react": "^16.0.0", + "react-dom": "^16.0.0", + "react-redux": "^5.0.6", "underscore": "^1.8.3" }, "devDependencies": { "babel-cli": "6.7.7", - "babel-core": "^6.8.0", - "babel-preset-es2015": "^6.6.0", - "babel-preset-react": "^6.5.0", + "babel-core": "^6.26.0", + "babel-preset-env": "^1.6.0", "brace-expansion": "^1.1.7", "grunt": "^0.4.5", "grunt-contrib-uglify": "^0.11.0", @@ -60,6 +59,6 @@ "npm-watch": "^0.1.8", "rimraf": "^2.2.8", "standard": "^10.0.2", - "webpack": "^1.13.2" + "webpack": "^3.6.0" } } From 572c0c936495255bf6961eac2d2ee5ab69f3f762 Mon Sep 17 00:00:00 2001 From: Richard Stevens Date: Fri, 29 Sep 2017 22:04:38 +0100 Subject: [PATCH 2/5] need redux --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index e442627..004aa2c 100644 --- a/package.json +++ b/package.json @@ -37,14 +37,15 @@ "metalsmith": "^1.3.0", "metalsmith-assets": "^0.1.0", "metalsmith-markdown": "^0.2.1", - "prismic.io": "^3.1.3", "metalsmith-react-tpl": "richardstevens/metalsmith-react-tpl#react@16", "mkdirp": "^0.5.1", "moment": "^2.11.1", + "prismic.io": "^3.1.3", "publish": "^0.5.0", "react": "^16.0.0", "react-dom": "^16.0.0", "react-redux": "^5.0.6", + "redux": "^3.7.2", "underscore": "^1.8.3" }, "devDependencies": { From 6f5d9e17c6ce6e8e56d3749338be6ad33edb83f6 Mon Sep 17 00:00:00 2001 From: Richard Stevens Date: Fri, 29 Sep 2017 22:45:00 +0100 Subject: [PATCH 3/5] Updating metalsmith --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 004aa2c..b6293fc 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "metalsmith": "^1.3.0", "metalsmith-assets": "^0.1.0", "metalsmith-markdown": "^0.2.1", - "metalsmith-react-tpl": "richardstevens/metalsmith-react-tpl#react@16", + "metalsmith-react-tpl": "^2.0.0", "mkdirp": "^0.5.1", "moment": "^2.11.1", "prismic.io": "^3.1.3", From 407c8bb6adf7912338dfe401f2628efc1604b84f Mon Sep 17 00:00:00 2001 From: Richard Stevens Date: Fri, 29 Sep 2017 22:47:58 +0100 Subject: [PATCH 4/5] Updating metalsmith --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b6293fc..5bf12b2 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "debug": "^2.2.0", "jsonp": "^0.2.0", "meta-marked": "^0.4.0", - "metalsmith": "^1.3.0", + "metalsmith": "^2.3.0", "metalsmith-assets": "^0.1.0", "metalsmith-markdown": "^0.2.1", "metalsmith-react-tpl": "^2.0.0", From 0117f28a21782ad0727c72e062ece099e11352f8 Mon Sep 17 00:00:00 2001 From: Richard Stevens Date: Sat, 21 Oct 2017 18:27:29 +0100 Subject: [PATCH 5/5] using hydrate --- src/webpackPages.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/webpackPages.js b/src/webpackPages.js index 7be9413..45e8487 100644 --- a/src/webpackPages.js +++ b/src/webpackPages.js @@ -38,9 +38,9 @@ const webpackPages = (globalOptions) => { output += 'var store = require( \'' + props.store + '\' );' output += 'window.ReactRootProvider = Provider;' output += 'window.ReactRootStore = store;' - output += 'var renderedElement = ReactDOM.render( , document.getElementById( \'content\' ));' + output += 'var renderedElement = ReactDOM.hydrate( , document.getElementById( \'content\' ));' } else { - output += 'var renderedElement = ReactDOM.render( , document.getElementById( \'content\' ));' + output += 'var renderedElement = ReactDOM.hydrate( , document.getElementById( \'content\' ));' } const destFilename = options.destFilename