From 6ec6330ada29e2c58f41c707dd8029d72a1d7064 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Thu, 2 Oct 2025 21:03:26 +0200 Subject: [PATCH 1/4] Rvert web_app_manifest.rb changes --- config/initializers/web_app_manifest.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/config/initializers/web_app_manifest.rb b/config/initializers/web_app_manifest.rb index bfae462d..e0b54d66 100644 --- a/config/initializers/web_app_manifest.rb +++ b/config/initializers/web_app_manifest.rb @@ -6,6 +6,16 @@ # to asset_path in the _favicon.html.erb partial. Rails.application.config.assets.configure do |env| + mime_type = 'application/manifest+json' + extensions = ['.webmanifest'] + + if Sprockets::VERSION.to_i >= 4 + extensions << '.webmanifest.erb' + env.register_preprocessor(mime_type, Sprockets::ERBProcessor) + end + + env.register_mime_type(mime_type, extensions: extensions) + # Register .webmanifest files with the correct MIME type - env.register_mime_type 'application/manifest+json', extensions: ['.webmanifest'] + # env.register_mime_type 'application/manifest+json', extensions: ['.webmanifest'] end From d070eb40b9eb65bbd4e9c9e40c0a2b81d2dba988 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Thu, 2 Oct 2025 21:05:17 +0200 Subject: [PATCH 2/4] Disable the web manfifest hook --- lib/tasks/webmanifest.rake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/tasks/webmanifest.rake b/lib/tasks/webmanifest.rake index d2579e30..22264d3a 100644 --- a/lib/tasks/webmanifest.rake +++ b/lib/tasks/webmanifest.rake @@ -38,6 +38,6 @@ namespace :webmanifest do end # Hook to automatically generate webmanifest after assets:precompile -Rake::Task['assets:precompile'].enhance do - Rake::Task['webmanifest:generate'].invoke -end \ No newline at end of file +# Rake::Task['assets:precompile'].enhance do +# Rake::Task['webmanifest:generate'].invoke +# end From ab90180cbfa3ff911687a6a6e64138019499f233 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Thu, 2 Oct 2025 21:18:54 +0200 Subject: [PATCH 3/4] Pin maps, remove ujs --- app/javascript/application.js | 3 --- config/importmap.rb | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/app/javascript/application.js b/app/javascript/application.js index 69f196ce..221f2c49 100644 --- a/app/javascript/application.js +++ b/app/javascript/application.js @@ -1,6 +1,5 @@ // Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails -import "@rails/ujs" import "@rails/actioncable" import "controllers" import "@hotwired/turbo-rails" @@ -13,5 +12,3 @@ import "./channels" import "trix" import "@rails/actiontext" - -Rails.start() diff --git a/config/importmap.rb b/config/importmap.rb index a98b5464..badf814e 100644 --- a/config/importmap.rb +++ b/config/importmap.rb @@ -3,6 +3,7 @@ # Pin npm packages by running ./bin/importmap pin_all_from 'app/javascript/channels', under: 'channels' +pin_all_from 'app/javascript/maps', under: 'maps' pin 'application', preload: true pin '@rails/actioncable', to: 'actioncable.esm.js' From e86264a4f4f4aafb00ae731299d5972d05957580 Mon Sep 17 00:00:00 2001 From: Eugene Burmakin Date: Thu, 2 Oct 2025 21:54:18 +0200 Subject: [PATCH 4/4] Change asset compilation setting in production --- config/environments/production.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/environments/production.rb b/config/environments/production.rb index 53eedb18..1e4b392a 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -29,7 +29,7 @@ Rails.application.configure do # config.assets.css_compressor = :sass # Do not fallback to assets pipeline if a precompiled asset is missed. - config.assets.compile = false + config.assets.compile = true config.assets.content_type = { geojson: 'application/geo+json'