Commit 0a4bc5a7 authored by Thong Kuah's avatar Thong Kuah

Merge branch 'ps-comment-about-defer-script' into 'master'

Comment about the importance of script defer

See merge request gitlab-org/gitlab!45573
parents 08d6b67f 88fa9a8f
# 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