2 ms·
Interesting that it‘s possible to do it with a single HTML file, the icons and manifest being dynamically generated in JS and set as data URLs. I wonder if that
by alex_suzuki 1y ago
Interesting that it‘s possible to do it with a single HTML file, the icons and manifest being dynamically generated in JS and set as data URLs. I wonder if that works reliably.
It‘s in the same repo:
https://github.com/chr15m/minimal-pwa/blob/main/single-file-pwa.html https://github.com/chr15m/minimal-pwa/blob/main/single-file-...
- edoceo 1y agoFavicon defined as SVG in the HTML then converted to PNG. That's a neat trick.
- pseudosavant 1y agoI’ve been using this technique for years in this project: https://github.com/pseudosavant/player.html https://github.com/pseudosavant/player.html A single HTML file with favicon, manifest, SVG icons, etc.
- alex_suzuki 1y agoNeat, thanks for sharing! Having no build step and no dependencies is such a power move. ;) Any gotchas with this approach that you‘re aware of? Can this approach handle updates? I thought the way to do that was usually to check some hash in the manifest and prompt the user that an update is available if it has changed.
- pseudosavant 1y agoThe biggest gotcha I've run into is that having everything in one file makes for a lot of tokens for LLMs to chew on or create when I code. The next iteration of that project will still have an equivalent `player.html` file that contains everything, but I am making a very basic build script so that it is easier for LLMs like GitHub Copilot to work on the project in parts.
- smusamashah 1y agoThis is awesome. Tried to search for other HTML only repos on Github using "language:HTML NOT language:JavaScript" but it doesn't return anything. Not even this repo. Was following https://docs.github.com/en/search-github/github-code-search/understanding-github-code-search-syntax#using-boolean-operations https://docs.github.com/en/search-github/github-code-search/...