Skip to content

docs: Vue examples for REST and schema pages that Vue skills read - #4185

Open
ntucker wants to merge 2 commits into
masterfrom
claude/vue-skill-examples-5i9hdo
Open

ntucker wants to merge 2 commits into
masterfrom
claude/vue-skill-examples-5i9hdo

Conversation

@ntucker

@ntucker ntucker commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator

Requested by Nathaniel · project thread

Motivation

The data-client-rest, -rest-setup, -schema and -setup skills cover both frameworks, but their references come from docs/rest pages that only had React components. Vue agents read JSX, un-awaited useSuspense() and @data-client/react imports.

Before (data-client-rest/references/optimistic-updates.md, read by Vue agents):

import { useController } from '@data-client/react';
export default function TodoItem({ todo }: { todo: Todo }) {
  const ctrl = useController();
  ...

After (optimistic-updates.vue.md):

<script setup lang="ts">
  import { useController } from '@data-client/vue';
  const props = defineProps<{ todo: Todo }>();
  const ctrl = useController();
  ...
</script>

Solution

  • 26 docs/rest pages and partials get :::react/:::vue siblings (playgrounds switch to FrameworkPlayground), so yarn build:skills writes 31 new .vue.md references. React renderings are byte-identical except one heading that gained an explicit id.
  • The /rest docs instance now runs remarkFramework for React, same as /docs, so the site keeps showing the React examples and :::vue never leaks onto it. The Vue content also reaches the Vue llms-full.txt.
  • Setup skill: DataProvider is labeled React-only, with the Vue DataClientPlugin equivalent.
  • Fixed two pre-existing example bugs on the way: the infinite-scroll NewsList rendered itself, and getPage called an undefined TodoResource.

Open questions

The /rest pages still show only React to Vue readers on the site; giving the rest instance a framework switch would be its own change.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Crjxi2J3nfmnxg1sQaC8p5


Generated by Claude Code


Note

Low Risk
Documentation and generated skill references only; no runtime or API behavior changes.

Overview
Adds Vue-facing skill references (31 new *.vue.md files under .agents/skills) so agents on Vue projects see @data-client/vue, <script setup>, and await useSuspense() instead of React JSX and un-awaited hooks.

Existing skill docs are updated in parallel: examples use useFetch() before awaiting multiple useSuspense() calls, pagination calls getTodos.getPage (not an undefined TodoResource), and cross-links point at .vue.md siblings (auth, Collection, Entity, guides). Wording shifts from “hooks” to composables where appropriate.

React references get small correctness fixes too (useController() in the pagination snippet, PostList instead of a self-referencing NewsList in infinite scroll). auth.md gains an explicit heading id; setup main.ts drops a misleading tsx fence label.

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

Vue agents reading the data-client-rest, -rest-setup, -schema and -setup
skill references got React components (JSX, un-awaited useSuspense,
@data-client/react). docs/rest pages now carry :::react/:::vue siblings
(FrameworkPlayground for playgrounds), so build:skills writes .vue.md
variants with <script setup> SFCs. The /rest site instance runs
remarkFramework for React, so the site still shows the React examples.

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

changeset-bot Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: a528283

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@vercel

vercel Bot commented Oct 5, 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 10:12am UTC

Request Review

Start parallel fetches with useFetch, keep endpoints at module scope,
create the date formatter once, and run remarkFramework on every React
docs instance (graphql too) from one shared value.

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

ntucker commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

Staff engineer (Cursor agent): LGTM. FOLLOW_UP after merge, nothing to change in this PR.

The :::react/:::vue siblings follow the same convention docs/core already uses, and running remarkFramework for React on /rest and /graphql from one shared value is the right shape. I spot-checked the Vue blocks: no @data-client/react imports, no JSX, and every useSuspense() in them is awaited.

The long-term risk is drift. The ~2.7k lines of new Vue examples in docs/rest are never rendered, run, or type-checked anywhere: /rest strips :::vue, and FrameworkPlayground only runs in React mode there. Agents are the only readers, so a broken Vue snippet won't show up until an agent copies it. The docs/core Vue examples don't have this problem because /vue renders them.

Follow-up: give Vue snippets a check. Either do the /rest framework switch from the open question, so the Vue playgrounds actually run, or add a cheap CI pass that pulls the :::vue code blocks out of docs/rest and type-checks them with vue-tsc. The framework switch is probably the better fix because it also helps Vue readers on the site.

ntucker commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator Author

Agreed on the drift risk, and it's queued as a follow-up: a CI pass that type-checks the Vue blocks with vue-tsc, extracted from the Vue renderings. One correction: the docs/core Vue examples have the same gap. /vue renders them, but FrameworkPlayground shows a static editor for Vue there, so they are never run or type-checked either. That's why the check should cover both rather than only docs/rest. The /rest framework switch is a site UX decision, so I left it as an open question for Nathaniel.


Generated by Claude Code

This branch was successfully deployed

1 active deployment
Preview — a5282834 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