-
Improvement
-
Resolution: Fixed
-
Blocker
-
4.3
-
MOODLE_403_STABLE
-
MOODLE_403_STABLE
-
MDL-78266-master -
I'm raising this partially because it's a blocker to JS Unit testing, but partially because it makes sense.
We currently have a monolithic core/templates module which is responsible for:
- fetching templates
- caching templates
- rendering templates
- inserting template content into the DOM
This is unsustainable for several reasons:
- it's now a massive file which is hard to maintain, and understand
- it makes it damned near impossible to provide an alternative way to fetch templates when WS are not available (e.g. in unit tests).
I'm raising this issue to break apart the core/templates module into:
- core/templates - the entrypoint and b/c layer providing all of the DOM manipulation
- core/local/templates/renderer - the Renderer class and management
- core/local/templates/loader - responsible for fetching and caching of templates