mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 14:12:10 +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:
@ -83,13 +83,6 @@ RSpec.describe DiscoursePluginRegistry do
|
||||
end
|
||||
end
|
||||
|
||||
describe "#admin_javascripts" do
|
||||
it "defaults to an empty Set" do
|
||||
registry.reset!
|
||||
expect(registry.admin_javascripts).to eq(Set.new)
|
||||
end
|
||||
end
|
||||
|
||||
describe "#seed_data" do
|
||||
it "defaults to an empty Set" do
|
||||
registry.reset!
|
||||
@ -230,13 +223,6 @@ RSpec.describe DiscoursePluginRegistry do
|
||||
expect(registry.stylesheets[plugin_directory_name]).to eq(nil)
|
||||
end
|
||||
|
||||
it "registers admin javascript properly" do
|
||||
registry.register_asset("my_admin.js", :admin)
|
||||
|
||||
expect(registry.admin_javascripts.count).to eq(1)
|
||||
expect(registry.javascripts.count).to eq(0)
|
||||
end
|
||||
|
||||
it "registers vendored_core_pretty_text properly" do
|
||||
registry.register_asset("my_lib.js", :vendored_core_pretty_text)
|
||||
|
||||
|
Reference in New Issue
Block a user