Skip to content

Commit

Permalink
Update to es-module-shims v1.6.3 and use an inline script entry-point…
Browse files Browse the repository at this point in the history
…; remove script.js entrypoint; remove sourcemap references (#793)
  • Loading branch information
bensheldon authored Jan 10, 2023
1 parent d505286 commit a728237
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 12 deletions.
3 changes: 0 additions & 3 deletions app/assets/good_job/scripts.js

This file was deleted.

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion app/assets/good_job/vendor/bootstrap/bootstrap.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/assets/good_job/vendor/es_module_shims.js

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions app/controllers/good_job/assets_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ def rails_ujs_js
render file: GoodJob::Engine.root.join("app", "assets", "good_job", "vendor", "rails_ujs.js")
end

def scripts_js
render file: GoodJob::Engine.root.join("app", "assets", "good_job", "scripts.js")
end

def style_css
render file: GoodJob::Engine.root.join("app", "assets", "good_job", "style.css")
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/good_job/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<%= tag.script "", src: es_module_shims_path(format: :js, v: GoodJob::VERSION, locale: nil), async: true, nonce: content_security_policy_nonce %>
<% importmaps = { imports: GoodJob::AssetsController.js_modules.keys.index_with { |module_name| modules_path(module_name, format: :js, locale: nil, v: GoodJob::VERSION) } } %>
<%= tag.script importmaps.to_json.html_safe, type: "importmap", nonce: content_security_policy_nonce %>
<%= tag.script "", src: scripts_path(format: :js, v: GoodJob::VERSION, locale: nil), type: "module", nonce: content_security_policy_nonce %>
<%= tag.script "", type: "module", nonce: content_security_policy_nonce do %> import "application"; <% end %>
</head>
<body>
<div class="d-flex flex-column min-vh-100">
Expand Down
1 change: 0 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
get :rails_ujs, action: :rails_ujs_js
get :es_module_shims, action: :es_module_shims_js
get "modules/:module", action: :modules_js, as: :modules
get :scripts, action: :scripts_js
end
end
end

0 comments on commit a728237

Please sign in to comment.