mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 20:01:14 +08:00
DEV: Remove sprockets from plugin 'extra js' pipeline (#25502)
JS assets added by plugins via `register_asset` will be outside the `assets/javascripts` directory, and are therefore exempt from being transpiled. That means that there isn't really any need to run them through DiscourseJsProcessor. Instead, we can just concatenate them together, and avoid the need for all the sprockets-wrangling. This commit also takes the opportunity to clean up a number of plugin-asset-related codepaths which are no longer required (e.g. globs, handlebars)
This commit is contained in:
@ -408,15 +408,9 @@ TEXT
|
||||
plugin.register_asset("desktop.css", :desktop)
|
||||
plugin.register_asset("desktop2.css", :desktop)
|
||||
|
||||
plugin.register_asset("code.js")
|
||||
|
||||
plugin.register_asset("my_admin.js", :admin)
|
||||
plugin.register_asset("my_admin2.js", :admin)
|
||||
|
||||
plugin.activate!
|
||||
|
||||
expect(DiscoursePluginRegistry.javascripts.count).to eq(2)
|
||||
expect(DiscoursePluginRegistry.admin_javascripts.count).to eq(2)
|
||||
expect(DiscoursePluginRegistry.javascripts.count).to eq(1)
|
||||
expect(DiscoursePluginRegistry.desktop_stylesheets[plugin.directory_name].count).to eq(2)
|
||||
expect(DiscoursePluginRegistry.stylesheets[plugin.directory_name].count).to eq(2)
|
||||
expect(DiscoursePluginRegistry.mobile_stylesheets[plugin.directory_name].count).to eq(1)
|
||||
|
Reference in New Issue
Block a user