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
32c855c6
Commit
32c855c6
authored
May 08, 2020
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove echarts from the main bundle
parent
596f481e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
13 deletions
+36
-13
app/assets/javascripts/behaviors/markdown/render_metrics.js
app/assets/javascripts/behaviors/markdown/render_metrics.js
+20
-13
config/webpack.config.js
config/webpack.config.js
+16
-0
No files found.
app/assets/javascripts/behaviors/markdown/render_metrics.js
View file @
32c855c6
import
Vue
from
'
vue
'
;
import
EmbedGroup
from
'
~/monitoring/components/embeds/embed_group.vue
'
;
import
{
createStore
}
from
'
~/monitoring/stores/embed_group/
'
;
// TODO: Handle copy-pasting - https://gitlab.com/gitlab-org/gitlab-foss/issues/64369.
...
...
@@ -8,8 +7,6 @@ export default function renderMetrics(elements) {
return
;
}
const
EmbedGroupComponent
=
Vue
.
extend
(
EmbedGroup
);
const
wrapperList
=
[];
elements
.
forEach
(
element
=>
{
...
...
@@ -31,14 +28,24 @@ export default function renderMetrics(elements) {
element
.
parentNode
.
removeChild
(
element
);
});
wrapperList
.
forEach
(
wrapper
=>
{
// eslint-disable-next-line no-new
new
EmbedGroupComponent
({
el
:
wrapper
,
store
:
createStore
(),
propsData
:
{
urls
:
wrapper
.
urls
,
},
});
});
if
(
wrapperList
.
length
)
{
import
(
/* webpackChunkName: 'gfm_metrics' */
'
~/monitoring/components/embeds/embed_group.vue
'
)
.
then
(
EmbedGroup
=>
{
const
EmbedGroupComponent
=
Vue
.
extend
(
EmbedGroup
);
wrapperList
.
forEach
(
wrapper
=>
{
// eslint-disable-next-line no-new
new
EmbedGroupComponent
({
el
:
wrapper
,
store
:
createStore
(),
propsData
:
{
urls
:
wrapper
.
urls
,
},
});
});
})
.
catch
(()
=>
{
// do nothing
});
}
}
config/webpack.config.js
View file @
32c855c6
...
...
@@ -268,6 +268,22 @@ module.exports = {
minChunks
:
2
,
reuseExistingChunk
:
true
,
},
echarts
:
{
priority
:
14
,
name
:
'
echarts
'
,
chunks
:
'
all
'
,
test
:
/
[\\/]
node_modules
[\\/](
echarts|zrender
)[\\/]
/
,
minChunks
:
2
,
reuseExistingChunk
:
true
,
},
security_reports
:
{
priority
:
13
,
name
:
'
security_reports
'
,
chunks
:
'
initial
'
,
test
:
/
[\\/](
vue_shared
[\\/](
security_reports|license_compliance
)
|security_dashboard
)[\\/]
/
,
minChunks
:
2
,
reuseExistingChunk
:
true
,
},
vendors
:
{
priority
:
10
,
chunks
:
'
async
'
,
...
...
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