-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Remove the ServiceWorker and manifest.json #12400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Is there no way we can stick monaco in the serviceworker to reduce the time it takes for that to start working? |
With no ServiceWorker, we still have the regular HTTP cache of the browser so things like Monaco will still be in there. |
Monaco is just one big chunk of JS (4MB) which takes time to execute even if the source files are cached. It may be worth to revisit #12193 |
Not against (in fact strongly in favor) but as discussed before it will be a breaking change for those using or relying on Gitea being PWA. |
I don't see how this could be breaking. The ServiceWorker was only used to cache assets. None of those assets can work standalone without the server available so there was never any offline functionality. |
https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps/Installable_PWAs Simply speaking the 'Install' icon wont show anymore to create easy shortcut and open Gitea in its own window. Pretty useless for us to be honest, but nonetheless it will change the behavior. |
Might as well drop manifest.json too as it won't be used without SW |
Indeed, removing manifest.json might be a good idea to eliminate another HTTP request on every page. It currently pretty much only serves to set |
There is barely any performance benefit of SW-based caching and it causes a lot of issues after updating a instance and when the cache is stale, causing weird UI issues like chunk loading errors and other unexpected behaviour. I kept the unregistration in the code so existing serviceworkers will properly uninstall after an update. We may be able to eventually drop the code completely in a future version after most users have ran the uninstallation. manifest.json is removed because it serves no real purpose without a serviceworker and to eliminate another HTTP request for the sake of performance. Fixes: go-gitea#12344
manifest.json removed as well and updated OP with a issue reference. |
Removed two images that were only used in manifest.json and README (replaced it with the SVG there). |
Codecov Report
@@ Coverage Diff @@
## master #12400 +/- ##
=======================================
Coverage 43.80% 43.80%
=======================================
Files 630 631 +1
Lines 69821 69844 +23
=======================================
+ Hits 30585 30596 +11
- Misses 34300 34305 +5
- Partials 4936 4943 +7
Continue to review full report at Codecov.
|
Will not this affect future Push notifications? #10884 |
I guess it'd be possible to keep the SW but just disable the (broken) asset caching, so it essentially would do nothing. |
Wouldn't it be better to just change the |
Hmm, actually not a bad idea but I'd introduce a new config switch that controls whether the caching is enabled (off by default). When no SW-managed feature is enabled (currently there's only one), uninstall it. |
cool, that'd do very well, too :) |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 months. Thank you for your contributions. |
Please resolve the conflicts. |
Don't think I'll pursue this anymore. I have a fix in mind using |
There is barely any performance benefit of SW-based caching and it causes a lot of issues after updating a instance and when the cache is stale, causing weird UI issues like chunk loading errors and other unexpected behaviour.
I kept the unregistration in the code so existing serviceworkers will properly uninstall after an update. We may be able to eventually drop the code completely in a future version after most users have ran the uninstallation.
manifest.json is removed because it serves no real purpose without a serviceworker and to eliminate another HTTP request for the sake of performance.
Fixes: #12344