Git Product home page Git Product logo

pwa-starter-kit-hn's Introduction

Built with pwa–starter–kit

pwa-starter-kit-hn

A Hacker News client built using PWA Starter Kit. Using the starter-template as the starting point and the wiki for configuring and personalizing.

screenshot

Features/highlights

  • Updating the Redux store from an API
  • Lazy-load actions, components, and reducers

Setup

  • npm i
  • npm start (or any static file server for single page apps, like serve -s)

Building & Deploying

See the Building & Deploying section in the pwa-starter-kit wiki.

HTTP/2 push optimized build

The push-proxy branch contains an optimized version of the prpl-server build that uses a proxy for Hacker News API requests so that it can use HTTP/2 server push for the initial API request as well. This is the build currently hosted on https://pwa-starter-kit-hn.appspot.com/.

Routing

Client side routing is done by the pwa-helpers/router.js library, which intercept link clicks and dispatches the updateLocation action to the store. A state computed from the value of window.location is stored, and the rest of the app renders based on that state (never on window.location directly). history.pushState is called by the router library before the action is dispatched, meaning that window.location won't actually modify when using time-travel debugging. popstate events (e.g. browser back) will just dispatch the updateLocation action.

Lazy-loading

Dynamically-loaded elements are loaded as a side-effect by the updateLocation action in src/actions/app.js. These elements may export actions and selectors that are asynchronously used by the updateLocation action for a particular page.

File structure

  • actions/
  • reducers/
  • components/
    • Custom element definitions that are statically or dynamically imported. Dynamically-imported components may also export functions that are used by the updateLocation action.

pwa-starter-kit-hn's People

Contributors

keanulee avatar abdonrd avatar frankiefu avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.