airbnb / hypernova

A service for server-side rendering your JavaScript views
MIT License
5.82k stars 214 forks source link

Does parsed body has a limitation? #36

Closed frozenfung closed 8 years ago

frozenfung commented 8 years ago

Hey team, I really appreicate you guys open source hypernova. It's awesome and flexiable that make isomorphic so convenient.

But now I encounter some weird situation, I don't know if there is something I missed. My application is trying to render lots of html tags with server, precisely, like 13k tags. When I limited the tags rendered by server under 400, it works as expected. And when I reset limitation to about 1.2k, I got some warning like below:

 Warning: React attempted to reuse markup in a container but the checksum was invalid. This generally means that you are using server rendering and the markup generated on the server was not what the client was expecting. React injected new markup to compensate which works but you have lost many of the benefits of server rendering. Instead, figure out why the markup being generated is different on the client or server:
 (client) ">1</span></a></li><li class="tag" data-
 (server) ">1</span></a></li></ul></div></div>

After that, I raise limitation again to like 4k and server-render does not work anymore. The application is still working with fallback.

It's really frustrated.

Would you guy consider large payload for hypernova server could be a problem?

btw, here is my hypernova.js

const hypernova = require('hypernova/server');
const createGetComponent = require('hypernova/server').createGetComponent;
const path = require('path');

hypernova({
  devMode: false,
  getComponent: createGetComponent({
    SearchTag: path.resolve('./app/assets/javascripts/isomorphic/searchTag/searchTag.js'),
  }),
  port: 3030,
});

thanks.

goatslacker commented 8 years ago

Yes, it sounds like you're server rendering too much information. Server rendering isn't free/cheap so just render what you need to and defer the rest.

frozenfung commented 8 years ago

@goatslacker I see, thanks man.