mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 08:51:05 +08:00
DEV: Remove Discourse.RAW_TEMPLATES
(#9630)
We were sharing `Discourse` both as an application object and a namespace which complicated things for Ember CLI. This patch moves raw templates into `__DISCOURSE_RAW_TEMPLATES` and adds a couple helper methods to create/remove them.
This commit is contained in:
@ -195,9 +195,9 @@ class ThemeJavascriptCompiler
|
||||
compiled = RawTemplatePrecompiler.new(@theme_id).compile(hbs_template)
|
||||
@content << <<~JS
|
||||
(function() {
|
||||
if ('Discourse' in window) {
|
||||
Discourse.RAW_TEMPLATES[#{raw_template_name(name)}] = requirejs('discourse-common/lib/raw-handlebars').template(#{compiled});
|
||||
}
|
||||
const addRawTemplate = requirejs('discourse-common/lib/raw-templates').addRawTemplate;
|
||||
const template = requirejs('discourse-common/lib/raw-handlebars').template(#{compiled});
|
||||
addRawTemplate(#{raw_template_name(name)}, template);
|
||||
})();
|
||||
JS
|
||||
rescue Barber::PrecompilerError => e
|
||||
|
Reference in New Issue
Block a user