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.

33 lines
972 B
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';
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);
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
});
};