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) {
const LineHighlighterModule = import('~/line_highlighter');
const BlobViewerModule = import('~/blob/viewer');
const ZenModeModule = import('~/zen_mode');
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(
([
{ default: LineHighlighter },
{ default: BlobViewer },
{ default: ZenMode },
{ default: SnippetEmbed },
{ default: initNotes },
{ default: loadAwardsHandler },
]) => {
new LineHighlighter(); // eslint-disable-line no-new
new BlobViewer(); // eslint-disable-line no-new
new ZenMode(); // eslint-disable-line no-new
SnippetEmbed();
initNotes();
loadAwardsHandler();
},
)
.catch(() => {});
......@@ -27,7 +37,12 @@ if (!gon.features.snippetsVue) {
.then(({ SnippetShowInit }) => {
SnippetShowInit();
})
.then(() => {
return Promise.all([import('~/init_notes'), import('~/awards_handler')]);
})
.then(([{ default: initNotes }, { default: loadAwardsHandler }]) => {
initNotes();
loadAwardsHandler();
})
.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