DEV: Drop workbox dependency (#26735)

This service-worker caching functionality was disabled by default in 1c58395bca, and the setting to re-enable was marked as experimental. Now we are dropping all the related logic.
This commit is contained in:
David Taylor
2024-04-24 10:19:12 +01:00
committed by GitHub
parent b5b2f80955
commit dcd994a9f1
10 changed files with 3 additions and 286 deletions

View File

@@ -46,15 +46,6 @@ class EmberCli < ActiveSupport::CurrentAttributes
end
end
def self.workbox_dir_name
return @workbox_base_dir if defined?(@workbox_base_dir)
@workbox_base_dir =
if (full_path = Dir.glob("app/assets/javascripts/discourse/dist/assets/workbox-*")[0])
File.basename(full_path)
end
end
def self.has_tests?
File.exist?("#{dist_dir}/tests/index.html")
end

View File

@@ -54,8 +54,6 @@ Sprockets::DirectiveProcessor.prepend(
Sprockets::Asset.prepend(
Module.new do
def digest_path
# Workbox assets are already in a folder with a digest in the name
return logical_path if logical_path.start_with?("workbox-")
# Webpack chunks are already named based on their contents
return logical_path if logical_path.start_with?("chunk.")
super

View File

@@ -267,7 +267,6 @@ task "assets:precompile:compress_js": "environment" do
manifest
.files
.select { |k, v| k =~ /\.js\z/ }
.reject { |k, v| k =~ %r{/workbox-.*'/} }
.each do |file, info|
path = "#{assets_path}/#{file}"
_file =