Enhance PWA support with icons, manifest, and service worker#37
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
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.
This pull request migrates the app's Progressive Web App (PWA) implementation from Workbox and
vite-plugin-pwato the Serwist library for service worker generation and registration. It also refactors how PWA metadata and service worker registration are handled in the codebase, and cleans up related dependencies and configuration.Migration to Serwist for PWA support:
Service Worker Implementation and Registration:
vite-plugin-pwa,workbox-*) with a new implementation using Serwist, including a newapp/sw.tsfile that configures runtime caching strategies for navigation and images. ([app/sw.tsR1-R46](https://github.com/Barata-Ribeiro/utilities_webapp/pull/37/files#diff-8701c7015634957e3ea713dc64f6ef2a2eb0fb73a112927f578543dab2096ea9R1-R46))SwRegisterReact component to handle service worker registration, replacing the priorPWABadgecomponent and removing its UI and logic. ([[1]](https://github.com/Barata-Ribeiro/utilities_webapp/pull/37/files#diff-e15008eea66d3653e8d8f5e3d41002ea15d5522e7384f3611365443166408bedR1-R94),[[2]](https://github.com/Barata-Ribeiro/utilities_webapp/pull/37/files#diff-ad25ca7ae4726d1951d886e40f376aefec5d323ced93307a8f38c23ac440b87dL1-L86),[[3]](https://github.com/Barata-Ribeiro/utilities_webapp/pull/37/files#diff-4bac017a0c91c7b1da193d9642c4a9810df6f5afc3c939dfe93f2e777d99f1a3L4-R4),[[4]](https://github.com/Barata-Ribeiro/utilities_webapp/pull/37/files#diff-4bac017a0c91c7b1da193d9642c4a9810df6f5afc3c939dfe93f2e777d99f1a3L40-R40))Build and Dependency Updates:
vite.config.tsto use the Serwist Vite plugin for service worker generation and removes all Workbox andvite-plugin-pwaconfiguration and dependencies. ([[1]](https://github.com/Barata-Ribeiro/utilities_webapp/pull/37/files#diff-6a3b01ba97829c9566ef2d8dc466ffcffb4bdac08706d3d6319e42e0aa6890ddR2-L5),[[2]](https://github.com/Barata-Ribeiro/utilities_webapp/pull/37/files#diff-6a3b01ba97829c9566ef2d8dc466ffcffb4bdac08706d3d6319e42e0aa6890ddL21-L164),[[3]](https://github.com/Barata-Ribeiro/utilities_webapp/pull/37/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R60-R61),[[4]](https://github.com/Barata-Ribeiro/utilities_webapp/pull/37/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R75-R81))package.jsonand removes obsolete PWA-related dependencies. ([[1]](https://github.com/Barata-Ribeiro/utilities_webapp/pull/37/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R60-R61),[[2]](https://github.com/Barata-Ribeiro/utilities_webapp/pull/37/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R75-R81))PWA Metadata and Manifest:
PwaMetadatacomponent, which is rendered in the app's root layout, and adds a newpublic/manifest.jsonfile for the web app manifest. ([[1]](https://github.com/Barata-Ribeiro/utilities_webapp/pull/37/files#diff-5a95750f81ae7556b08ad02cfbfc2269d7b0a4e38f935bddf14fcc29bae2879bR1-R38),[[2]](https://github.com/Barata-Ribeiro/utilities_webapp/pull/37/files#diff-4133eb55408b25b35b8e07c696a9dfc97b741c555d7407e8c86d0845e5eecc28R6),[[3]](https://github.com/Barata-Ribeiro/utilities_webapp/pull/37/files#diff-4133eb55408b25b35b8e07c696a9dfc97b741c555d7407e8c86d0845e5eecc28L35-R37),[[4]](https://github.com/Barata-Ribeiro/utilities_webapp/pull/37/files#diff-639916bc14c3f311c31f629a2ec116292a4b2f64d06b3607b9ddd2e495703895R1-R24))Other:
.well-knownfor completeness. ([public/.well-known/appspecific/com.chrome.devtools.jsonR1](https://github.com/Barata-Ribeiro/utilities_webapp/pull/37/files#diff-5a4bdca01f732c6cfe38a7c88f2c350cb3c1067a4b9eaf2fca18e394b74faab7R1))Summary of the most important changes:
PWA Migration (Serwist):
vite-plugin-pwawith Serwist for service worker generation and registration, including new caching strategies inapp/sw.ts. ([[1]](https://github.com/Barata-Ribeiro/utilities_webapp/pull/37/files#diff-8701c7015634957e3ea713dc64f6ef2a2eb0fb73a112927f578543dab2096ea9R1-R46),[[2]](https://github.com/Barata-Ribeiro/utilities_webapp/pull/37/files#diff-6a3b01ba97829c9566ef2d8dc466ffcffb4bdac08706d3d6319e42e0aa6890ddR2-L5),[[3]](https://github.com/Barata-Ribeiro/utilities_webapp/pull/37/files#diff-6a3b01ba97829c9566ef2d8dc466ffcffb4bdac08706d3d6319e42e0aa6890ddL21-L164))SwRegistercomponent for service worker registration and removes the oldPWABadgeUI and logic. ([[1]](https://github.com/Barata-Ribeiro/utilities_webapp/pull/37/files#diff-e15008eea66d3653e8d8f5e3d41002ea15d5522e7384f3611365443166408bedR1-R94),[[2]](https://github.com/Barata-Ribeiro/utilities_webapp/pull/37/files#diff-ad25ca7ae4726d1951d886e40f376aefec5d323ced93307a8f38c23ac440b87dL1-L86),[[3]](https://github.com/Barata-Ribeiro/utilities_webapp/pull/37/files#diff-4bac017a0c91c7b1da193d9642c4a9810df6f5afc3c939dfe93f2e777d99f1a3L4-R4),[[4]](https://github.com/Barata-Ribeiro/utilities_webapp/pull/37/files#diff-4bac017a0c91c7b1da193d9642c4a9810df6f5afc3c939dfe93f2e777d99f1a3L40-R40))Build and Dependency Cleanup:
vite.config.tsto use the Serwist plugin and removes all Workbox andvite-plugin-pwaconfiguration. Updates dependencies inpackage.jsonaccordingly. ([[1]](https://github.com/Barata-Ribeiro/utilities_webapp/pull/37/files#diff-6a3b01ba97829c9566ef2d8dc466ffcffb4bdac08706d3d6319e42e0aa6890ddR2-L5),[[2]](https://github.com/Barata-Ribeiro/utilities_webapp/pull/37/files#diff-6a3b01ba97829c9566ef2d8dc466ffcffb4bdac08706d3d6319e42e0aa6890ddL21-L164),[[3]](https://github.com/Barata-Ribeiro/utilities_webapp/pull/37/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R60-R61),[[4]](https://github.com/Barata-Ribeiro/utilities_webapp/pull/37/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R75-R81))PWA Manifest and Metadata:
PwaMetadatacomponent and adds a newpublic/manifest.jsonfile. ([[1]](https://github.com/Barata-Ribeiro/utilities_webapp/pull/37/files#diff-5a95750f81ae7556b08ad02cfbfc2269d7b0a4e38f935bddf14fcc29bae2879bR1-R38),[[2]](https://github.com/Barata-Ribeiro/utilities_webapp/pull/37/files#diff-4133eb55408b25b35b8e07c696a9dfc97b741c555d7407e8c86d0845e5eecc28R6),[[3]](https://github.com/Barata-Ribeiro/utilities_webapp/pull/37/files#diff-4133eb55408b25b35b8e07c696a9dfc97b741c555d7407e8c86d0845e5eecc28L35-R37),[[4]](https://github.com/Barata-Ribeiro/utilities_webapp/pull/37/files#diff-639916bc14c3f311c31f629a2ec116292a4b2f64d06b3607b9ddd2e495703895R1-R24))Miscellaneous:
.well-known. ([public/.well-known/appspecific/com.chrome.devtools.jsonR1](https://github.com/Barata-Ribeiro/utilities_webapp/pull/37/files#diff-5a4bdca01f732c6cfe38a7c88f2c350cb3c1067a4b9eaf2fca18e394b74faab7R1))