Merge pull request #70 from nextcloud/enh/noid/lazy-loading

This commit is contained in:
Julius Härtl 2023-02-10 14:00:38 +01:00 коммит произвёл GitHub
Родитель 7472663d85 adb275e45d
Коммит ad0ed98e7f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 18 добавлений и 15 удалений

Просмотреть файл

@ -1,5 +1,3 @@
/* jshint esversion: 6 */
/**
* Nextcloud - github
*
@ -11,17 +9,17 @@
* @copyright Julien Veyssier 2020
*/
import Vue from 'vue'
import './bootstrap.js'
import Dashboard from './views/Dashboard.vue'
__webpack_nonce__ = btoa(OC.requestToken) // eslint-disable-line
__webpack_public_path__ = OC.linkTo('integration_github', 'js/') // eslint-disable-line
document.addEventListener('DOMContentLoaded', function() {
OCA.Dashboard.register('github_notifications', (el, { widget }) => {
document.addEventListener('DOMContentLoaded', () => {
OCA.Dashboard.register('github_notifications', async (el, { widget }) => {
const { default: Vue } = await import(/* webpackChunkName: "dashboard-lazy" */'vue')
const { default: Dashboard } = await import(/* webpackChunkName: "dashboard-lazy" */'./views/Dashboard.vue')
Vue.mixin({ methods: { t, n } })
const View = Vue.extend(Dashboard)
new View({
propsData: { title: widget.title },
}).$mount(el)
})
})

Просмотреть файл

@ -20,12 +20,14 @@
*/
import { registerWidget } from '@nextcloud/vue-richtext'
import './bootstrap.js'
import Vue from 'vue'
import GithubIssuePrReferenceWidget from './views/GithubIssuePrReferenceWidget.vue'
import GithubCodePermalinkReferenceWidget from './views/GithubCodePermalinkReferenceWidget.vue'
registerWidget('integration_github_issue_pr', (el, { richObjectType, richObject, accessible }) => {
__webpack_nonce__ = btoa(OC.requestToken) // eslint-disable-line
__webpack_public_path__ = OC.linkTo('integration_github', 'js/') // eslint-disable-line
registerWidget('integration_github_issue_pr', async (el, { richObjectType, richObject, accessible }) => {
const { default: Vue } = await import(/* webpackChunkName: "reference-issue-lazy" */'vue')
const { default: GithubIssuePrReferenceWidget } = await import(/* webpackChunkName: "reference-issue-lazy" */'./views/GithubIssuePrReferenceWidget.vue')
Vue.mixin({ methods: { t, n } })
const Widget = Vue.extend(GithubIssuePrReferenceWidget)
new Widget({
propsData: {
@ -36,7 +38,10 @@ registerWidget('integration_github_issue_pr', (el, { richObjectType, richObject,
}).$mount(el)
})
registerWidget('integration_github_code_permalink', (el, { richObjectType, richObject, accessible }) => {
registerWidget('integration_github_code_permalink', async (el, { richObjectType, richObject, accessible }) => {
const { default: Vue } = await import(/* webpackChunkName: "reference-permalink-lazy" */'vue')
const { default: GithubCodePermalinkReferenceWidget } = await import(/* webpackChunkName: "reference-permalink-lazy" */'./views/GithubCodePermalinkReferenceWidget.vue')
Vue.mixin({ methods: { t, n } })
const Widget = Vue.extend(GithubCodePermalinkReferenceWidget)
new Widget({
propsData: {