Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
ec0e5cec
Commit
ec0e5cec
authored
May 11, 2021
by
Denys Mishunov
Committed by
James Lopez
May 11, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Preload monaco globally
parent
cc6e4fca
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
0 deletions
+12
-0
app/helpers/webpack_helper.rb
app/helpers/webpack_helper.rb
+4
-0
app/views/layouts/_head.html.haml
app/views/layouts/_head.html.haml
+2
-0
spec/views/layouts/_head.html.haml_spec.rb
spec/views/layouts/_head.html.haml_spec.rb
+6
-0
No files found.
app/helpers/webpack_helper.rb
View file @
ec0e5cec
...
...
@@ -5,6 +5,10 @@ module WebpackHelper
javascript_include_tag
(
*
webpack_entrypoint_paths
(
bundle
))
end
def
webpack_preload_asset_tag
(
asset
,
options
=
{})
preload_link_tag
(
Gitlab
::
Webpack
::
Manifest
.
asset_paths
(
asset
).
first
,
options
)
end
def
webpack_controller_bundle_tags
chunks
=
[]
...
...
app/views/layouts/_head.html.haml
View file @
ec0e5cec
...
...
@@ -32,6 +32,8 @@
-
if
page_canonical_link
%link
{
rel:
'canonical'
,
href:
page_canonical_link
}
=
webpack_preload_asset_tag
(
"monaco"
)
=
favicon_link_tag
favicon
,
id:
'favicon'
,
data:
{
original_href:
favicon
},
type:
'image/png'
=
render
'layouts/startup_css'
...
...
spec/views/layouts/_head.html.haml_spec.rb
View file @
ec0e5cec
...
...
@@ -62,6 +62,12 @@ RSpec.describe 'layouts/_head' do
expect
(
rendered
).
to
match
(
'<link rel="stylesheet" media="print" href="/stylesheets/highlight/themes/solarised-light.css" />'
)
end
it
'preloads Monaco'
do
render
expect
(
rendered
).
to
match
(
'<link rel="preload" href="/assets/webpack/monaco.chunk.js" as="script" type="text/javascript">'
)
end
context
'when an asset_host is set and snowplow url is set'
do
let
(
:asset_host
)
{
'http://test.host'
}
let
(
:snowplow_collector_hostname
)
{
'www.snow.plow'
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment