Add more prefetching of components

This commit is contained in:
kolaente 2020-07-27 19:53:19 +02:00
parent bc7e7dd865
commit b1b5398c56
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B
17 changed files with 199 additions and 32 deletions

View file

@ -8,7 +8,6 @@
<meta name="description" content="Vikunja (/vɪˈkuːnjə/) - The to-do app to organize your life."> <meta name="description" content="Vikunja (/vɪˈkuːnjə/) - The to-do app to organize your life.">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<link rel="preload" crossorigin="anonymous" href="<%= BASE_URL %>fonts/fonts.css" as="style">
<link rel="preload" crossorigin="anonymous" href="<%= BASE_URL %>fonts/open-sans-v15-latin-700italic.woff2" as="font"> <link rel="preload" crossorigin="anonymous" href="<%= BASE_URL %>fonts/open-sans-v15-latin-700italic.woff2" as="font">
<link rel="preload" crossorigin="anonymous" href="<%= BASE_URL %>fonts/open-sans-v15-latin-italic.woff2" as="font"> <link rel="preload" crossorigin="anonymous" href="<%= BASE_URL %>fonts/open-sans-v15-latin-italic.woff2" as="font">
<link rel="preload" crossorigin="anonymous" href="<%= BASE_URL %>fonts/quicksand-v7-latin-300.woff2" as="font"> <link rel="preload" crossorigin="anonymous" href="<%= BASE_URL %>fonts/quicksand-v7-latin-300.woff2" as="font">

View file

@ -0,0 +1,12 @@
<template>
<div class="notification is-danger">
Loading failed, please <a @click="() => location.reload()">try again</a>.
If the error persists, please <a href="https://vikunja.io/contact/">contact us</a>.
</div>
</template>
<script>
export default {
name: 'error'
}
</script>

View file

@ -0,0 +1,19 @@
<template>
<div class="loader-container is-loading"></div>
</template>
<script>
export default {
name: 'loading'
}
</script>
<style scoped>
.loader-container {
height: 100%;
min-height: 200px;
width: 100%;
min-width: 600px;
max-width: 100vw;
}
</style>

View file

