From f2794c43347d06b8fac7c282bc96ed6b0e728e13 Mon Sep 17 00:00:00 2001 From: bill bittner Date: Sun, 13 May 2018 11:47:57 -0700 Subject: [PATCH 1/3] removed passing of custom views --- server/render/build/handlePageRender.js | 5 ++--- server/render/build/handleShowRender.js | 5 ++--- server/render/src/handlePageRender.jsx | 4 ++-- server/render/src/handleShowRender.jsx | 4 ++-- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/server/render/build/handlePageRender.js b/server/render/build/handlePageRender.js index cbc803b9..3ae51f13 100644 --- a/server/render/build/handlePageRender.js +++ b/server/render/build/handlePageRender.js @@ -25,15 +25,14 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de the bundle sent to the server? there might also be issues if this package uses a different version of spee.ch-components than www.spee.ch does? */ -var siteConfig = require('../../../config/siteConfig.js'); +var siteConfig = require('../../../config/siteConfig.js'); // const viewsConfig = require('../../../config/viewsConfig.js'); -var viewsConfig = require('../../../config/viewsConfig.js'); module.exports = function (req, res) { var context = {}; // customize the reducer by passing in intial state configs var MyReducers = (0, _spee.Reducers)(siteConfig); - var MyApp = (0, _spee.App)(viewsConfig); + var MyApp = _spee.App; var MyGAListener = (0, _spee.GAListener)(siteConfig); // create a new Redux store instance var store = (0, _redux.createStore)(MyReducers); // render component to a string diff --git a/server/render/build/handleShowRender.js b/server/render/build/handleShowRender.js index cb7511a1..45a6e308 100644 --- a/server/render/build/handleShowRender.js +++ b/server/render/build/handleShowRender.js @@ -29,9 +29,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de the bundle sent to the server? there might also be issues if this package uses a different version of spee.ch-components than www.spee.ch does? */ -var siteConfig = require('../../../config/siteConfig.js'); +var siteConfig = require('../../../config/siteConfig.js'); // const viewsConfig = require('../../../config/viewsConfig.js'); -var viewsConfig = require('../../../config/viewsConfig.js'); var returnSagaWithParams = function returnSagaWithParams(saga, params) { return ( @@ -58,7 +57,7 @@ module.exports = function (req, res) { var context = {}; // configure the reducers by passing initial state configs var MyReducers = (0, _spee.Reducers)(siteConfig); - var MyApp = (0, _spee.App)(viewsConfig); + var MyApp = _spee.App; var MyGAListener = (0, _spee.GAListener)(siteConfig); // create and apply middleware var sagaMiddleware = (0, _reduxSaga.default)(); diff --git a/server/render/src/handlePageRender.jsx b/server/render/src/handlePageRender.jsx index 6479a808..01f81a73 100644 --- a/server/render/src/handlePageRender.jsx +++ b/server/render/src/handlePageRender.jsx @@ -15,14 +15,14 @@ import renderFullPage from '../renderFullPage.js'; import Helmet from 'react-helmet'; const siteConfig = require('../../../config/siteConfig.js'); -const viewsConfig = require('../../../config/viewsConfig.js'); +// const viewsConfig = require('../../../config/viewsConfig.js'); module.exports = (req, res) => { let context = {}; // customize the reducer by passing in intial state configs const MyReducers = Reducers(siteConfig); - const MyApp = App(viewsConfig); + const MyApp = App; const MyGAListener = GAListener(siteConfig); // create a new Redux store instance diff --git a/server/render/src/handleShowRender.jsx b/server/render/src/handleShowRender.jsx index 568ad877..243dd28a 100644 --- a/server/render/src/handleShowRender.jsx +++ b/server/render/src/handleShowRender.jsx @@ -17,7 +17,7 @@ import { Reducers, GAListener, App, Sagas, Actions } from 'spee.ch-components'; import Helmet from 'react-helmet'; const siteConfig = require('../../../config/siteConfig.js'); -const viewsConfig = require('../../../config/viewsConfig.js'); +// const viewsConfig = require('../../../config/viewsConfig.js'); const returnSagaWithParams = (saga, params) => { return function * () { @@ -30,7 +30,7 @@ module.exports = (req, res) => { // configure the reducers by passing initial state configs const MyReducers = Reducers(siteConfig); - const MyApp = App(viewsConfig); + const MyApp = App; const MyGAListener = GAListener(siteConfig); // create and apply middleware From 4afd0c7de08b78918e75cd5362d6277dfc8d9d95 Mon Sep 17 00:00:00 2001 From: bill bittner Date: Sun, 13 May 2018 22:37:26 -0700 Subject: [PATCH 2/3] removed passing of custom views config --- server/render/build/handlePageRender.js | 10 +--------- server/render/build/handleShowRender.js | 7 ------- server/render/src/handlePageRender.jsx | 8 -------- server/render/src/handleShowRender.jsx | 7 ------- 4 files changed, 1 insertion(+), 31 deletions(-) diff --git a/server/render/build/handlePageRender.js b/server/render/build/handlePageRender.js index 3ae51f13..2b3c6ac8 100644 --- a/server/render/build/handlePageRender.js +++ b/server/render/build/handlePageRender.js @@ -18,15 +18,7 @@ var _reactHelmet = _interopRequireDefault(require("react-helmet")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -/* - ^ note: to do this right, maybe - these should be passed in from the implementation (www.spee.ch) itself, - so that there are no conflicts between the SSR here and - the bundle sent to the server? - there might also be issues if this package uses a different version of spee.ch-components than www.spee.ch does? -*/ -var siteConfig = require('../../../config/siteConfig.js'); // const viewsConfig = require('../../../config/viewsConfig.js'); - +var siteConfig = require('../../../config/siteConfig.js'); module.exports = function (req, res) { var context = {}; // customize the reducer by passing in intial state configs diff --git a/server/render/build/handleShowRender.js b/server/render/build/handleShowRender.js index 45a6e308..93f378e9 100644 --- a/server/render/build/handleShowRender.js +++ b/server/render/build/handleShowRender.js @@ -22,13 +22,6 @@ var _reactHelmet = _interopRequireDefault(require("react-helmet")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -/* - ^ note: to do this right, maybe - these should be passed in from the implementation (www.spee.ch) itself, - so that there are no conflicts between the SSR here and - the bundle sent to the server? - there might also be issues if this package uses a different version of spee.ch-components than www.spee.ch does? -*/ var siteConfig = require('../../../config/siteConfig.js'); // const viewsConfig = require('../../../config/viewsConfig.js'); diff --git a/server/render/src/handlePageRender.jsx b/server/render/src/handlePageRender.jsx index 01f81a73..bb5290a6 100644 --- a/server/render/src/handlePageRender.jsx +++ b/server/render/src/handlePageRender.jsx @@ -4,18 +4,10 @@ import { createStore } from 'redux'; import { Provider } from 'react-redux'; import { StaticRouter } from 'react-router-dom'; import { Reducers, GAListener, App } from 'spee.ch-components'; -/* - ^ note: to do this right, maybe - these should be passed in from the implementation (www.spee.ch) itself, - so that there are no conflicts between the SSR here and - the bundle sent to the server? - there might also be issues if this package uses a different version of spee.ch-components than www.spee.ch does? -*/ import renderFullPage from '../renderFullPage.js'; import Helmet from 'react-helmet'; const siteConfig = require('../../../config/siteConfig.js'); -// const viewsConfig = require('../../../config/viewsConfig.js'); module.exports = (req, res) => { let context = {}; diff --git a/server/render/src/handleShowRender.jsx b/server/render/src/handleShowRender.jsx index 243dd28a..ab164c57 100644 --- a/server/render/src/handleShowRender.jsx +++ b/server/render/src/handleShowRender.jsx @@ -7,13 +7,6 @@ import renderFullPage from '../renderFullPage'; import createSagaMiddleware from 'redux-saga'; import { call } from 'redux-saga/effects'; import { Reducers, GAListener, App, Sagas, Actions } from 'spee.ch-components'; -/* - ^ note: to do this right, maybe - these should be passed in from the implementation (www.spee.ch) itself, - so that there are no conflicts between the SSR here and - the bundle sent to the server? - there might also be issues if this package uses a different version of spee.ch-components than www.spee.ch does? -*/ import Helmet from 'react-helmet'; const siteConfig = require('../../../config/siteConfig.js'); From b37f03ca9dfeb6775820cbd98bbb7c1ff3c5c92e Mon Sep 17 00:00:00 2001 From: bill bittner Date: Sun, 13 May 2018 22:39:08 -0700 Subject: [PATCH 3/3] removed the viewsConfig --- config/viewsConfig.js | 17 ----------------- index.js | 2 -- server/render/build/handleShowRender.js | 3 +-- server/render/src/handleShowRender.jsx | 1 - 4 files changed, 1 insertion(+), 22 deletions(-) delete mode 100644 config/viewsConfig.js diff --git a/config/viewsConfig.js b/config/viewsConfig.js deleted file mode 100644 index 11310efa..00000000 --- a/config/viewsConfig.js +++ /dev/null @@ -1,17 +0,0 @@ -function ViewsConfig () { - this.components = {}; - this.containers = {}; - this.pages = {}; - this.update = (config) => { - if (!config) { - return console.log('No components config received.'); - } - const { components, containers, pages } = config; - console.log('Configuring custom components ...'); - this.components = components; - this.containers = containers; - this.pages = pages; - }; -} - -module.exports = new ViewsConfig(); diff --git a/index.js b/index.js index 3b91ed8a..74e913e8 100644 --- a/index.js +++ b/index.js @@ -13,14 +13,12 @@ const loggerConfig = require('./config/loggerConfig.js'); const mysqlConfig = require('./config/mysqlConfig.js'); const siteConfig = require('./config/siteConfig.js'); const slackConfig = require('./config/slackConfig.js'); -const viewsConfig = require('./config/viewsConfig.js'); function Server () { this.configureLogger = loggerConfig.update; this.configureMysql = mysqlConfig.update; this.configureSite = siteConfig.update; this.configureSlack = slackConfig.update; - this.configureViews = viewsConfig.update; this.createApp = () => { // create an Express application const app = express(); diff --git a/server/render/build/handleShowRender.js b/server/render/build/handleShowRender.js index 93f378e9..524951c6 100644 --- a/server/render/build/handleShowRender.js +++ b/server/render/build/handleShowRender.js @@ -22,8 +22,7 @@ var _reactHelmet = _interopRequireDefault(require("react-helmet")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var siteConfig = require('../../../config/siteConfig.js'); // const viewsConfig = require('../../../config/viewsConfig.js'); - +var siteConfig = require('../../../config/siteConfig.js'); var returnSagaWithParams = function returnSagaWithParams(saga, params) { return ( diff --git a/server/render/src/handleShowRender.jsx b/server/render/src/handleShowRender.jsx index ab164c57..a0218835 100644 --- a/server/render/src/handleShowRender.jsx +++ b/server/render/src/handleShowRender.jsx @@ -10,7 +10,6 @@ import { Reducers, GAListener, App, Sagas, Actions } from 'spee.ch-components'; import Helmet from 'react-helmet'; const siteConfig = require('../../../config/siteConfig.js'); -// const viewsConfig = require('../../../config/viewsConfig.js'); const returnSagaWithParams = (saga, params) => { return function * () {