From 0916eee4bf1279bc7d69ab003b1b1bd7fac8741c Mon Sep 17 00:00:00 2001 From: John McDowall Date: Tue, 9 Jan 2024 13:23:48 -0800 Subject: [PATCH] Drop the shim calls and bump importmaps-rails to min requirement to 2 --- ahoy_captain.gemspec | 2 +- app/helpers/ahoy_captain/application_helper.rb | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ahoy_captain.gemspec b/ahoy_captain.gemspec index c82900a..212441f 100644 --- a/ahoy_captain.gemspec +++ b/ahoy_captain.gemspec @@ -21,7 +21,7 @@ Gem::Specification.new do |spec| spec.add_dependency "ransack", ">= 2.3" spec.add_dependency "turbo-rails", ">= 1.2" spec.add_dependency "view_component", ">= 3" - spec.add_dependency "importmap-rails", ">= 1" + spec.add_dependency "importmap-rails", ">= 2" spec.add_dependency "stimulus-rails", ">= 1.1" spec.add_dependency "ahoy_matey", ">= 1.1" spec.add_dependency "chartkick", ">= 4" diff --git a/app/helpers/ahoy_captain/application_helper.rb b/app/helpers/ahoy_captain/application_helper.rb index 788dda9..29e397d 100644 --- a/app/helpers/ahoy_captain/application_helper.rb +++ b/app/helpers/ahoy_captain/application_helper.rb @@ -32,13 +32,11 @@ def number_to_duration(duration) end end - def ahoy_captain_importmap_tags(entry_point = "application", shim: true) + def ahoy_captain_importmap_tags(entry_point = "application") safe_join [ - (javascript_importmap_shim_tag if shim), - (javascript_importmap_shim_nonce_configuration_tag if shim), + javascript_inline_importmap_tag(AhoyCaptain.importmap.to_json(resolver: self)), javascript_import_module_tag(entry_point), javascript_importmap_module_preload_tags(AhoyCaptain.importmap), - javascript_inline_importmap_tag(AhoyCaptain.importmap.to_json(resolver: self)), ].compact, "\n" end