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

Suggestion: Provide critical HTML snippet for the homepage #35

Closed
alexslade opened this issue Oct 12, 2015 · 3 comments
Closed

Suggestion: Provide critical HTML snippet for the homepage #35

alexslade opened this issue Oct 12, 2015 · 3 comments

Comments

@alexslade
Copy link

Much like the critical CSS idea, how about giving first-time visitors the absolutely fastest possible experience by designating a small chunk of HTML + CSS which is sent over the wire first. This reduces transport times, extra CSS loads, page rendering time (especially on long/complex homepages).

The react app then loads everything else, and loads the rest of the content in place. A hook would be needed for a CSS transition (fade in, or something like this).

@vnglst
Copy link

vnglst commented Dec 18, 2015

+1

@thejmazz
Copy link

thejmazz commented Jan 4, 2016

You would lose SEO for the non critical HTML though, but a nice idea.

@koistya
Copy link
Member

koistya commented Jul 15, 2016

This should be pretty easy to implement with Relay, a little bit harder with custom Ajax tools. For example, on a message board page you need to make sure that only top X topic are actually loaded and number of comments, when that page is mounted into the dom, you can fetch and display more data (e.g. last three comments for each topic) inside the componentDidMount() event handler.

I'm closing this issue because it was open for some time. Feel free to continue this discussion or re-open if you have a concrete feature in mind to make implementing progressive enhancement easier.

@koistya koistya closed this as completed Jul 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants