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/handlePageRender.js b/server/render/build/handlePageRender.js index cbc803b9..2b3c6ac8 100644 --- a/server/render/build/handlePageRender.js +++ b/server/render/build/handlePageRender.js @@ -18,22 +18,13 @@ 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'); -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..524951c6 100644 --- a/server/render/build/handleShowRender.js +++ b/server/render/build/handleShowRender.js @@ -22,17 +22,8 @@ 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'); -var viewsConfig = require('../../../config/viewsConfig.js'); - var returnSagaWithParams = function returnSagaWithParams(saga, params) { return ( /*#__PURE__*/ @@ -58,7 +49,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..bb5290a6 100644 --- a/server/render/src/handlePageRender.jsx +++ b/server/render/src/handlePageRender.jsx @@ -4,25 +4,17 @@ 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 = {}; // 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..a0218835 100644 --- a/server/render/src/handleShowRender.jsx +++ b/server/render/src/handleShowRender.jsx @@ -7,17 +7,9 @@ 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'); -const viewsConfig = require('../../../config/viewsConfig.js'); const returnSagaWithParams = (saga, params) => { return function * () { @@ -30,7 +22,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