docs: Show Vue code on expiry, error, validation and normalization pages - #4168
Conversation
…ncepts These shared pages rendered React-only playgrounds and examples on /vue. Add Vue SFC equivalents in :::vue blocks (FrameworkPlayground for the playgrounds), Vue titles, and explain that invalidated data keeps showing in Vue instead of re-suspending. Share the getUpdated endpoints between frameworks. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsC4xtSrEMKiB83pucAyLG
|
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
ntucker
left a comment
There was a problem hiding this comment.
Staff engineer (Cursor agent): LGTM. No changes requested for this PR.
What I checked:
- The Vue demos line up with how
@data-client/vue'suseSuspenseactually behaves on this tip. Errors surface by throwing on read, so the hard-error buttons reach theonErrorCapturedhandler inShowTime.vue. Vue keeps the previous data while refetching rather than suspending again, which matches the new Invalidate wording. - Making
FAKE_ERRORfail once in the sharedgetUpdatedis simpler than the ReactuseEffectcleanup and behaves the same, or better, on both pages. A soft fetch no longer leaves the fake error set for later revalidations. - The inline
:react[...]:vue[...]heading with{#invalidate}and the::::reactwrapper around the nested:::infoboth resolve throughremarkFramework's recursivefilterChildren. - Renaming the normalization tab from React to Component is right, since a tab label can't vary by framework, and nothing groups or links to that tab value.
No follow-ups. The repeated Vue SFCs across playgrounds are expected, because each playground is self-contained, the same way the React side is.
Requested by Nathaniel · project thread
Before:
/vue/concepts/expiry-policy,error-policy,validationandnormalizationshowed React playgrounds and components (useEffect,AsyncBoundary,@data-client/reactimports).After: each React block sits in
:::reactwith a Vue SFC alongside it in:::vue, and the playgrounds useFrameworkPlayground. The Vue pages also get Vue titles.How:
:keyinside<Suspense timeout="0">so they suspend for the new id. The "Invalidate" section now explains that Vue keeps showing the previous data while it refetches (it can't suspend again after setup), and thatuseCache()returnsundefinedanduseDLE()'sloadingistruemeanwhile (checked against the Vue tests). The React Native note is React-only.getUpdatedandcreateErrormove to a shared file both frameworks import.FAKE_ERRORnow clears itself after one failed fetch, which replaces the ReactuseEffectcleanup.Not included:
Controller.mdandmockInitialState.mdare already covered by #4117._useCancelling.mdxonly renders on React pages, and_useTransition.mdxisn't imported anywhere.Docs only, so no changeset.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LsC4xtSrEMKiB83pucAyLG
Generated by Claude Code
Note
Low Risk
Documentation-only updates to concept pages and live examples; no runtime or library code changes.
Overview
Vue concept pages for expiry policy, error policy, validation, and normalization now mirror the React docs: interactive examples use
FrameworkPlaygroundinstead ofHooksPlayground, with shared API snippets and parallel:::react/:::vueblocks (Vue SFCs using@data-client/vue).Expiry policy adds Vue versions of all six demos; param-switching uses
:keyonTimePageinside<Suspense timeout="0">so remounts suspend. The invalidate section documents Vue-specific behavior (no re-suspend after setup;useCache()/useDLE()signals during refetch) and scopes the React Native note to React only.Error policy and validation get
vue_titlefrontmatter. Error policy refactors demo helpers into sharedgetUpdated/createError;FAKE_ERRORclears after one failed fetch (replacing ReactuseEffectcleanup). Normalization renames the tab to Component and adds Vue mutation examples alongside React.Reviewed by Cursor Bugbot for commit cbd1708. Bugbot is set up for automated code reviews on this repo. Configure here.