From 30af4455e0a3fe81e5697e602ea7317af514d57b Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Wed, 21 Feb 2024 16:52:45 +0100 Subject: [PATCH] docs: updates to implementations --- docs/rfcs/data-loaders/basic.md | 69 +++++++++++++ docs/rfcs/data-loaders/colada.md | 25 ++++- package.json | 4 +- playground/package.json | 2 +- .../src/pages/users/colada-loader.[id].vue | 2 +- pnpm-lock.yaml | 98 ++++++++++--------- 6 files changed, 149 insertions(+), 51 deletions(-) diff --git a/docs/rfcs/data-loaders/basic.md b/docs/rfcs/data-loaders/basic.md index e38dcb441..69f14c30a 100644 --- a/docs/rfcs/data-loaders/basic.md +++ b/docs/rfcs/data-loaders/basic.md @@ -1,7 +1,76 @@ # `defineBasicLoader()` +Basic data loader that always reruns on navigation. + +::: warning +Data Loaders are experimental. Feedback is very welcome to shape the future of data loaders in Vue Router. +::: + ## Setup ## Example +```vue + + + + + +``` + ## SSR + +## Nuxt + +## Unresolved Questions + +- Should this basic version also track what is used in the route object, like [Svelte Data Loaders do](https://kit.svelte.dev/docs/load#rerunning-load-functions)? diff --git a/docs/rfcs/data-loaders/colada.md b/docs/rfcs/data-loaders/colada.md index 012f7df17..1b4611452 100644 --- a/docs/rfcs/data-loaders/colada.md +++ b/docs/rfcs/data-loaders/colada.md @@ -4,12 +4,25 @@ Loaders that use [@pinia/colada](https://github.com/posva/pinia-colada) under th The key used in these loaders are directly passed to `useQuery()` from `@pinia/colada` and are therefore invalidated by `useMutation()` calls. +::: warning +Pinia Colada is Experimental (like data loaders). Feedback is very welcome to shape the future of data loaders in Vue Router. +::: + ## Setup -Follow the instructions in [@pinia/colada](https://github.com/posva/pinia-colada). +Follow the installation instructions in [@pinia/colada](https://github.com/posva/pinia-colada). ## Example + + ```vue