feature/load-views-async #2672
No reviewers
Labels
No Label
area/internal-code
changes requested
confirmed
dependencies
duplicate
good first issue
help wanted
hosting
invalid
kind/bug
kind/feature
question
wontfix
No Milestone
No project
No Assignees
3 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: vikunja/frontend#2672
Loading…
Reference in New Issue
No description provided.
Delete Branch "dpschen/frontend:feature/load-list-views-async"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi dpschen!
Thank you for creating a PR!
I've deployed the changes of this PR on a preview environment under this URL: https://2672-feature-load-list-views-async--vikunja-frontend-preview.netlify.app
You can use this url to view the changes live and test them out.
You will need to manually connect this to an api running somehwere. The easiest to use is https://try.vikunja.io/.
Have a nice day!
WIP: feature/load-list-views-asyncto WIP: feature/load-views-asyncWIP: feature/load-views-asyncto feature/load-views-asyncI feel like there are way too many individual js files now:
Can't we at least group those < 3kb?
splitting per route is a common thing, since it allows us to reduce the initial request easily.
Via rollup we can tham decide which vendor dependencies get grouped whith which view. this way heavy vendor files will only get loaded when needed.
Habing many files / requests isn't a bad thing if we don't need them all at once.
What I want to add on top of this is dynamic preloading of links via hover (there is a plugin) and dynamic preloading in general. The latter allows us to cache all those files in the service worker when the user doesn't do anything.
There is another advantage of having many files: when there are no changes the hash should stay the same, meaning that the file will be cached much longer!
So... this is the way ™️ if you have a large js app and want to speed up initial load time / interaction.
Aren't all files already cached in the service worker?
I know with http/2 (and http/3 even more) the overhead of loading many files is very small so that it might makes sense, it just "feels" like a waste having that many files.
I think at least those you're very likely to use all at some point like list / namespace settings and the different views could be each one bundle.
Yes! and the smaller they are, the larger the chance they haven't changed.
It's not. Also 1 request per page isn't something new in the web ;)
Here is an article explaining this for vue 2. Seems still mostly valid for Vue 3:
https://vueschool.io/articles/vuejs-tutorials/lazy-loading-individual-vue-components-and-prefetching/
We have vite now so there are no magic comments.
But what we can do is this:
https://github.com/egoist/vue-router-prefetch
I'm not sure how much improvement we get here over the precaching we have with the service worker already. I think this can mostly improve the initial navigations. Reason beeing that the service worker just caches all of the app data, while vue-router-prefetch can prefetch the routes that you actually gonna need.
aaaand I squashed again -.-