Giter Club home page Giter Club logo

Comments (7)

westonruter avatar westonruter commented on August 14, 2024 1

A placeholder image is an interesting one, but a challenge is making one that scales at all aspect ratios in a way that it doesn't look horrible. Hopefully 404 images should be rare anyway, right?

For the PWA plugin, you can refer to my child theme of Twenty Seventeen to see some integrations: https://github.com/westonruter/twentyseventeen-westonson

In particular:

Note that WPRig has added support for the offline/500 templates as well: wprig/wprig#212

Beyond these aspects, the rest is really up to the specific site's needs. For instance, adding support for SPA (app shell) via AMP you can refer to this un-merged PR: ampproject/amp-wp#1519

👉 The PWA plugin would value your feedback from integrating. It's overdue for releasing 0.2 on WordPress.org, so any feedback you can give would help in that regard to push out the next release.

from theme-scaffold.

westonruter avatar westonruter commented on August 14, 2024 1

My next thought was to place it at the root of the theme, but this still traps us a bit. Ideally, we need to place the service worker in the root install of a project.

@dainemawer Could you please use the PWA feature plugin for this? It handles this for you.

Aside: We're about to release 0.2 on WordPress.org.

from theme-scaffold.

timwright12 avatar timwright12 commented on August 14, 2024

Write up about a service worker template: https://madebymike.com.au//writing/service-workers/

from theme-scaffold.

colorful-tones avatar colorful-tones commented on August 14, 2024

Perhaps some integration with PWA plugin (Google, Automattic, XWP) hooks if the plugin is active?

Examples:

from theme-scaffold.

Firestorm980 avatar Firestorm980 commented on August 14, 2024

Think a simple service worker to potentially provide:

  • "Offline" page
  • Image placeholder (loads a branded image for the site if the image 404s)

May be a good baseline for inclusion.

from theme-scaffold.

dainemawer avatar dainemawer commented on August 14, 2024

@timwright12 I've added a manifest file and tested. Heres the output of Lighthouse's Audit:
Screen Shot 2019-04-16 at 07 33 25

Just waiting on write access to the repo, which I pinged you about in Slack.
I looked into the Service Worker as well. Service Workers are scoped to whatever folder structure they are found in, so for instance, if the Service Worker is placed in dist/js/sw.js - its scope only applies to the dist folder. My next thought was to place it at the root of the theme, but this still traps us a bit. Ideally, we need to place the service worker in the root install of a project.

I wasn't sure what would be the best way of handling that. I've seen some suggestions on using symbolic links which we could maybe setup using bash in our build scripts or execute via node / webpack. A further discussion around what we actually want the Service Worker to handle may help us get a better idea of where to place it.

from theme-scaffold.

westonruter avatar westonruter commented on August 14, 2024

The PWA plugin v0.2 was released last week: https://wordpress.org/plugins/pwa/

from theme-scaffold.

Related Issues (20)

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.