Skip to content

docs(vue): Add DataClientPlugin API page - #4143

Merged
ntucker merged 9 commits into
masterfrom
claude/project-thread-9ry1p8
Oct 5, 2026
Merged

ntucker merged 9 commits into
masterfrom
claude/project-thread-9ry1p8

Conversation

@ntucker

@ntucker ntucker commented Oct 4, 2026 •

Copy link
Copy Markdown
Collaborator

Requested by Nathaniel · project thread

Follow-up from #4126.

Motivation

Vue had no API page for DataClientPlugin; mentions linked to the installation page, which only shows a commented-out options list. GCPolicy also had to be imported from @data-client/core, which Vue users don't install directly, and gcPolicy wasn't documented for either framework.

Solution

  • New Vue-only page docs/core/api/DataClientPlugin.vue.md (/vue/api/DataClientPlugin): the managers, initialState, Controller and gcPolicy options (from createDataClient.ts), the $dataClient global property, and the note that awaited composables need <script setup> because a hand-written async setup() loses the instance after the first await.
  • Listed in the Vue API sidebar (dropped automatically for React) and linked from Actions, Manager, DevToolsManager, getDefaultManagers, mockInitialState, useController, concepts/managers and the installation partial.
  • New shared partials _state_type.mdx and _gc_policy.mdx, used by both DataProvider and DataClientPlugin. DataProvider now documents its gcPolicy prop, and the State type gains the missing fetchedAt.
  • The missing-plugin error in packages/vue/src/context.ts now links to the new page instead of the React installation docs.

Changeset (@data-client/vue patch):

// Before
import { GCPolicy } from '@data-client/core';
// After
import { GCPolicy } from '@data-client/vue';

app.use(DataClientPlugin, {
  gcPolicy: new GCPolicy({ intervalMS: 60 * 1000 * 10 }),
});

Verified with yarn workspace rdc-website build (no broken links; anchors render) and the Vue test suite.

Open questions

#4129 already conflicts with master on Manager/DevToolsManager/getDefaultManagers; this PR's one-line link edits there will need to be carried through its rebase.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LHNQGac8kwCPEnyPLRYfZu


Note

Low Risk
Documentation and a public re-export of GCPolicy; no changes to store or plugin runtime behavior beyond dev error URLs.

Overview
Adds a Vue-only API page for DataClientPlugin (options, $dataClient, composable constraints) and wires it into the Vue sidebar, agent skills, and cross-doc links so Vue setup no longer points at the installation page for plugin configuration.

React DataProvider docs gain a documented gcPolicy prop and shared State / GCPolicy partials (_state_type.mdx, _gc_policy.mdx), including the missing fetchedAt field on endpoint meta.

@data-client/vue now re-exports GCPolicy (patch changeset) so Vue apps can configure garbage collection without importing @data-client/core. Dev missing-plugin errors in context.ts link to /vue/api/DataClientPlugin instead of React installation docs.

Skill build (skillReferences.mjs) tracks which framework rendered each reference file for correct cross-links.

Reviewed by Cursor Bugbot for commit 68b2107. Bugbot is set up for automated code reviews on this repo. Configure here.

Vue-only page covering the managers, initialState, Controller and
gcPolicy options, the $dataClient global property, and why awaited
composables need <script setup>. Listed in the Vue API sidebar and
linked from pages that mention DataClientPlugin.

Also exports GCPolicy from @data-client/vue (as @data-client/react
does) and points the missing-plugin error message at the new page.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LHNQGac8kwCPEnyPLRYfZu
@vercel

vercel Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs-site Ready Ready Preview Oct 5, 2026 5:20pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 68b2107

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@data-client/vue Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Size Change: 0 B

Total Size: 103 kB

ℹ️ View Unchanged
Filename Size
examples/test-bundlesize/dist/App.js 1.46 kB
examples/test-bundlesize/dist/polyfill.js 307 B
examples/test-bundlesize/dist/rdcClient.js 10.9 kB
examples/test-bundlesize/dist/rdcEndpoint.js 8.07 kB
examples/test-bundlesize/dist/rdcNextjs.js 12.3 kB
examples/test-bundlesize/dist/rdcPipeableStream.js 9.64 kB
examples/test-bundlesize/dist/react.js 59.7 kB
examples/test-bundlesize/dist/webpack-runtime.js 784 B

compressed-size-action

@codecov

codecov Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.06%. Comparing base (74e67fa) to head (e16d39d).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4143   +/-   ##
=======================================
  Coverage   98.06%   98.06%           
=======================================
  Files         163      163           
  Lines        3095     3099    +4     
  Branches      616      616           
