forgejo/modules
zeripath bb0ff77e46
Share HTML template renderers and create a watcher framework (#20218)
The recovery, API, Web and package frameworks all create their own HTML
Renderers. This increases the memory requirements of Gitea
unnecessarily with duplicate templates being kept in memory.

Further the reloading framework in dev mode for these involves locking
and recompiling all of the templates on each load. This will potentially
hide concurrency issues and it is inefficient.

This PR stores the templates renderer in the context and stores this
context in the NormalRoutes, it then creates a fsnotify.Watcher
framework to watch files.

The watching framework is then extended to the mailer templates which
were previously not being reloaded in dev.

Then the locales are simplified to a similar structure.

Fix #20210 
Fix #20211
Fix #20217

Signed-off-by: Andrew Thornton <art27@cantab.net>
2022-08-28 10:43:25 +01:00
..
activitypub Refactor AssertExistsAndLoadBean to use generics (#20797) 2022-08-16 10:22:25 +08:00
analyze
appstate
auth
avatar
base
cache
charset Share HTML template renderers and create a watcher framework (#20218) 2022-08-28 10:43:25 +01:00
container
context Share HTML template renderers and create a watcher framework (#20218) 2022-08-28 10:43:25 +01:00
convert Move some files into models' sub packages (#20262) 2022-08-25 10:31:57 +08:00
csv
doctor Move some files into models' sub packages (#20262) 2022-08-25 10:31:57 +08:00
emoji
eventsource Move some files into models' sub packages (#20262) 2022-08-25 10:31:57 +08:00
generate
git Set no-tags in git fetch on compare (#20893) 2022-08-23 14:12:43 -04:00
gitgraph
graceful Support Proxy protocol (#12527) 2022-08-21 19:20:43 +01:00
hcaptcha
highlight Rework file highlight rendering and fix yaml copy-paste (#19967) 2022-07-30 21:17:43 +02:00
hostmatcher Add proxy host into allow list (#20798) 2022-08-16 20:15:54 -04:00
httpcache Add Cache-Control header to html and api responses, add no-transform (#20432) 2022-07-23 14:38:03 +08:00
httplib
indexer
json
lfs Removed some vestigial code related to Range bounds checks (#20312) 2022-07-28 11:04:36 +08:00
log Disable doctor logging on panic (#20847) 2022-08-18 21:27:27 -04:00
markup Should also support upper-case README files (#20581) 2022-08-01 20:15:40 +08:00
mcaptcha Add support mCaptcha as captcha provider (#20458) 2022-08-10 15:20:10 +02:00
metrics Move some files into models' sub packages (#20262) 2022-08-25 10:31:57 +08:00
migration
mirror
nosql
notification Move some files into models' sub packages (#20262) 2022-08-25 10:31:57 +08:00
options Share HTML template renderers and create a watcher framework (#20218) 2022-08-28 10:43:25 +01:00
packages Add migrate repo archiver and packages storage support on command line (#20757) 2022-08-16 12:05:15 +08:00
paginator
password
pprof
private Support Proxy protocol (#12527) 2022-08-21 19:20:43 +01:00
process
proxy
proxyprotocol Support Proxy protocol (#12527) 2022-08-21 19:20:43 +01:00
public
queue
recaptcha
references
regexplru
repository Move some files into models' sub packages (#20262) 2022-08-25 10:31:57 +08:00
secret
session
setting Only show relevant repositories on explore page (#19361) 2022-08-25 20:38:41 +02:00
sitemap
ssh Support Proxy protocol (#12527) 2022-08-21 19:20:43 +01:00
storage
structs Add new API endpoints for push mirrors management (#19841) 2022-07-30 18:45:59 +02:00
svg
sync
templates Share HTML template renderers and create a watcher framework (#20218) 2022-08-28 10:43:25 +01:00
test Refactor AssertExistsAndLoadBean to use generics (#20797) 2022-08-16 10:22:25 +08:00
timeutil Share HTML template renderers and create a watcher framework (#20218) 2022-08-28 10:43:25 +01:00
translation Share HTML template renderers and create a watcher framework (#20218) 2022-08-28 10:43:25 +01:00
typesniffer Rework raw file http header logic (#20484) 2022-07-29 17:26:55 +02:00
updatechecker
upload
uri
user
util Share HTML template renderers and create a watcher framework (#20218) 2022-08-28 10:43:25 +01:00
validation
watcher Share HTML template renderers and create a watcher framework (#20218) 2022-08-28 10:43:25 +01:00
web refactor webhook *NewPost (#20729) 2022-08-11 17:48:23 +02:00