feat(tinytorch): make the website an installable PWA - #1944
Closed
farhan523 wants to merge 1 commit into
Closed
Conversation
Add web app manifest, service worker, and app icons so the TinyTorch site can be installed to the home screen and read offline. - manifest.webmanifest with relative start_url/scope so it works both at mlsysbook.ai/tinytorch/ and in local previews; any + maskable icons generated from the flame mark in logo-tinytorch-simple.png - sw.js: network-first for pages (never stale after a deploy, cached fallback offline, branded offline page as last resort), stale-while-revalidate for same-origin css/js/images/fonts, passthrough for JSON/data so release-manifest and search stay live - assets/scripts/pwa.html registers the worker at the site base path, derived at runtime since pages render at several directory depths - fix apple-touch-icon to a real 180x180 icon (the old href pointed at the 583x328 wordmark)
Shashank-Tripathi-07
left a comment
Collaborator
There was a problem hiding this comment.
Hey @farhan523 .
Totally like and appreciate the idea of bringing TinyTorch from the current infra to a PWA, but we're currently focusing on stabilizing and making the current TinyTorch system so as to prepare for it's major release and hence, I can't merge this PR and I've to close it. You can instead focus on surgical changes and changes that make TinyTorch better for release rather than pushing major changes to TinyTorch for now. Thanks !
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes the TinyTorch site (mlsysbook.ai/tinytorch/) an installable Progressive Web App with offline reading support.
manifest.webmanifest— installability metadata with relativestart_url/scopeso it resolves correctly both under/tinytorch/in production and in local previews served at the root. Includesany+maskableicons (192/512) generated from the flame mark inlogo-tinytorch-simple.png, themed with the existing#D4740Cbrand color.sw.js(service worker) — conservative caching tuned for a frequently-deployed docs site:release-manifest.json,search.json, and any fetch/XHR always hit the network, so the release pill and search never go stale.assets/scripts/pwa.html— registers the worker at the site base path, derived at runtime because pages render at several directory depths and the site root differs between production (/tinytorch/) and previews (/). Registration is skipped silently on insecure contexts.<link>and icon use leading-/project-relative hrefs, which Quarto relativizes per page depth.No changes to page content or build tooling;
quarto renderoutput just gains the manifest, worker, and icons via the existingresources:mechanism, so the publish workflow deploys them as-is.Testing
quarto renderpasses; verified the manifest link and icon hrefs relativize correctly at all page depths (index.html,modules/,tito/)._buildlocally: all PWA URLs return 200, manifest parses,node --check sw.jspasses.