debian-mirror-gitlab/app/assets/javascripts/releases/mount_index.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

35 lines
1 KiB
JavaScript
Raw Normal View History

2020-03-13 15:44:24 +05:30
import Vue from 'vue';
2021-09-04 01:27:46 +05:30
import VueApollo from 'vue-apollo';
2022-08-13 15:12:31 +05:30
import { GlToast } from '@gitlab/ui';
2021-09-04 01:27:46 +05:30
import createDefaultClient from '~/lib/graphql';
2021-04-29 21:17:54 +05:30
import ReleaseIndexApp from './components/app_index.vue';
2020-11-24 15:15:51 +05:30
2020-03-13 15:44:24 +05:30
export default () => {
const el = document.getElementById('js-releases-page');
2022-06-21 17:19:12 +05:30
Vue.use(VueApollo);
2022-08-13 15:12:31 +05:30
Vue.use(GlToast);
2021-09-04 01:27:46 +05:30
2022-06-21 17:19:12 +05:30
const apolloProvider = new VueApollo({
defaultClient: createDefaultClient(
{},
{
// This page attempts to decrease the perceived loading time
// by sending two requests: one request for the first item only (which
// completes relatively quickly), and one for all the items (which is slower).
// By default, Apollo Client batches these requests together, which defeats
// the purpose of making separate requests. So we explicitly
// disable batching on this page.
batchMax: 1,
},
),
});
2021-09-04 01:27:46 +05:30
2020-03-13 15:44:24 +05:30
return new Vue({
el,
2022-06-21 17:19:12 +05:30
apolloProvider,
provide: { ...el.dataset },
2021-04-29 21:17:54 +05:30
render: (h) => h(ReleaseIndexApp),
2020-03-13 15:44:24 +05:30
});
};