2020-02-14 16:09:08 -05:00
|
|
|
import Vue from 'vue';
|
2021-05-20 14:10:33 -04:00
|
|
|
import VueApollo from 'vue-apollo';
|
|
|
|
import createDefaultClient from '~/lib/graphql';
|
2021-03-25 17:09:13 -04:00
|
|
|
import ReleaseIndexApp from './components/app_index.vue';
|
2020-09-17 14:10:12 -04:00
|
|
|
|
2020-02-14 16:09:08 -05:00
|
|
|
export default () => {
|
|
|
|
const el = document.getElementById('js-releases-page');
|
|
|
|
|
2022-03-22 11:07:25 -04:00
|
|
|
Vue.use(VueApollo);
|
2021-05-20 14:10:33 -04:00
|
|
|
|
2022-03-22 11:07:25 -04:00
|
|
|
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-05-20 14:10:33 -04:00
|
|
|
|
2020-02-14 16:09:08 -05:00
|
|
|
return new Vue({
|
|
|
|
el,
|
2022-03-22 11:07:25 -04:00
|
|
|
apolloProvider,
|
|
|
|
provide: { ...el.dataset },
|
2021-03-25 17:09:13 -04:00
|
|
|
render: (h) => h(ReleaseIndexApp),
|
2020-02-14 16:09:08 -05:00
|
|
|
});
|
|
|
|
};
|