-
Notifications
You must be signed in to change notification settings - Fork 330
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
Add support for server-side rendering Top Stories & Comments #47
Merged
Commits on Jun 6, 2016
-
Configuration menu - View commit details
-
Copy full SHA for b91e4db - Browse repository at this point
Copy the full SHA b91e4dbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8a4ba60 - Browse repository at this point
Copy the full SHA 8a4ba60View commit details -
Configuration menu - View commit details
-
Copy full SHA for cec4902 - Browse repository at this point
Copy the full SHA cec4902View commit details -
Adds hn-server-fetch using unofficial Firebase API
The official Firebase API (https://github.com/HackerNews/API) requires multiple network connections to be made in order to fetch the list of Top Stories (indices) and then the summary content of these stories. Directly requesting these resources makes server-side rendering cumbersome as it is slow and ultimately requires that you maintain your own cache to ensure full server renders are efficient. To work around this problem, we can use one of the unofficial Hacker News APIs, specifically https://github.com/cheeaun/node-hnapi which directly returns the Top Stories and can cache responses for 10 minutes. In ReactHN, we can use the unofficial API for a static server-side render and then 'hydrate' this once our components have mounted to display the real-time experience. The benefit of this is clients loading up the app that are on flakey networks (or lie-fi) can still get a fast render of content before the rest of our JavaScript bundle is loaded.
Configuration menu - View commit details
-
Copy full SHA for d5b6111 - Browse repository at this point
Copy the full SHA d5b6111View commit details -
Configuration menu - View commit details
-
Copy full SHA for cf0c57a - Browse repository at this point
Copy the full SHA cf0c57aView commit details -
Configuration menu - View commit details
-
Copy full SHA for e9e1071 - Browse repository at this point
Copy the full SHA e9e1071View commit details
Commits on Jun 19, 2016
-
Configuration menu - View commit details
-
Copy full SHA for 2c91e17 - Browse repository at this point
Copy the full SHA 2c91e17View commit details -
Configuration menu - View commit details
-
Copy full SHA for d73147c - Browse repository at this point
Copy the full SHA d73147cView commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.