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

Use renderToStaticMarkup in when running build. #121

Open
marklundin opened this issue Apr 11, 2016 · 10 comments
Open

Use renderToStaticMarkup in when running build. #121

marklundin opened this issue Apr 11, 2016 · 10 comments

Comments

@marklundin
Copy link
Contributor

Not sure how feasible this is, but could the style guide be statically rendered into the index.html using ReactDOMServer when compiled with the build option? Then rendered again via ReactDOM to hook up the events.

This could be useful to have static output.

@sapegin
Copy link
Member

sapegin commented Apr 11, 2016

How is it better than styleguidist build?

@marklundin
Copy link
Contributor Author

I guess load time for end users would be a factor for a large number of complex components. Also so bots can crawl. I guess for the same reasons as you'd want to pre-render on the server.

@sapegin
Copy link
Member

sapegin commented Apr 11, 2016

I don’t ;-) But feel free to submit a pull request if it’s not very complicated to implement.

@mik01aj
Copy link
Collaborator

mik01aj commented Apr 12, 2016

@marklundin in React 15, the HTML should be more lightweight. Do you use it?

And I think that long load time is caused mostly by #86. (If the page opens significantly faster in FF, then it's this one)

@marklundin
Copy link
Contributor Author

@mik01aj good point, I'll take a look.
I'd still be interested to see how much better a static page loads though. As @sapegin said, if it's a fairly straightforward update I'll submit a PR.

I'm not sure if theres any real SEO impact thought. React does state you'd use renderToStatic for this very reason, but my understanding is that most bots execute js and wait for the page to load anyway, so this may be a non issue.

@ZorGleH
Copy link

ZorGleH commented Jul 5, 2016

I'm very interested to have a static rendering, because I'm making a styleguide for an application which is not in React. It would be very cool to have a static output which can be copied/pasted, without the React clutter. How would be the best way to do that?

@okonet
Copy link
Member

okonet commented Feb 7, 2017

I'm also interested in this and might give it a try.

@sapegin
Copy link
Member

sapegin commented Feb 7, 2017

@okonet Awesome! Unfortunately I have no experience with static rendering.

@oleksii-udovychenko
Copy link

Only some bots execute js (google spider does for example), but most of them don't wait for ajax calls to finish. I say most because I don't know any of them that do wait.

Static rendering is the MUST for SEO optimization if you fetch data from a server using ajax and dynamically generate HTML afterward. Otherwise, it can improve the first-time-loading experience and allow your page to be cached more efficiently.

In any case, it is nice to have such capability.

@okonet
Copy link
Member

okonet commented Aug 18, 2017

We have an unfinished branch #330 but I think @kof didn't have time last time. I'd like to push it, though.

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

6 participants