Commit 88fa9a8f authored by Paul Slaughter's avatar Paul Slaughter

Comment about the importance of script defer

See [this epic][1].

[1]: https://gitlab.com/groups/gitlab-org/-/epics/4538#note_432159769
parent 4a437546
# frozen_string_literal: true
module DeferScriptTagHelper
# Override the default ActionView `javascript_include_tag` helper to support page specific deferred loading
# Override the default ActionView `javascript_include_tag` helper to support page specific deferred loading.
# PLEASE NOTE: `defer` is also critical so that we don't run JavaScript entrypoints before the DOM is ready.
# Please see https://gitlab.com/groups/gitlab-org/-/epics/4538#note_432159769.
def javascript_include_tag(*sources)
super(*sources, defer: true)
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment