Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs for v2.0 #325

Merged
merged 28 commits into from Dec 9, 2022
Merged

Docs for v2.0 #325

merged 28 commits into from Dec 9, 2022

Conversation

koba04
Copy link
Collaborator

@koba04 koba04 commented Aug 5, 2022

This is a PR to update docs for v2.

Todos

@vercel
Copy link

vercel bot commented Aug 5, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
swr-site ✅ Ready (Inspect) Visit Preview Dec 8, 2022 at 11:41PM (UTC)

@koba04 koba04 changed the title Docs for v2.0 [DO NOT MERGE] Docs for v2.0 Aug 5, 2022
@koba04
Copy link
Collaborator Author

koba04 commented Aug 9, 2022

@shuding
As for "Internal structure of the cached data", you left "Documentation" as a TODO, but we currently don't have any documentation about the internal structure of the cache data.
vercel/swr#1863

Should we add it to the docs?

image

https://swr.vercel.app/docs/advanced/cache#access-to-the-cache

@shuding
Copy link
Member

shuding commented Aug 9, 2022

@koba04 Thanks for noticing this! I think it's still internal, but I marked it as "TODO" because it's a breaking change if someone relies on the old structure. So we should document this change in the 2.0 migration guide (like how we did for 1.0).

@koba04
Copy link
Collaborator Author

koba04 commented Aug 10, 2022

@shuding Thank you! That makes sense, I missed the migration guide😅

@vercel-team
Copy link

vercel-team commented Aug 13, 2022

📝 Changed routes:

/blog/meta.en-US /blog/meta.es-ES
Screenshot of /blog/meta.en-US
(view full size)
Screenshot of /blog/meta.es-ES
(view full size)
/blog/meta.ja /blog/meta.ko
Screenshot of /blog/meta.ja
(view full size)
Screenshot of /blog/meta.ko
(view full size)
/blog/meta.pt-BR /blog/meta.ru
Screenshot of /blog/meta.pt-BR
(view full size)
Screenshot of /blog/meta.ru
(view full size)

And 133 other routes:

Commit bd2f77e (https://swr-site-5ka4povpv.vercel.sh).

* Empty commit for v2 branch

* docs: add mutate filter functions documentation in v2

* remove the usage of cache.clear() and use mutate instead
@huozhi
Copy link
Member

huozhi commented Aug 30, 2022

@koba04 is the force-push for rebasing the new updates on main branch? Maybe we can leave it like this for now and cherry-pick the missing change after the major work is done. Rebasing will override the commits hash, and may have some conflicts if there's any

@koba04
Copy link
Collaborator Author

koba04 commented Aug 30, 2022

@huozhi Thank you. That makes sense👍 I'll merge main instead of rebasing when we'll need it.

koba04 and others added 4 commits August 30, 2022 16:31
* Empty commit for v2 branch

* docs: add preload API documentation in v2

* Apply suggestions from code review

Co-authored-by: Jiachi Liu <inbox@huozhi.im>

* Update pages/docs/prefetching.en-US.md

Co-authored-by: Jiachi Liu <inbox@huozhi.im>

* apply suggestions to other languages

Co-authored-by: Jiachi Liu <inbox@huozhi.im>
* Empty commit for v2 branch

* docs: add DevTools documentation in v2

* Apply suggestions from code review

Co-authored-by: Jiachi Liu <inbox@huozhi.im>

* apply suggestions to other languages

Co-authored-by: Jiachi Liu <inbox@huozhi.im>
* Empty commit for v2 branch

* docs: Nesting configurations with SWRConfig

* Apply suggestions from code review

Co-authored-by: Jiachi Liu <inbox@huozhi.im>

* Update pages/docs/global-configuration.en-US.md

Co-authored-by: Jiachi Liu <inbox@huozhi.im>

* apply suggestions to other languages

Co-authored-by: Jiachi Liu <inbox@huozhi.im>
* Fetcher no longer accepts multiple arguments in v2

* Empty commit for v2 branch

* Apply suggestions from code review

Co-authored-by: Jiachi Liu <inbox@huozhi.im>

* Update pages/docs/arguments.en-US.md

Co-authored-by: Jiachi Liu <inbox@huozhi.im>

* apply suggestions to other languages

Co-authored-by: Jiachi Liu <inbox@huozhi.im>
* docs: add an example for preload in effects

* Update pages/docs/prefetching.en-US.md

Co-authored-by: Jiachi Liu <inbox@huozhi.im>

* merge examples for inside React

* Update pages/docs/prefetching.en-US.md

Co-authored-by: Jiachi Liu <inbox@huozhi.im>

* apply a suggestion

Co-authored-by: Jiachi Liu <inbox@huozhi.im>
* docs: add the Return Values page

* docs: add isLoading and keepPreviousData option

* docs: fix header levels

* docs: add a video for keepPreviousData

* docs: move arguments page to next to return values page

* docs: update diagrams for returning values

* docs: update the performance document to add isLoading

* docs: keep the list of return values in the options document

* use isLoading instead of !data

* translate options.md into Japanese

* docs: add a detail link for keepPreviousData

* tweak the description of isLoading

* revert to move the arguments page

* move the return values page into the advanced section

* rename the Options page to API Options

* fix links to the return values

* fix a typo

* add an excalidraw file for the state machine diagrams

* rename the page from Return Values to Understanding SWR

* rename the Options page to API

* translate Understanding SWR into Japanese

* tweak

* change /docs/options links to /docs/api

* Update pages/docs/advanced/meta.en-US.json

Co-authored-by: Jiachi Liu <inbox@huozhi.im>

* change the link of Understanding SWR

Co-authored-by: Jiachi Liu <inbox@huozhi.im>
* reorganize the mutation page for useSWRMutation

* write paramters and return values sections for mutation

* docs: add examples of useSWRMutation

* add an exmple to use useSWRMutation for loading data

* Apply suggestions from code review

Co-authored-by: Jiachi Liu <inbox@huozhi.im>

Co-authored-by: Jiachi Liu <inbox@huozhi.im>
* Empty commit for v2 branch

* docs: add notes for Suspense on SSR and React v18

* Apply suggestions from code review

Co-authored-by: Jiachi Liu <inbox@huozhi.im>

* apply suggestions to other languages

* Apply suggestions from code review

Co-authored-by: Jiachi Liu <inbox@huozhi.im>

* update other language

Co-authored-by: Jiachi Liu <inbox@huozhi.im>
* fix: the hook name of useSWRMutation example

* fix: optimisticData examples
add onDiscarded option
* blog improvements

* update

* update blog post

* update mutation

* update
@koba04
Copy link
Collaborator Author

koba04 commented Nov 23, 2022

⚠️ We have to update the publish date before merging this 🗒️

docs: change the build target in the v2 blog
* Add functional rollbackOnError description

* fix typo
* Rename laggy ui to preserving previous state

* fix
@huozhi huozhi marked this pull request as ready for review December 9, 2022 16:12
@huozhi huozhi merged commit efea2b0 into main Dec 9, 2022
@huozhi huozhi deleted the v2 branch December 9, 2022 16:14
@huozhi huozhi restored the v2 branch December 10, 2022 12:19
@shuding shuding deleted the v2 branch December 11, 2022 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants