Skip to content
代码片段 群组 项目
未验证 提交 88fa9a8f 编辑于 作者: Paul Slaughter's avatar Paul Slaughter
浏览文件

Comment about the importance of script defer

上级 4a437546
No related branches found
No related tags found
加载中
# frozen_string_literal: true # frozen_string_literal: true
module DeferScriptTagHelper 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) def javascript_include_tag(*sources)
super(*sources, defer: true) super(*sources, defer: true)
end end
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册