@ -22,10 +22,10 @@
</template> </template>
<script> <script>
import multiselect from 'vue-multiselect'
import NamespaceService from '../../services/namespace' import NamespaceService from '../../services/namespace'
import NamespaceModel from '../../models/namespace' import NamespaceModel from '../../models/namespace'
import LoadingComponent from '../misc/loading'
import ErrorComponent from '../misc/error'
export default { export default {
name: 'namespace-search', name: 'namespace-search',
@ -37,7 +37,12 @@
} }
}, },
components: { components: {
multiselect, multiselect: () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "multiselect" */ 'vue-multiselect'),
loading: LoadingComponent,
error: ErrorComponent,
timeout: 60000,
}),
}, },
created() { created() {
this.namespaceService = new NamespaceService() this.namespaceService = new NamespaceService()

View file

@ -106,7 +106,6 @@
</template> </template>
<script> <script>
import multiselect from 'vue-multiselect'
import {mapState} from 'vuex' import {mapState} from 'vuex'
import UserNamespaceService from '../../services/userNamespace' import UserNamespaceService from '../../services/userNamespace'
@ -124,6 +123,8 @@
import TeamModel from '../../models/team' import TeamModel from '../../models/team'
import rights from '../../models/rights' import rights from '../../models/rights'
import LoadingComponent from '../misc/loading'
import ErrorComponent from '../misc/error'
export default { export default {
name: 'userTeamShare', name: 'userTeamShare',
@ -163,7 +164,12 @@
} }
}, },
components: { components: {
multiselect multiselect: () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "multiselect" */ 'vue-multiselect'),
loading: LoadingComponent,
error: ErrorComponent,
timeout: 60000,
}),
}, },
computed: mapState({ computed: mapState({
userInfo: state => state.auth.info userInfo: state => state.auth.info

View file

@ -161,6 +161,8 @@
import RepeatAfter from './partials/repeatAfter' import RepeatAfter from './partials/repeatAfter'
import Reminders from './partials/reminders' import Reminders from './partials/reminders'
import ColorPicker from '../input/colorPicker' import ColorPicker from '../input/colorPicker'
import LoadingComponent from '../misc/loading'
import ErrorComponent from '../misc/error'
export default { export default {
name: 'edit-task', name: 'edit-task',
@ -196,7 +198,12 @@
PercentDoneSelect, PercentDoneSelect,
PrioritySelect, PrioritySelect,
flatPickr, flatPickr,
editor: () => import(/* webpackPrefetch: true */ '../../components/input/editor'), editor: () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "editor" */ '../../components/input/editor'),
loading: LoadingComponent,
error: ErrorComponent,
timeout: 60000,
}),
}, },
props: { props: {
task: { task: {

View file

@ -75,11 +75,18 @@
import TaskCommentService from '../../../services/taskComment' import TaskCommentService from '../../../services/taskComment'
import TaskCommentModel from '../../../models/taskComment' import TaskCommentModel from '../../../models/taskComment'
import attachmentUpload from '../mixins/attachmentUpload' import attachmentUpload from '../mixins/attachmentUpload'
import LoadingComponent from '../../misc/loading'
import ErrorComponent from '../../misc/error'
export default { export default {
name: 'comments', name: 'comments',
components: { components: {
editor: () => import(/* webpackPrefetch: true */ '../../input/editor'), editor: () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "editor" */ '../../input/editor'),
loading: LoadingComponent,
error: ErrorComponent,
timeout: 60000,
}),
}, },
mixins: [ mixins: [
attachmentUpload, attachmentUpload,

View file

@ -34,18 +34,24 @@
<script> <script>
import {differenceWith} from 'lodash' import {differenceWith} from 'lodash'
import multiselect from 'vue-multiselect'
import UserModel from '../../../models/user' import UserModel from '../../../models/user'
import ListUserService from '../../../services/listUsers' import ListUserService from '../../../services/listUsers'
import TaskAssigneeService from '../../../services/taskAssignee' import TaskAssigneeService from '../../../services/taskAssignee'
import User from '../../misc/user' import User from '../../misc/user'
import LoadingComponent from '../../misc/loading'
import ErrorComponent from '../../misc/error'
export default { export default {
name: 'editAssignees', name: 'editAssignees',
components: { components: {
User, User,
multiselect, multiselect: () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "multiselect" */ 'vue-multiselect'),
loading: LoadingComponent,
error: ErrorComponent,
timeout: 60000,
}),
}, },
props: { props: {
taskId: { taskId: {

View file

@ -36,11 +36,12 @@
<script> <script>
import { differenceWith } from 'lodash' import { differenceWith } from 'lodash'
import multiselect from 'vue-multiselect'
import LabelService from '../../../services/label' import LabelService from '../../../services/label'
import LabelModel from '../../../models/label' import LabelModel from '../../../models/label'
import LabelTaskService from '../../../services/labelTask' import LabelTaskService from '../../../services/labelTask'
import LoadingComponent from '../../misc/loading'
import ErrorComponent from '../../misc/error'
export default { export default {
name: 'edit-labels', name: 'edit-labels',
@ -65,7 +66,12 @@
} }
}, },
components: { components: {
multiselect, multiselect: () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "multiselect" */ 'vue-multiselect'),
loading: LoadingComponent,
error: ErrorComponent,
timeout: 60000,
}),
}, },
watch: { watch: {
value(newLabels) { value(newLabels) {

View file

@ -29,7 +29,8 @@
<script> <script>
import ListService from '../../../services/list' import ListService from '../../../services/list'
import ListModel from '../../../models/list' import ListModel from '../../../models/list'
import multiselect from 'vue-multiselect' import LoadingComponent from '../../misc/loading'
import ErrorComponent from '../../misc/error'
export default { export default {
name: 'listSearch', name: 'listSearch',
@ -41,7 +42,12 @@
} }
}, },
components: { components: {
multiselect, multiselect: () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "multiselect" */ 'vue-multiselect'),
loading: LoadingComponent,
error: ErrorComponent,
timeout: 60000,
}),
}, },
beforeMount() { beforeMount() {
this.listSerivce = new ListService() this.listSerivce = new ListService()

View file

@ -88,7 +88,8 @@
import relationKinds from '../../../models/relationKinds' import relationKinds from '../../../models/relationKinds'
import TaskRelationModel from '../../../models/taskRelation' import TaskRelationModel from '../../../models/taskRelation'
import multiselect from 'vue-multiselect' import LoadingComponent from '../../misc/loading'
import ErrorComponent from '../../misc/error'
export default { export default {
name: 'relatedTasks', name: 'relatedTasks',
@ -106,7 +107,12 @@
} }
}, },
components: { components: {
multiselect, multiselect: () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "multiselect" */ 'vue-multiselect'),
loading: LoadingComponent,
error: ErrorComponent,
timeout: 60000,
}),
}, },
props: { props: {
taskId: { taskId: {

View file

@ -3,28 +3,77 @@ import Router from 'vue-router'
import HomeComponent from '../views/Home' import HomeComponent from '../views/Home'
import NotFoundComponent from '../views/404' import NotFoundComponent from '../views/404'
import LoadingComponent from '../components/misc/loading'
import ErrorComponent from '../components/misc/error'
// User Handling // User Handling
import LoginComponent from '../views/user/Login' import LoginComponent from '../views/user/Login'
import RegisterComponent from '../views/user/Register' import RegisterComponent from '../views/user/Register'
import PasswordResetComponent from '../views/user/PasswordReset'
import GetPasswordResetComponent from '../views/user/RequestPasswordReset' const PasswordResetComponent = () => ({
import UserSettingsComponent from '../views/user/Settings' component: import(/* webpackPrefetch: true *//* webpackChunkName: "user-settings" */'../views/user/PasswordReset'),
loading: LoadingComponent,
error: ErrorComponent,
timeout: 60000,
})
const GetPasswordResetComponent = () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "user-settings" */'../views/user/RequestPasswordReset'),
loading: LoadingComponent,
error: ErrorComponent,
timeout: 60000,
})
const UserSettingsComponent = () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "user-settings" */'../views/user/Settings'),
loading: LoadingComponent,
error: ErrorComponent,
timeout: 60000,
})
// List Handling // List Handling
import NewListComponent from '../views/list/NewList' const NewListComponent = () => ({
import EditListComponent from '../views/list/EditList' component: import(/* webpackPrefetch: true *//* webpackChunkName: "settings" */'../views/list/NewList'),
loading: LoadingComponent,
error: ErrorComponent,
timeout: 60000,
})
const EditListComponent = () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "settings" */'../views/list/EditList'),
loading: LoadingComponent,
error: ErrorComponent,
timeout: 60000,
})
// Tasks // Tasks
import ShowTasksInRangeComponent from '../views/tasks/ShowTasksInRange' import ShowTasksInRangeComponent from '../views/tasks/ShowTasksInRange'
import LinkShareAuthComponent from '../views/sharing/LinkSharingAuth' import LinkShareAuthComponent from '../views/sharing/LinkSharingAuth'
import TaskDetailViewModal from '../views/tasks/TaskDetailViewModal' import TaskDetailViewModal from '../views/tasks/TaskDetailViewModal'
import TaskDetailView from '../views/tasks/TaskDetailView' import TaskDetailView from '../views/tasks/TaskDetailView'
// Namespace Handling // Namespace Handling
import NewNamespaceComponent from '../views/namespaces/NewNamespace' const NewNamespaceComponent = () => ({
import EditNamespaceComponent from '../views/namespaces/EditNamespace' component: import(/* webpackPrefetch: true *//* webpackChunkName: "settings" */'../views/namespaces/NewNamespace'),
loading: LoadingComponent,
error: ErrorComponent,
timeout: 60000,
})
const EditNamespaceComponent = () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "settings" */'../views/namespaces/EditNamespace'),
loading: LoadingComponent,
error: ErrorComponent,
timeout: 60000,
})
import ListNamespaces from '../views/namespaces/ListNamespaces' import ListNamespaces from '../views/namespaces/ListNamespaces'
// Team Handling // Team Handling
import ListTeamsComponent from '../views/teams/ListTeams' import ListTeamsComponent from '../views/teams/ListTeams'
import EditTeamComponent from '../views/teams/EditTeam'
import NewTeamComponent from '../views/teams/NewTeam' const EditTeamComponent = () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "settings" */'../views/teams/EditTeam'),
loading: LoadingComponent,
error: ErrorComponent,
timeout: 60000,
})
const NewTeamComponent = () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "settings" */'../views/teams/NewTeam'),
loading: LoadingComponent,
error: ErrorComponent,
timeout: 60000,
})
// Label Handling // Label Handling
import ListLabelsComponent from '../views/labels/ListLabels' import ListLabelsComponent from '../views/labels/ListLabels'
// Migration // Migration

