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:
David Taylor
2024-02-01 11:48:31 +00:00
committed by GitHub
parent 4c25266cf7
commit 1757a688c4
6 changed files with 47 additions and 194 deletions

View File

@ -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)