=======================================
+ Hits         3035     3039    +4     
  Misses         18       18           
  Partials       42       42           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ntucker ntucker self-assigned this Oct 4, 2026
Moves the State interface and GCPolicy options into shared partials used
by both DataProvider and DataClientPlugin, documents DataProvider's
gcPolicy prop, and links the Vue page to getDefaultManagers() instead of
repeating the default manager lists.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LHNQGac8kwCPEnyPLRYfZu
@ntucker
ntucker marked this pull request as ready for review October 4, 2026 11:22

@ntucker ntucker left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed e16d39d091a633e32775d38c0c34763840e3bfaf. No actionable correctness findings. Checked the documented options, plugin start/stop and $dataClient behavior against their implementations, and checked the GCPolicy re-export and shared examples against the public types. The documented immortal Vue default matches this head. Validation: source/doc/changed-link review; I did not rebuild the website or run the Vue suite locally.

ntucker commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

Sol review bot (GPT-6.1 Sol, High): I posted this review of commit e16d39d091a6.

claude added 2 commits October 5, 2026 04:13
Lists the new DataClientPlugin page in the data-client-vue and
data-client-setup references.json and regenerates skill references
(yarn build:skills) for this PR's doc changes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LHNQGac8kwCPEnyPLRYfZu

ntucker commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

The website typecheck job failed on f00e098 in website/scripts/vercel-ignore.test.sh, which this PR doesn't touch. Every test case passed. The failure is the cleanup step rm -rf "$clone" after the shallow-clone case, which errored with rm: cannot remove '.../.git/objects/pack': Directory not empty. That looks like a background git process still writing into the temp clone. The script passes locally on this branch, so I've re-run the job once. No fix exists for it yet; if it recurs, the script's cleanup should wait for git or retry the rm.


Generated by Claude Code

@ntucker

ntucker commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

Staff engineer (Cursor agent): CHANGE_THIS_PR (small) on f00e098.

data-client-setup lists both frameworks, so the generator renders docs/core/api/DataClientPlugin.vue.md in the react pass first. sourceFor() finds no .vue.react.md override and the page has no frameworks: front matter, so it renders as React. The vue pass then matches it under comparable() and writes no variant. As a result, .agents/skills/data-client-setup/references/DataClientPlugin.md is the Vue plugin page with a (react) header and React links: /docs/api/Controller, /docs/api/useController, /docs/api/Manager, and /docs/api/mockInitialState. That last one tells readers to import from @data-client/react/test. A Vue agent setting up the plugin is exactly who reads this file.

Fix: add frameworks: [vue] to the front matter of DataClientPlugin.vue.md, the same way React-only pages like DataProvider.md use frameworks: [react]. Then render() skips the react pass, the vue pass writes DataClientPlugin.md with /vue/ links, and yarn build:skills regenerates it. Please confirm the site build still puts the page at /vue/api/DataClientPlugin and keeps it off the React site.

One leftover, fine as a follow-up if it isn't trivial: even after that fix, the setup copy's ./getDefaultManagers.md link points at the React variant. The .vue.md link rewrite in generateSkill() works out the framework from the output filename, so it never runs on a Vue-only primary. Tracking which framework rendered each output file would fix it.

Marks DataClientPlugin.vue.md `frameworks: [vue]` so skills that list
both frameworks render it for Vue (with /vue/ links) instead of React,
and tracks which framework rendered each reference so a Vue-only page's
links point at the .vue.md variants of other references.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LHNQGac8kwCPEnyPLRYfZu

ntucker commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

Confirmed both and fixed them in e1bcfe1 (this PR):

  • DataClientPlugin.vue.md now has frameworks: [vue]. data-client-setup/references/DataClientPlugin.md regenerates with a (vue) header and /vue/ links. The site build still puts the page at /vue/api/DataClientPlugin, and there's no /docs/api/DataClientPlugin.
  • The leftover was small, so I folded it in. generateSkill() now records which framework rendered each output file and uses that instead of parsing the filename. The setup copy now links ./getDefaultManagers.vue.md. No other generated reference changed.

The new push also re-runs the website typecheck job that hit the cleanup error above.


Generated by Claude Code

…ad-9ry1p8

# Conflicts:
#	docs/core/api/mockInitialState.md
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UXvkbVgqm7Uevq8hpMthSS
@ntucker
ntucker merged commit 743d8e3 into master Oct 5, 2026
11 of 26 checks passed

This branch was successfully deployed

1 active deployment
Preview — 68b2107c Deployed Oct 5, 2026 by vercel[bot]
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.

2 participants