Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server side rendering #405

Closed
Rikuoja opened this issue Sep 14, 2017 · 5 comments
Closed

Server side rendering #405

Rikuoja opened this issue Sep 14, 2017 · 5 comments
Assignees

Comments

@Rikuoja
Copy link
Contributor

Rikuoja commented Sep 14, 2017

As Riku, I want the server side rendering to work on the server, not just in development. As end user, I want to share hearings so that picture and other data are available in the facebook share.

@akx
Copy link
Contributor

akx commented Sep 14, 2017

If it works in development, the only difference can only be in deployment and configuration. Is the serverRendering configuration option enabled in production?

@vikoivun
Copy link
Member

Indeed it was. It created an odd half created page, with parts missing. Ghastly, really. I'll pull up a test instance to see how it goes these days.

@akx
Copy link
Contributor

akx commented Sep 14, 2017

Very sporky. If you get it to half-break again, care to paste the HTML as received from the server? I suspect some data fetches fail, or don't have the proper guarantees (see below) set.

/**
* Return a promise that will, as it fulfills, have added requisite
* data for the HearingView view into the dispatch's associated store.
*
* @param dispatch Redux Dispatch function
* @param getState Redux state getter
* @param location Router location
* @param params Router params
* @return {Promise} Data fetching promise
*/
static fetchData(dispatch, getState, location, params) {
return Promise.all([
dispatch(fetchHearing(params.hearingSlug, location.query.preview)),
]);
}
/**
* Return truthy if the view can be rendered fully with the data currently
* acquirable by `getState()`.
*
* @param getState State getter
* @param location Router location
* @param params Router params
* @return {boolean} Renderable?
*/
static canRenderFully(getState) {
const {state, data} = (getState().hearing || {state: 'initial'});
return (state === 'done' && data);
}

@akx
Copy link
Contributor

akx commented Sep 25, 2017

This seems to tie into #410. An executive decision should probably be made about how to tackle SSR. It shouldn't be impossible to use a compiled Webpack bundle as a server-side renderer either, mind...

@Rikuoja
Copy link
Contributor Author

Rikuoja commented Oct 25, 2017

There's no need for this atm apart from the metadata tags, which already has issue #317 . Shouldn't need whole SSR to do that.

@Rikuoja Rikuoja closed this as completed Oct 25, 2017
@ghost ghost removed the in progress label Oct 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants