{"id":13417788,"url":"https://github.com/justinribeiro/blog-pwa","last_synced_at":"2025-04-08T04:17:38.497Z","repository":{"id":16038293,"uuid":"78879659","full_name":"justinribeiro/blog-pwa","owner":"justinribeiro","description":"Combining Lit Web Components, Hugo, Service Worker, and Rollup into a progressive web app blog.","archived":false,"fork":false,"pushed_at":"2025-03-21T22:05:36.000Z","size":20795,"stargazers_count":54,"open_issues_count":9,"forks_count":13,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T08:21:12.542Z","etag":null,"topics":["blog","hugo","lit-element","progressive-web-app","prpl-pattern","pwa","service-worker","web-components"],"latest_commit_sha":null,"homepage":"https://justinribeiro.com","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/justinribeiro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"justinribeiro","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2017-01-13T19:27:48.000Z","updated_at":"2025-03-21T22:05:42.000Z","dependencies_parsed_at":"2023-02-18T03:45:56.161Z","dependency_job_id":"ea34d7e7-443d-413c-988d-4073ae3f4640","html_url":"https://github.com/justinribeiro/blog-pwa","commit_stats":{"total_commits":302,"total_committers":3,"mean_commits":"100.66666666666667","dds":0.01655629139072845,"last_synced_commit":"15917683d19f3202381deabac518778612cd1bc7"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justinribeiro%2Fblog-pwa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justinribeiro%2Fblog-pwa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justinribeiro%2Fblog-pwa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/justinribeiro%2Fblog-pwa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/justinribeiro","download_url":"https://codeload.github.com/justinribeiro/blog-pwa/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247773721,"owners_count":20993639,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blog","hugo","lit-element","progressive-web-app","prpl-pattern","pwa","service-worker","web-components"],"created_at":"2024-07-30T22:00:52.654Z","updated_at":"2025-04-08T04:17:38.467Z","avatar_url":"https://github.com/justinribeiro.png","language":"HTML","funding_links":["https://github.com/sponsors/justinribeiro"],"categories":["PWA"],"sub_categories":[],"readme":"# blog-pwa\n\nWhat started as an experiment in 2017 mixing Hugo, Polymer, and the PRPL pattern to build a progressive web app turned into a very robust and fast engine that powers my blog. As the web platform grows, so does this engine.\n\n## Features\n\n* It's a progressive web app with all the fixin's (service worker, PRPL pattern, H3, et cetera)\n* The base PWA component and it's bundle weigh just *15.1KB* gzip'ed on the wire.\n* Renders if there is no JavaScript via `\u003cnoscript\u003e` injected fallback to static generation\n* Renders metadata to linkbots when sharing without the need for client JavaScript via server side detection and alternative render path\n\n## The basics\n\n* [lit](https://lit.dev/) powers the app shell and web components, with a few vanilla web components for good measure.\n* [hugo](https://gohugo.io/) to write and manage posts and page metadata\n* [workbox](https://developers.google.com/web/tools/workbox/) for generating precache and runtime caching service worker\n* [rollup](https://rollupjs.org) for handling the bundles and splitting for our PRPL lazy loading goodness\n* [h2-push via http2push-gae](https://github.com/GoogleChrome/http2push-gae) for Google App Engine for serving\n\n## The not-so-basics\n\nI wrote a couple `zsh` utility scripts to power most of the shuffle and build of the site. Why not an `npm` script or a `gulp` or `grunt` task you ask? Frankly, because I just felt like writing some shell scripts. Don't you want to sometimes just write some shell scripts? Is that just me?\n\nThe gist of the tools employed and their uses include.\n\n* `sed` is amazing and helps wrangle some of the JSON output from Hugo (years of old posts + multiple times moved = fun!)\n* `zmv` is the thing you've probably never heard of about but might want to try. Renames files fast to proper type (Hugo won't output pure JSON at moment)\n* `jq` is blazing fast over lots of files; validates my json output so I know things will load in the PWA and Python\n* `@web/dev-server` handles the dev serving\n* `workbox-cli` handles the service worker generation\n* `rollup-cli` handles the es modules and bundles splitting for prod builds\n* `http2-push-manifest` is super useful and works out of the box with http2push-gae\n* `make` has a basic set of commands that alias the zsh script for easy use\n* Okay, so there is `app/package.json` with prettier linting and some build commands in the yarn for rollup and what not. It's mix and match. :-)\n\n## Setup\n\n```bash\n➜ git clone git@github.com:justinribeiro/blog-pwa.git\n➜ cd blog-pwa\n➜ chmod +x utilities/builder.zsh\n\n# check for tooling\n➜ make setup\n\n# run dev env\n➜ make dev\n\n# run GAE deploy silently\n➜ make deploy-no-promote\n```\n\n## By the web perf numbers\n\nA progressive web app is only as good as the web performance it offers. I mean, who wants to sit around waiting 10 seconds for a blog post to initially load? No one.\n\nPulling up a trusty Moto G4 on 3G over on WebPageTest, we can see just how fast we are:\n\n2024:\n\n![image](https://github.com/justinribeiro/blog-pwa/assets/643503/be369fa5-ab6e-4a03-be8a-8f64c9fdb402)\n\n2023:\n\n![image](https://github.com/justinribeiro/blog-pwa/assets/643503/86c59596-c432-4eec-bb9d-86a850e097a7)\n\n2019:\n\n![image](https://user-images.githubusercontent.com/643503/73583203-bd71b780-4445-11ea-9f2a-4a3261da0346.png)\n\nJust want the traces and the raw numbers? Check out the [results on WebPageTest](https://www.webpagetest.org/result/200131_XN_c40dba83cf1a2d53e7121d356bad1e32/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustinribeiro%2Fblog-pwa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjustinribeiro%2Fblog-pwa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjustinribeiro%2Fblog-pwa/lists"}