Performance improvements (#288)

Only include needed parts from lodash

Don't prefetch

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/288
Co-Authored-By: konrad <konrad@kola-entertainments.de>
Co-Committed-By: konrad <konrad@kola-entertainments.de>
This commit is contained in:
konrad 2020-11-02 20:47:31 +00:00
parent e4ae8078bc
commit 2af53b16b6
23 changed files with 37 additions and 34 deletions

View file

@ -38,7 +38,7 @@ export default {
}, },
components: { components: {
multiselect: () => ({ multiselect: () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "multiselect" */ 'vue-multiselect'), component: import(/* webpackChunkName: "multiselect" */ 'vue-multiselect'),
loading: LoadingComponent, loading: LoadingComponent,
error: ErrorComponent, error: ErrorComponent,
timeout: 60000, timeout: 60000,

View file

@ -173,7 +173,7 @@ export default {
}, },
components: { components: {
multiselect: () => ({ multiselect: () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "multiselect" */ 'vue-multiselect'), component: import(/* webpackChunkName: "multiselect" */ 'vue-multiselect'),
loading: LoadingComponent, loading: LoadingComponent,
error: ErrorComponent, error: ErrorComponent,
timeout: 60000, timeout: 60000,

View file

@ -199,7 +199,7 @@ export default {
PrioritySelect, PrioritySelect,
flatPickr, flatPickr,
editor: () => ({ editor: () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "editor" */ '../../components/input/editor'), component: import(/* webpackChunkName: "editor" */ '../../components/input/editor'),
loading: LoadingComponent, loading: LoadingComponent,
error: ErrorComponent, error: ErrorComponent,
timeout: 60000, timeout: 60000,

View file

@ -83,7 +83,7 @@ export default {
name: 'comments', name: 'comments',
components: { components: {
editor: () => ({ editor: () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "editor" */ '../../input/editor'), component: import(/* webpackChunkName: "editor" */ '../../input/editor'),
loading: LoadingComponent, loading: LoadingComponent,
error: ErrorComponent, error: ErrorComponent,
timeout: 60000, timeout: 60000,

View file

@ -36,7 +36,7 @@
</template> </template>
<script> <script>
import {differenceWith} from 'lodash' import differenceWith from 'lodash/differenceWith'
import UserModel from '../../../models/user' import UserModel from '../../../models/user'
import ListUserService from '../../../services/listUsers' import ListUserService from '../../../services/listUsers'
@ -50,7 +50,7 @@ export default {
components: { components: {
User, User,
multiselect: () => ({ multiselect: () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "multiselect" */ 'vue-multiselect'), component: import(/* webpackChunkName: "multiselect" */ 'vue-multiselect'),
loading: LoadingComponent, loading: LoadingComponent,
error: ErrorComponent, error: ErrorComponent,
timeout: 60000, timeout: 60000,

View file

@ -41,7 +41,7 @@
</template> </template>
<script> <script>
import {differenceWith} from 'lodash' import differenceWith from 'lodash/differenceWith'
import LabelService from '../../../services/label' import LabelService from '../../../services/label'
import LabelModel from '../../../models/label' import LabelModel from '../../../models/label'
@ -76,7 +76,7 @@ export default {
}, },
components: { components: {
multiselect: () => ({ multiselect: () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "multiselect" */ 'vue-multiselect'), component: import(/* webpackChunkName: "multiselect" */ 'vue-multiselect'),
loading: LoadingComponent, loading: LoadingComponent,
error: ErrorComponent, error: ErrorComponent,
timeout: 60000, timeout: 60000,

View file

@ -46,7 +46,7 @@ export default {
}, },
components: { components: {
multiselect: () => ({ multiselect: () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "multiselect" */ 'vue-multiselect'), component: import(/* webpackChunkName: "multiselect" */ 'vue-multiselect'),
loading: LoadingComponent, loading: LoadingComponent,
error: ErrorComponent, error: ErrorComponent,
timeout: 60000, timeout: 60000,

View file

@ -116,7 +116,7 @@ export default {
}, },
components: { components: {
multiselect: () => ({ multiselect: () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "multiselect" */ 'vue-multiselect'), component: import(/* webpackChunkName: "multiselect" */ 'vue-multiselect'),
loading: LoadingComponent, loading: LoadingComponent,
error: ErrorComponent, error: ErrorComponent,
timeout: 60000, timeout: 60000,

View file

@ -1,4 +1,6 @@
import {defaults, isNil, omitBy} from 'lodash' import defaults from 'lodash/defaults'
import isNil from 'lodash/isNil'
import omitBy from 'lodash/omitBy'
import {objectToCamelCase} from '@/helpers/case' import {objectToCamelCase} from '@/helpers/case'
export default class AbstractModel { export default class AbstractModel {

View file

@ -1,5 +1,5 @@
import TeamShareBaseModel from './teamShareBase' import TeamShareBaseModel from './teamShareBase'
import {merge} from 'lodash' import merge from 'lodash/merge'
export default class TeamListModel extends TeamShareBaseModel { export default class TeamListModel extends TeamShareBaseModel {
defaults() { defaults() {

View file

@ -1,5 +1,5 @@
import UserModel from './user' import UserModel from './user'
import {merge} from 'lodash' import merge from 'lodash/merge'
export default class TeamMemberModel extends UserModel { export default class TeamMemberModel extends UserModel {
defaults() { defaults() {

View file

@ -1,5 +1,5 @@
import TeamShareBaseModel from './teamShareBase' import TeamShareBaseModel from './teamShareBase'
import {merge} from 'lodash' import merge from 'lodash/merge'
export default class TeamNamespaceModel extends TeamShareBaseModel { export default class TeamNamespaceModel extends TeamShareBaseModel {
defaults() { defaults() {

View file

@ -1,5 +1,5 @@
import UserShareBaseModel from './userShareBase' import UserShareBaseModel from './userShareBase'
import {merge} from 'lodash' import merge from 'lodash/merge'
// This class extends the user share model with a 'rights' parameter which is used in sharing // This class extends the user share model with a 'rights' parameter which is used in sharing
export default class UserListModel extends UserShareBaseModel { export default class UserListModel extends UserShareBaseModel {

View file

@ -1,5 +1,5 @@
import UserShareBaseModel from './userShareBase' import UserShareBaseModel from './userShareBase'
import {merge} from 'lodash' import merge from 'lodash/merge'
// This class extends the user share model with a 'rights' parameter which is used in sharing // This class extends the user share model with a 'rights' parameter which is used in sharing
export default class UserNamespaceModel extends UserShareBaseModel { export default class UserNamespaceModel extends UserShareBaseModel {

View file

@ -31,58 +31,58 @@ import Table from '../views/list/views/Table'
import CreateSavedFilter from '@/views/filters/CreateSavedFilter' import CreateSavedFilter from '@/views/filters/CreateSavedFilter'
const PasswordResetComponent = () => ({ const PasswordResetComponent = () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "user-settings" */'../views/user/PasswordReset'), component: import(/* webpackChunkName: "user-settings" */'../views/user/PasswordReset'),
loading: LoadingComponent, loading: LoadingComponent,
error: ErrorComponent, error: ErrorComponent,
timeout: 60000, timeout: 60000,
}) })
const GetPasswordResetComponent = () => ({ const GetPasswordResetComponent = () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "user-settings" */'../views/user/RequestPasswordReset'), component: import(/* webpackChunkName: "user-settings" */'../views/user/RequestPasswordReset'),
loading: LoadingComponent, loading: LoadingComponent,
error: ErrorComponent, error: ErrorComponent,
timeout: 60000, timeout: 60000,
}) })
const UserSettingsComponent = () => ({ const UserSettingsComponent = () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "user-settings" */'../views/user/Settings'), component: import(/* webpackChunkName: "user-settings" */'../views/user/Settings'),
loading: LoadingComponent, loading: LoadingComponent,
error: ErrorComponent, error: ErrorComponent,
timeout: 60000, timeout: 60000,
}) })
// List Handling // List Handling
const NewListComponent = () => ({ const NewListComponent = () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "settings" */'../views/list/NewList'), component: import(/* webpackChunkName: "settings" */'../views/list/NewList'),
loading: LoadingComponent, loading: LoadingComponent,
error: ErrorComponent, error: ErrorComponent,
timeout: 60000, timeout: 60000,
}) })
const EditListComponent = () => ({ const EditListComponent = () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "settings" */'../views/list/EditListView'), component: import(/* webpackChunkName: "settings" */'../views/list/EditListView'),
loading: LoadingComponent, loading: LoadingComponent,
error: ErrorComponent, error: ErrorComponent,
timeout: 60000, timeout: 60000,
}) })
// Namespace Handling // Namespace Handling
const NewNamespaceComponent = () => ({ const NewNamespaceComponent = () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "settings" */'../views/namespaces/NewNamespace'), component: import(/* webpackChunkName: "settings" */'../views/namespaces/NewNamespace'),
loading: LoadingComponent, loading: LoadingComponent,
error: ErrorComponent, error: ErrorComponent,
timeout: 60000, timeout: 60000,
}) })
const EditNamespaceComponent = () => ({ const EditNamespaceComponent = () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "settings" */'../views/namespaces/EditNamespace'), component: import(/* webpackChunkName: "settings" */'../views/namespaces/EditNamespace'),
loading: LoadingComponent, loading: LoadingComponent,
error: ErrorComponent, error: ErrorComponent,
timeout: 60000, timeout: 60000,
}) })
const EditTeamComponent = () => ({ const EditTeamComponent = () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "settings" */'../views/teams/EditTeam'), component: import(/* webpackChunkName: "settings" */'../views/teams/EditTeam'),
loading: LoadingComponent, loading: LoadingComponent,
error: ErrorComponent, error: ErrorComponent,
timeout: 60000, timeout: 60000,
}) })
const NewTeamComponent = () => ({ const NewTeamComponent = () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "settings" */'../views/teams/NewTeam'), component: import(/* webpackChunkName: "settings" */'../views/teams/NewTeam'),
loading: LoadingComponent, loading: LoadingComponent,
error: ErrorComponent, error: ErrorComponent,
timeout: 60000, timeout: 60000,

View file

@ -1,5 +1,6 @@
import axios from 'axios' import axios from 'axios'
import {reduce, replace} from 'lodash' import reduce from 'lodash/reduce'
import replace from 'lodash/replace'
import {objectToSnakeCase} from '@/helpers/case' import {objectToSnakeCase} from '@/helpers/case'
export default class AbstractService { export default class AbstractService {

View file

@ -93,7 +93,7 @@ export default {
components: { components: {
Filters, Filters,
editor: () => ({ editor: () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "editor" */ '../../components/input/editor'), component: import(/* webpackChunkName: "editor" */ '../../components/input/editor'),
loading: LoadingComponent, loading: LoadingComponent,
error: ErrorComponent, error: ErrorComponent,
timeout: 60000, timeout: 60000,

View file

@ -114,7 +114,7 @@ export default {
components: { components: {
Filters, Filters,
editor: () => ({ editor: () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "editor" */ '../../components/input/editor'), component: import(/* webpackChunkName: "editor" */ '../../components/input/editor'),
loading: LoadingComponent, loading: LoadingComponent,
error: ErrorComponent, error: ErrorComponent,
timeout: 60000, timeout: 60000,

View file

@ -108,7 +108,7 @@ export default {
components: { components: {
ColorPicker, ColorPicker,
editor: () => ({ editor: () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "editor" */ '../../components/input/editor'), component: import(/* webpackChunkName: "editor" */ '../../components/input/editor'),
loading: LoadingComponent, loading: LoadingComponent,
error: ErrorComponent, error: ErrorComponent,
timeout: 60000, timeout: 60000,

View file

@ -198,7 +198,7 @@ export default {
LinkSharing, LinkSharing,
manageSharing, manageSharing,
editor: () => ({ editor: () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "editor" */ '../../components/input/editor'), component: import(/* webpackChunkName: "editor" */ '../../components/input/editor'),
loading: LoadingComponent, loading: LoadingComponent,
error: ErrorComponent, error: ErrorComponent,
timeout: 60000, timeout: 60000,

View file

@ -132,7 +132,7 @@ export default {
Fancycheckbox, Fancycheckbox,
manageSharing, manageSharing,
editor: () => ({ editor: () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "editor" */ '../../components/input/editor'), component: import(/* webpackChunkName: "editor" */ '../../components/input/editor'),
loading: LoadingComponent, loading: LoadingComponent,
error: ErrorComponent, error: ErrorComponent,
timeout: 60000, timeout: 60000,

View file

@ -414,7 +414,7 @@ export default {
Comments, Comments,
flatPickr, flatPickr,
editor: () => ({ editor: () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "editor" */ '../../components/input/editor'), component: import(/* webpackChunkName: "editor" */ '../../components/input/editor'),
loading: LoadingComponent, loading: LoadingComponent,
error: ErrorComponent, error: ErrorComponent,
timeout: 60000, timeout: 60000,

View file

@ -211,13 +211,13 @@ export default {
}, },
components: { components: {
multiselect: () => ({ multiselect: () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "multiselect" */ 'vue-multiselect'), component: import(/* webpackChunkName: "multiselect" */ 'vue-multiselect'),
loading: LoadingComponent, loading: LoadingComponent,
error: ErrorComponent, error: ErrorComponent,
timeout: 60000, timeout: 60000,
}), }),
editor: () => ({ editor: () => ({
component: import(/* webpackPrefetch: true *//* webpackChunkName: "editor" */ '../../components/input/editor'), component: import(/* webpackChunkName: "editor" */ '../../components/input/editor'),
loading: LoadingComponent, loading: LoadingComponent,
error: ErrorComponent, error: ErrorComponent,
timeout: 60000, timeout: 60000,