docs: Vue examples for Controller and manager API pages - #4117
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LfrAWX2uC23Ym1SNjRYvo5
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
ntucker
left a comment
There was a problem hiding this comment.
Staff LGTM + FOLLOW_UP — does not ask this PR to change.
Closes the #4113 shared-API follow-up for Controller + manager pages: :::react / :::vue siblings for fetch / invalidate / expire / logout / reset / setResponse / subscribe / get / getResponse / getState, plus manager install via DataClientPlugin. Vue patterns look right (computed() for suspense args, onMounted / watchEffect, getState() in handlers, no React setTimeout). Nice incidental React fixes (closed <h1>, Delete useCallback deps, fetch arity, StateContext, mockInitialState fixture keys). Intentionally leaves set() / DevTools predicate to #4103 — good conflict hygiene. Docs-only, no changeset.
FOLLOW_UP (later polish; merge this first)
- Manager.md deeper prose still React-centric — Control flow still says "DataProvider store"; middleware / TypeScriptEditor examples import
@data-client/reactand talk about React commit. This PR fixed the install tabs; gradual dual-source (or:react/:vueon those bits) later — same entropy thread as #4113. - Controller
set()Vue sibling — deferred to #4103 by design. After #4103 lands (or if it stays React-only), add the Vue counterpart so/docs/vuedoes not regress on that section. - Soft — shared
useLogoutsketch aboveinvalidateAllis still React-flavored and visible on Vue; wrap in:::reactwhen convenient. LogoutManager Github StackBlitz correctly hidden from Vue — fine as-is unless someone wants a Vue demo later.
Hold merge until Bugbot finishes on d01ab2fb (still in progress at review time; deploy/typecheck also running). No CHANGE_THIS_PR. Staff does not merge.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4117 +/- ##
=======================================
Coverage 97.87% 97.87%
=======================================
Files 156 156
Lines 3057 3057
Branches 612 612
=======================================
Hits 2992 2992
Misses 18 18
Partials 47 47 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LfrAWX2uC23Ym1SNjRYvo5
|
Here's how I handled each follow-up from the Staff review:
The DevToolsManager Generated by Claude Code |
ntucker
left a comment
There was a problem hiding this comment.
Staff LGTM + FOLLOW_UP — tip 22250a5 does not ask this PR to change.
Delta since d01ab2fb closes the Manager.md React-leakage follow-up from the prior Staff note: :react/:vue on the effect analogy, middleware commit paragraph, and Control flow provider wording; TypeScriptEditor examples import Manager / Middleware / actionTypes from @data-client/core; comment no longer says "committed to React". Matches the dual-source pattern and keeps the playground types honest for both frameworks.
Author's disposition on the other two soft notes is correct — no CHANGE_THIS_PR:
set()— snippets are already framework-neutralctrl.set(...); no Vue sibling needed.useLogout—useController()+ returned closure is valid as a Vue composable; wrapping in:::reactwould hide a useful example.
FOLLOW_UP (later; merge this first)
- Soft — DevToolsManager
predicateexample still imports@data-client/react. Leave until #4103 lands (same block), then dual-source or move to@data-client/coreif types allow.
Hold merge until Bugbot finishes on 22250a5 (in progress at review time; typecheck/deploy also running). Docs-only, no changeset. No CHANGE_THIS_PR. Staff does not merge.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LfrAWX2uC23Ym1SNjRYvo5
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LfrAWX2uC23Ym1SNjRYvo5
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LfrAWX2uC23Ym1SNjRYvo5
…main Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LfrAWX2uC23Ym1SNjRYvo5
|
This is where every follow-up from the Staff reviews, Bugbot, the adversarial review and the cleanup pass ended up. Fixed in this PR
Rejected
Separate PR (queued)
Generated by Claude Code |
Vue's useSuspense can't re-suspend after setup, so it keeps returning the current data while invalidate()/invalidateAll() refetch. Say so on the Vue page, label the Vue buttons "Refetch", and keep the "display stale data" tips React-only. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LfrAWX2uC23Ym1SNjRYvo5
…ferences
Master now resolves getter args in Vue composables and its docs pass
`() => ({ id: props.id })` instead of computed(). Match that in the
invalidate examples and the subscribe sketch, note in the expiry policy
that mounted Vue components keep their data while invalid data refetches,
and regenerate skill references from the updated docs.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LfrAWX2uC23Ym1SNjRYvo5
The Vue mockInitialState example now imports from @data-client/vue/test, which Vue apps already install, and the Vue testing skill references the page now that it has a Vue example. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LfrAWX2uC23Ym1SNjRYvo5
App-level docs code never imports from @data-client/core, which many package managers won't resolve unless it's installed directly. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LfrAWX2uC23Ym1SNjRYvo5
|
Staff engineer (Cursor agent): FOLLOW_UP only, nothing to change in this PR at The new commits check out: the Vue examples' getter args match master's One thing for later: |
- Link Vue invalidate/Invalid wording to expiry-policy#invalidate, which already explains it, and note on Snapshot that Vue only suspends on mount - Replace the Vue getState() example that re-implemented fetchIfStale() - Share mockInitialState's fixtures between the React and Vue examples Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LfrAWX2uC23Ym1SNjRYvo5
|
Agreed on the shared Manager imports. They're a follow-up, not part of this PR. The same problem exists on master in Controller.md and concepts/managers.md, so it's better fixed once in the framework-docs pipeline, by rewriting Generated by Claude Code |
Requested by Nathaniel · project thread
Motivation
/docs/vue/api/Controllerand the shared manager pages still showed React components,useEffect,DataProviderand@data-client/reactimports to Vue readers.Solution
Uses the
:::react/:::vueblocks from #4105/#4113. React examples are unchanged apart from small fixes; each gets a Vue sibling.<script setup>versions forfetch(Create/Update/Delete),expireAll,invalidate,invalidateAll, the LogoutManager setup,resetEntireStore,setResponse(onMounted/onUnmounted),subscribe(watchEffect),get/getResponse(event handlers withgetState()) andgetState. The VuegetStateexample checksexpiryStatusin a handler and notes that mutations resolve before the store is updated. Reactive args go throughcomputed(() => ({ ... })).DataProvidersetup moves behind:::react, and Vue gets amain.tswithapp.use(DataClientPlugin, { managers }). Manager.md's prose is now framework-aware, and its editor examples import from@data-client/core.Fixes I made to the React examples while I was there: unclosed
<h1>tags, theuseCallbackdeps in the Delete tab,fetch(TradeResource.getList.push, args, body), theuseQuery/useCachesketches now import from@data-client/react(useCacheStateisn't exported, so they useuseContext(StateContext)), andmockInitialStatenow uses the current fixture keys (endpoint/args/response).I left the
set()section of Controller.md and the DevToolsManagerpredicateexample alone, because #4103 edits both.Open questions
None.
Docs-only, so there's no changeset.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LfrAWX2uC23Ym1SNjRYvo5
Note
Low Risk
Documentation and generated skill references only; no runtime or API behavior changes.
Overview
Adds framework-split documentation so Vue readers get idiomatic examples instead of React-only snippets on Controller and manager API pages.
Controller (and mirrored skill refs) now use
:::react/:::vueblocks: Vue gets<script setup>samples forfetch, cache invalidation,DataClientPlugin+LogoutManager, lifecycle hooks for WebSockets/subscriptions (watchEffect), and guidance to usegetState()in handlers vsuseQuery/useCachein templates. Expiry policy and Snapshot text clarifies that Vue mounted components keep showing data during invalidation refetches.Shared manager pages (Manager, LogoutManager, DevToolsManager, PollingSubscription, mockInitialState) gain Vue
main.tsinstall examples; a new LogoutManager.vue skill page and vue-testingmockInitialStatereference are added. React examples are corrected in place (markup,fetchargument shape,StateContextinuseQuery/useCachesketches, current fixtureendpoint/args/responsekeys).Reviewed by Cursor Bugbot for commit 2abd2e3. Bugbot is set up for automated code reviews on this repo. Configure here.