Skip to content

docs: Share provider-with-managers setup across API pages - #4129

Merged
ntucker merged 22 commits into
masterfrom
claude/project-thread-bmcv3q
Oct 5, 2026
Merged

ntucker merged 22 commits into
masterfrom
claude/project-thread-bmcv3q

Conversation

@ntucker

@ntucker ntucker commented Oct 4, 2026 •

Copy link
Copy Markdown
Collaborator

Requested by Nathaniel · project thread

Includes #4145.

Motivation

Six API pages each carried their own copy of the "pass managers to the provider" setup: a 100+ line Web / React Native / NextJS / Expo tab block for React (LogoutManager, Manager) or a single web snippet (Controller, DevToolsManager ×2, PollingSubscription, getDefaultManagers), plus a Vue main.ts beside each. The installation page hand-wrote the same root files again. The copies had drifted (ReactDOM.render, unused imports, NextJS layout titled _layout.tsx).

Solution

website/src/components/providerSetup.mjs generates one platform's setup file (web, native, nextjs, expo, vue). ProviderSetupCode.tsx renders it on the site, and the skill-reference / llms.txt generator (docsToMarkdown.mjs) uses it too, so agents see the same code. Two partials use it:

  • docs/core/shared/_provider_managers.mdx: React platform tabs + Vue main.ts for a page's managers block. Used by LogoutManager, Manager, DevToolsManager, PollingSubscription, getDefaultManagers and Controller.
  • docs/core/shared/_installation.mdx (docs: Generate installation provider setup tabs from ProviderSetupCode #4145): the same tabs without managers. Installation-only extras (Anansi tab, redux links, NextJS guide button) stay as MDX around it.

Before (LogoutManager.md, ~170 lines):

:::react

<Tabs groupId="platform" ...>
<TabItem value="web">

```tsx title="/index.tsx"
import { DataProvider, LogoutManager, getDefaultManagers } from '@data-client/react';
import ReactDOM from 'react-dom';

const managers = [new LogoutManager(), ...getDefaultManagers()];

ReactDOM.createRoot(document.body).render(...);
```

</TabItem>
<!-- React Native, NextJS, Expo tabs... -->
</Tabs>

:::

:::vue

```ts title="main.ts"
...
```

:::

After:

import ProviderManagers from '../shared/_provider_managers.mdx';

<ProviderManagers imports={['LogoutManager', 'getDefaultManagers']}>

```ts
// highlight-next-line
const managers = [new LogoutManager(), ...getDefaultManagers()];
```

</ProviderManagers>
  • The managers block is read with the playground's existing parseCodeDocuments. Highlight comments carry through, and an import at the top of the block (Controller's unAuth) continues the generated import list.
  • Every page that used only a web snippet now gets all four React platform tabs.
  • docsToMarkdown.mjs now passes a partial its page's code block and evaluates JSX spreads ({...props}); skill references are regenerated.

Verified with a full website production build, the rendered /docs/... and /vue/... pages and their generated markdown, and yarn build:skills --check. Website typecheck and lint pass. Docs only, so no changeset.

🤖 Generated with Claude Code

https://claude.ai/code/session_01DE1vvoaeNDUbYnk4ewofap


Note

Low Risk
Documentation and doc-build tooling only; no library runtime or auth behavior changes.

Overview
Deduplicates DataProvider / DataClientPlugin setup examples across API and installation docs by generating platform-specific snippets from one shared module.

Adds providerSetup.mjs and ProviderSetupCode, plus _provider_managers.mdx, so pages only supply a short managers code block (and optional imports) instead of repeating Web / React Native / Next.js / Expo / Vue tab content. LogoutManager, Manager, Controller, DevToolsManager, PollingSubscription, and getDefaultManagers are refactored to use this partial; installation uses the same generator without managers.

Updates docsToMarkdown.mjs to render ProviderSetupCode, forward partial children, and evaluate JSX spreads so regenerated agent skill references match the live site. Vue installation copy is tightened (default app.use(DataClientPlugin) with options described in prose).

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

claude added 9 commits October 3, 2026 20:27
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
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
Adds docs/core/shared/_provider_managers.mdx, which renders the React
platform tabs (web, React Native, NextJS, Expo) and the Vue main.ts from
a single `managers` code block. LogoutManager, Manager, DevToolsManager,
PollingSubscription, getDefaultManagers and Controller now use it instead
of their own copies.

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

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DE1vvoaeNDUbYnk4ewofap
@ntucker ntucker self-assigned this Oct 4, 2026
@changeset-bot

changeset-bot Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: fa82596

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 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 11:37pm UTC

Request Review

…omponent

Reuses parseCodeDocuments for the managers block, builds only the requested
platform's file, and drops the leading-import parsing.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DE1vvoaeNDUbYnk4ewofap
The partial is also built as its own page until shared partials are excluded.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DE1vvoaeNDUbYnk4ewofap
claude added 2 commits October 4, 2026 16:06
…ad-bmcv3q

# Conflicts:
#	docs/core/api/Controller.md
#	docs/core/api/DevToolsManager.md
#	docs/core/api/LogoutManager.md
#	docs/core/api/Manager.md
#	docs/core/api/PollingSubscription.md
#	docs/core/api/getDefaultManagers.md
#4145)

managers is now optional in ProviderSetupCode, so the installation
partial renders its Web/React Native/NextJS/Expo tabs and Vue main.ts
from the same source as the managers partial.


Claude-Session: https://claude.ai/code/session_01WS9omUKcWVGuPunL3VoKc4

Co-authored-by: Claude <noreply@anthropic.com>
Base automatically changed from claude/project-thread-gj9jkx to master October 5, 2026 04:20
…ad-bmcv3q

# Conflicts:
#	docs/core/api/Controller.md
#	docs/core/api/DevToolsManager.md
#	docs/core/api/LogoutManager.md
#	docs/core/api/Manager.md
#	docs/core/api/PollingSubscription.md
#	docs/core/api/mockInitialState.md
ProviderSetupCode now builds its code with a shared providerSetup module,
which the markdown generator also uses, so generated references show the
same per-platform setup files. Partials receive their page's code block,
and JSX spreads are evaluated. Also drops a leftover Vue block on
LogoutManager from the master merge.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DE1vvoaeNDUbYnk4ewofap
@ntucker
ntucker marked this pull request as ready for review October 5, 2026 07:32
claude added 2 commits October 5, 2026 23:14
…ad-bmcv3q

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

Partials get their raw children; the ProviderSetupCode case extracts the
code block, matching the site component.

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

@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.

One actionable issue in the validation triggers for the new shared snippet generator.

Comment thread website/framework-docs/docsToMarkdown.mjs Outdated
…ecks see it

Skill references depend on the provider setup generator; the skills
workflow and pre-push hook already watch website/framework-docs/.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DE1vvoaeNDUbYnk4ewofap
@ntucker
ntucker merged commit 437ed40 into master Oct 5, 2026
22 checks passed
@ntucker
ntucker deleted the claude/project-thread-bmcv3q branch October 5, 2026 23:39

This branch was successfully deployed

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