summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2020-05-22 17:46:39 +0200
committerGitHub <noreply@github.com>2020-05-22 12:46:39 -0300
commit655def514116f67a11986a3dd6edd768e9ac9447 (patch)
tree6788be6088df0bab13329604f3d33517548e1f01 /modules
parent2042cf2cce64b64ae2693f4faf39f6077b0be5d6 (diff)
downloadgitea-655def514116f67a11986a3dd6edd768e9ac9447.tar.gz
gitea-655def514116f67a11986a3dd6edd768e9ac9447.zip
Move serviceworker to workbox and fix SSE interference (#11538) (#11547)
* Move serviceworker to workbox and fix SSE interference Instead of statically hardcoding every frontend asset, this uses a type-based approach to cache all js,css and manifest.json requests. This also fixes the issue that the service worker was interfering with EventSource because it was unconditionally handling all requests which this new implementation doesn't. Fixes: https://github.com/go-gitea/gitea/issues/11092 Fixes: https://github.com/go-gitea/gitea/issues/7372 * rethrow error instead of logging * await .register * Revert "rethrow error instead of logging" This reverts commit 043162ba1f18b98a4bf9635959fd28d16e839fc5. * improve comment * remove JSRenderer * add version-based cache invalidation * refactor * more refactor * remove comment * rename item to fit cache name Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
Diffstat (limited to 'modules')
-rw-r--r--modules/templates/dynamic.go12
-rw-r--r--modules/templates/static.go9
2 files changed, 0 insertions, 21 deletions
diff --git a/modules/templates/dynamic.go b/modules/templates/dynamic.go
index 6153e8d027..bd1c4d06c5 100644
--- a/modules/templates/dynamic.go
+++ b/modules/templates/dynamic.go
@@ -48,18 +48,6 @@ func JSONRenderer() macaron.Handler {
})
}
-// JSRenderer implements the macaron handler for serving JS templates.
-func JSRenderer() macaron.Handler {
- return macaron.Renderer(macaron.RenderOptions{
- Funcs: NewFuncMap(),
- Directory: path.Join(setting.StaticRootPath, "templates"),
- AppendDirectories: []string{
- path.Join(setting.CustomPath, "templates"),
- },
- HTMLContentType: "application/javascript",
- })
-}
-
// Mailer provides the templates required for sending notification mails.
func Mailer() (*texttmpl.Template, *template.Template) {
for _, funcs := range NewTextFuncMap() {
diff --git a/modules/templates/static.go b/modules/templates/static.go
index 5bc4e33e1c..a3aff5e567 100644
--- a/modules/templates/static.go
+++ b/modules/templates/static.go
@@ -132,15 +132,6 @@ func JSONRenderer() macaron.Handler {
})
}
-// JSRenderer implements the macaron handler for serving JS templates.
-func JSRenderer() macaron.Handler {
- return macaron.Renderer(macaron.RenderOptions{
- Funcs: NewFuncMap(),
- TemplateFileSystem: NewTemplateFileSystem(),
- HTMLContentType: "application/javascript",
- })
-}
-
// Mailer provides the templates required for sending notification mails.
func Mailer() (*texttmpl.Template, *template.Template) {
for _, funcs := range NewTextFuncMap() {