async clientPrefetch hook - analog of serverPrefetch, waiting for data loaded on client
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 54.4k
- Forks
- 9.2k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 140
Description
What problem does this feature solve?
Here are discussions: https://github.com/vuejs/vue-router/issues/1144 https://github.com/vuejs/vue/issues/7209 https://github.com/vuejs/pinia/discussions/988
There are cases where you need some data fetched before other components are initialized (mount hook called), for example authentication checked or user data fetched.
Currently need to use watches, which might be multiple, instead of a simple mounted hook in child components.
What does the proposed API look like?
Just the same as serverPrefetch, but on client.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the proposed clientPrefetch hook with the existing serverPrefetch behavior, then review the linked Vue and Pinia discussions for the unresolved API expectations. Done means client-side data loading can be awaited before child components are initialized, with behavior analogous to serverPrefetch.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100