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 example? #4

Open
tconroy opened this issue Aug 9, 2016 · 2 comments
Open

Server Side rendering example? #4

tconroy opened this issue Aug 9, 2016 · 2 comments

Comments

@tconroy
Copy link

tconroy commented Aug 9, 2016

This medium post and this repo are the cleanest examples of code splitting I've found, so thank you!

One thing I'd like to request is an example of a server side implementation, where the initial state is set by the server and returned to the client with the appropriate bundles.

@grgur
Copy link
Member

grgur commented Nov 14, 2016

Thanks @tconroy. I fully agree. Let's see if we can have someone help out

@jfresco
Copy link

jfresco commented Oct 18, 2017

@tconroy I could make SSR work by changing a little bit the getComponent functions. It works in my setup, I didn't try it in this project.

getComponent(location, cb) {
  if (process.env.IS_BROWSER) {
    System.import('pages/Home').then(loadRoute(cb)).catch(errorLoading);
  } else {
    cb(null, require('pages/Home').default))
  }
}

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

3 participants