View file

@ -100,12 +100,19 @@
import LabelService from '../../services/label' import LabelService from '../../services/label'
import LabelModel from '../../models/label' import LabelModel from '../../models/label'
import ColorPicker from '../../components/input/colorPicker' import ColorPicker from '../../components/input/colorPicker'
import LoadingComponent from '../../components/misc/loading'
import ErrorComponent from '../../components/misc/error'
export default { export default {
name: 'ListLabels', name: 'ListLabels',
components: { components: {
ColorPicker, ColorPicker,
editor: () => import(/* webpackPrefetch: true */ '../../components/input/editor'), editor: () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "editor" */ '../../components/input/editor'),
loading: LoadingComponent,
error: ErrorComponent,
timeout: 60000,
}),
}, },
data() { data() {
return { return {

View file

@ -171,6 +171,8 @@
import NamespaceSearch from '../../components/namespace/namespace-search' import NamespaceSearch from '../../components/namespace/namespace-search'
import ListDuplicateService from '../../services/listDuplicateService' import ListDuplicateService from '../../services/listDuplicateService'
import ListDuplicateModel from '../../models/listDuplicateModel' import ListDuplicateModel from '../../models/listDuplicateModel'
import LoadingComponent from '../../components/misc/loading'
import ErrorComponent from '../../components/misc/error'
export default { export default {
name: 'EditList', name: 'EditList',
@ -195,7 +197,12 @@
Fancycheckbox, Fancycheckbox,
LinkSharing, LinkSharing,
manageSharing, manageSharing,
editor: () => import(/* webpackPrefetch: true */ '../../components/input/editor'), editor: () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "editor" */ '../../components/input/editor'),
loading: LoadingComponent,
error: ErrorComponent,
timeout: 60000,
}),
}, },
created() { created() {
this.listService = new ListService() this.listService = new ListService()

View file

@ -111,6 +111,8 @@
import NamespaceModel from '../../models/namespace' import NamespaceModel from '../../models/namespace'
import Fancycheckbox from '../../components/input/fancycheckbox' import Fancycheckbox from '../../components/input/fancycheckbox'
import ColorPicker from '../../components/input/colorPicker' import ColorPicker from '../../components/input/colorPicker'
import LoadingComponent from '../../components/misc/loading'
import ErrorComponent from '../../components/misc/error'
export default { export default {
name: "EditNamespace", name: "EditNamespace",
@ -129,7 +131,12 @@
ColorPicker, ColorPicker,
Fancycheckbox, Fancycheckbox,
manageSharing, manageSharing,
editor: () => import(/* webpackPrefetch: true */ '../../components/input/editor'), editor: () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "editor" */ '../../components/input/editor'),
loading: LoadingComponent,
error: ErrorComponent,
timeout: 60000,
}),
}, },
beforeMount() { beforeMount() {
this.namespace.id = this.$route.params.id this.namespace.id = this.$route.params.id

View file

@ -343,6 +343,8 @@
import ListSearch from '../../components/tasks/partials/listSearch' import ListSearch from '../../components/tasks/partials/listSearch'
import ColorPicker from '../../components/input/colorPicker' import ColorPicker from '../../components/input/colorPicker'
import attachmentUpload from '../../components/tasks/mixins/attachmentUpload' import attachmentUpload from '../../components/tasks/mixins/attachmentUpload'
import LoadingComponent from '../../components/misc/loading'
import ErrorComponent from '../../components/misc/error'
export default { export default {
name: 'TaskDetailView', name: 'TaskDetailView',
@ -359,7 +361,12 @@
PrioritySelect, PrioritySelect,
Comments, Comments,
flatPickr, flatPickr,
editor: () => import(/* webpackPrefetch: true */ '../../components/input/editor'), editor: () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "editor" */ '../../components/input/editor'),
loading: LoadingComponent,
error: ErrorComponent,
timeout: 60000,
}),
}, },
mixins: [ mixins: [
attachmentUpload, attachmentUpload,

View file

@ -176,7 +176,6 @@
<script> <script>
import router from '../../router' import router from '../../router'
import multiselect from 'vue-multiselect'
import {mapState} from 'vuex' import {mapState} from 'vuex'
import TeamService from '../../services/team' import TeamService from '../../services/team'
@ -185,6 +184,8 @@
import TeamMemberModel from '../../models/teamMember' import TeamMemberModel from '../../models/teamMember'
import UserModel from '../../models/user' import UserModel from '../../models/user'
import UserService from '../../services/user' import UserService from '../../services/user'
import LoadingComponent from '../../components/misc/loading'
import ErrorComponent from '../../components/misc/error'
export default { export default {
name: 'EditTeam', name: 'EditTeam',
@ -208,8 +209,18 @@
} }
}, },
components: { components: {
multiselect, multiselect: () => ({
editor: () => import(/* webpackPrefetch: true */ '../../components/input/editor'), component: import(/* webpackPrefetch: true *//* webpackChunkName: "multiselect" */ 'vue-multiselect'),
loading: LoadingComponent,
error: ErrorComponent,
timeout: 60000,
}),
editor: () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "editor" */ '../../components/input/editor'),
loading: LoadingComponent,
error: ErrorComponent,
timeout: 60000,
}),
}, },
created() { created() {
this.teamService = new TeamService() this.teamService = new TeamService()