Commit fc5ec643 authored by Nicolò Maria Mezzopera's avatar Nicolò Maria Mezzopera

Merge branch '260321-snippet-js-order' into 'master'

Snippet view: Prioritise bootstrapping Vue application

See merge request gitlab-org/gitlab!44139
parents 274e0d32 b9a2a581
import initNotes from '~/init_notes';
import loadAwardsHandler from '~/awards_handler';
if (!gon.features.snippetsVue) { if (!gon.features.snippetsVue) {
const LineHighlighterModule = import('~/line_highlighter'); const LineHighlighterModule = import('~/line_highlighter');
const BlobViewerModule = import('~/blob/viewer'); const BlobViewerModule = import('~/blob/viewer');
const ZenModeModule = import('~/zen_mode'); const ZenModeModule = import('~/zen_mode');
const SnippetEmbedModule = import('~/snippet/snippet_embed'); const SnippetEmbedModule = import('~/snippet/snippet_embed');
const initNotesModule = import('~/init_notes');
const loadAwardsHandlerModule = import('~/awards_handler');
Promise.all([LineHighlighterModule, BlobViewerModule, ZenModeModule, SnippetEmbedModule]) Promise.all([
LineHighlighterModule,
BlobViewerModule,
ZenModeModule,
SnippetEmbedModule,
initNotesModule,
loadAwardsHandlerModule,
])
.then( .then(
([ ([
{ default: LineHighlighter }, { default: LineHighlighter },
{ default: BlobViewer }, { default: BlobViewer },
{ default: ZenMode }, { default: ZenMode },
{ default: SnippetEmbed }, { default: SnippetEmbed },
{ default: initNotes },
{ default: loadAwardsHandler },
]) => { ]) => {
new LineHighlighter(); // eslint-disable-line no-new new LineHighlighter(); // eslint-disable-line no-new
new BlobViewer(); // eslint-disable-line no-new new BlobViewer(); // eslint-disable-line no-new
new ZenMode(); // eslint-disable-line no-new new ZenMode(); // eslint-disable-line no-new
SnippetEmbed(); SnippetEmbed();
initNotes();
loadAwardsHandler();
}, },
) )
.catch(() => {}); .catch(() => {});
...@@ -27,7 +37,12 @@ if (!gon.features.snippetsVue) { ...@@ -27,7 +37,12 @@ if (!gon.features.snippetsVue) {
.then(({ SnippetShowInit }) => { .then(({ SnippetShowInit }) => {
SnippetShowInit(); SnippetShowInit();
}) })
.then(() => {
return Promise.all([import('~/init_notes'), import('~/awards_handler')]);
})
.then(([{ default: initNotes }, { default: loadAwardsHandler }]) => {
initNotes();
loadAwardsHandler();
})
.catch(() => {}); .catch(() => {});
} }
initNotes();
loadAwardsHandler();
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