Because of Page-Previews the mustache compiler is going to be sent to the desktop site by default.
Mustache templates in Page-Previews should be precompiled to JS and included in the asset bundle in development so that we don't have to send the mustache compiler to the client.
We also should be able to quantify the changes in size of assets sent to the client and performance of using pre-compiled templates for future decisions.
Approach
- Add mustache loaders to webpack config and require template files from src/ sources where used
- Measure and document pre and post change size and performance
- Document on wiki and ADR
AC
- Mustache templates are required by the JS files that use them
- Mustache templates and the mustache compiler are not sent by the ResourceLoader and do not show up in extension.json
- We have documentation and metrics pre and post this patch regarding size of assets sent to client and JS performance impact
- If worth it after analysis, write an ADR documenting the change and decision, and merge patches for production.
Research, POC and proposal to decline this task: T160058#3167873