Skip to content
This repository has been archived by the owner on Dec 15, 2018. It is now read-only.

Service Worker (offline) support #29

Open
addyosmani opened this issue Mar 15, 2016 · 4 comments
Open

Service Worker (offline) support #29

addyosmani opened this issue Mar 15, 2016 · 4 comments

Comments

@addyosmani
Copy link
Collaborator

  • Cache the application "shell"
    • index.html
    • critical styles for the page that form the UI - we likely need to generate this for a first-pass and then tweak for both the mobile and desktop views so that first 14KB contains as much value as possible.
    • async/defer load in the script bundle for the rest of the app, but cache that too
    • Unsure what this block of script is doing. Any insight? :)
  • Cache the rest of the application assets
  • Tooling
    • I wouldn't mind PR'ing in support for using sw-precache and sw-toolbox to get the above SW support working. Any concerns about using those for the offline support?
@zenorocha
Copy link
Member

Cool, let me explain how things are structured right now.

There are two projects:

Both are static applications, the first one is hosted on Firebase and the second one is hosted on GitHub Pages. The reason why they are separated is because on Electron I can just load the app URL and forget about the landing page.

Firebase is being used to store user data:

{
  "columns": [
    {
      "payload": "addyosmani",
      "type": "Home"
    },
    {
      "payload": "addyosmani",
      "type": "User"
    },
    {
      "payload": "polymerelements/polymer-starter-kit",
      "type": "Repository"
    }
  ],
  "settings": {
    "columnSize": "column-medium",
    "fontSize": "font-medium",
    "theme": "dark"
  }
}

That script you asked about is a third-party thing that I use to track navigation (https://www.inspectlet.com/).

I'm ok with using sw-precache and sw-toolbox.

Until now, I haven't spend much time optimizing the app's performance, so feel free to send a PR and suggest anything.

@addyosmani
Copy link
Collaborator Author

👍 Will try to find time this week to study the source more closely and put something together :)

@zenorocha
Copy link
Member

I decided to give it a shot on the landing page which is way easier than this.

Could you take a look? https://github.com/zenorocha/devspace.io/commit/9e99b094fec7d02c7f38ddb55caf5cb391c6788e

@addyosmani
Copy link
Collaborator Author

Is there currently a way to build a version of the app locally that doesn't run through Electron? :) Or when you're developing do you mostly use Electron and DevTools there for debugging? Figuring out your flow so I don't mess up your build system when adding this :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants