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

Add support for server-side rendering Top Stories & Comments #47

Merged
merged 8 commits into from
Jun 23, 2016

Commits on Jun 6, 2016

  1. Configuration menu
    Copy the full SHA
    b91e4db View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8a4ba60 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    cec4902 View commit details
    Browse the repository at this point in the history
  4. 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.
    addyosmani committed Jun 6, 2016
    Configuration menu
    Copy the full SHA
    d5b6111 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    cf0c57a View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    e9e1071 View commit details
    Browse the repository at this point in the history

Commits on Jun 19, 2016

  1. Configuration menu
    Copy the full SHA
    2c91e17 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d73147c View commit details
    Browse the repository at this point in the history