Skip to content

docs(data-objectstack): document the real headless surface, not a phantom React API - #4129

Merged
yinlianghui merged 1 commit into
mainfrom
claude/issue-4124-data-objectstack-docs-api
Aug 10, 2026
Merged

docs(data-objectstack): document the real headless surface, not a phantom React API#4129
yinlianghui merged 1 commit into
mainfrom
claude/issue-4124-data-objectstack-docs-api

Conversation

@yinlianghui

Copy link
Copy Markdown
Collaborator

Fixes#4124

Docs-only. Rewrites content/docs/utilities/data-objectstack.mdx around the surface the package actually exports.

Ordering

PR #4127 (#3781) edits the same page and has merged1b6188d41, the tip of origin/main. This branches off main; no stacking was needed. Its dependency prose (install note at :16, the Dependencies list) is untouched — verified by grepping the diff for those lines: zero hits.

Premise re-verified on the branch tip

Both symbols are genuinely absent, so the card holds:

  • grep -rn "ObjectStackProvider|useObjectStack" packages/data-objectstack/src/ -> exit 1, zero matches.
  • The export list in packages/data-objectstack/src/index.ts is ObjectStackAdapter, createObjectStackAdapter, the error classes, MetadataClient, CloudOperations, SecurityManager, IntegrationManager, createObjectStackUserStateAdapter, the studio/contract helpers and types. No provider, no hook.

Reverse verification — the API the page used to teach, compiled against the built package:

error TS2724: '"@object-ui/data-objectstack"' has no exported member named
'ObjectStackProvider'. Did you mean 'ObjectStackError'?
error TS2305: Module '"@object-ui/data-objectstack"' has no exported member 'useObjectStack'.

That is the error a reader following the old Quick Start hit.

Two fabrication families, not one

1. The phantom React API (the card). Removed page-wide, not just at the three cited lines — it reached well beyond them: the Features bullet calling the package a "React context provider", Quick Start, both API Reference entries, the whole Configuration section, all three Advanced Usage examples, and Troubleshooting. Replaced with createObjectStackAdapter / ObjectStackAdapter injected via @object-ui/react's SchemaRendererProvider, which is what the README, content/docs/guide/data-source.md and seven plugin READMEs already teach.

The REACT_APP_OBJECTSTACK_* environment variables went with it: the package reads no environment variable of its own (grep for process.env in its src/ finds only a JSDoc example).

2. The JSON dataSource shape — found by the page-wide sweep the card asked for. Every JSON block used a type: "objectstack" discriminator with a query: { filters, sort, limit } body. That shape has zero occurrences repo-wide (grep over all .ts/.tsx/.json). The real per-element binding is the spec's ElementDataSource, validated by ElementDataSourceSchema in @objectstack/spec:

documented beforeactual
discriminator"type": "objectstack"none — the binding has no type tag
objectobjectobject (required)
filterquery.filters: [{field, operator, value}]filter: FilterCondition (object form, e.g. { "total": { "$gt": 100 } })
sortquery.sort: [{field, direction}]sort: [{ field, order }]
limitquery.limitlimit
saved viewview

The spec schema is z.strict, so the old type key would have been rejected, not ignored. Examples now use the block names from the guide's own support table (object-grid, object-form, object-kanban); kanban as written had no registration at all.

Corrected symbols

symboldisposition
ObjectStackProviderdeleted — not exported
useObjectStackdeleted — not exported
ObjectStackDataSource (interface)replaced by ElementDataSource
apiUrl / apiKey / organizationId propsreplaced by baseUrl / token
REACT_APP_OBJECTSTACK_*deleted — package reads no env vars
client.query / client.aggregatereplaced by find / findOne / create / update / delete
createObjectStackAdapteradded, real config incl. fetch, cache, reconnect options
ObjectStackAdapteradded, class form
SchemaRendererProvideradded, the real injection point

Three inaccuracies the type-check caught in my own draft

The mechanical check earned its keep — it went red on my first rewrite and each red was a real fact:

  1. create() returns unknown unless the adapter is parameterised, so user.id did not compile. The docs now show the generic form.
  2. bulk and batchTransaction are optional members of DataSource (bulk?(...), batchTransaction?(...)), so through a DataSource-typed value they need feature-detection. The page now says so and shows the class type for those calls.
  3. getConnectionState / onConnectionStateChange are not on DataSource at all — they are ObjectStackAdapter class members. The method list is now split into "on the DataSource interface" and "adapter-only".

Without compiling the snippets all three would have shipped as new, confidently-worded errors.

Verification

No mdx snippet-check gate exists in this repo (scripts/extract-mdx-demos.mjs is an unwired one-off migration tool, not a gate), so per the card I extracted the snippets and ran tsc against the built workspace packages.

gateresult
snippet tsc (extracted, strict, against built dist/*.d.ts)exit 0
snippet tsc on the OLD phantom imports (reverse)exit 2 — TS2724 / TS2305 above
pnpm turbo run build --filter=@object-ui/site --force29 successful, 29 total, 0 cached, 2m13s
node scripts/check-doc-links.mjsLinks are valid across 7 scan roots.
node scripts/check-control-bytes.mjsOK (scanned 3829 tracked text file(s))
node scripts/check-changeset-presence.mjsNo source of a released package changed in this range, so no changeset is owed.

The build closure was built first (--filter '...^...') so tsc read real declarations rather than stale ones.

A note on the docs build: an unforced re-run reported 29 cached / FULL TURBO in 80ms after I had edited the mdx — turbo's input hash for @object-ui/site does not appear to track content/docs/**. The green above is therefore from a --force run. Worth knowing for anyone reading a cached Build Docs as validation of a content change.

Rendered-output check on apps/site/.next/server/app/docs/utilities/data-objectstack.html: ObjectStackProvider, useObjectStack, REACT_APP, apiKey, organizationId and "type": "objectstack" all render 0 times; createObjectStackAdapter 17, SchemaRendererProvider 6, ElementDataSource 4.

Changeset: none owed, per the presence script's own arbitration (docs-only). Labelled skip-changeset.

Out of scope, deliberately


Generated by Claude Code

…ntom React API
The page taught `ObjectStackProvider` / `useObjectStack`, which the package
does not export — it is headless and imports React nowhere. A reader following
Quick Start wrote an import that does not resolve.
Rewrites Quick Start, API Reference, Usage Examples, Configuration, Advanced
Usage and Troubleshooting around the exports that exist:
`createObjectStackAdapter` / `ObjectStackAdapter`, injected at the renderer
boundary via `@object-ui/react`'s `SchemaRendererProvider`.
Also replaces a second fabrication the page-wide sweep turned up: the JSON
`dataSource` blocks used a `type: "objectstack"` discriminator with a
`query: { filters, sort, limit }` body. That shape has zero occurrences
repo-wide; the real per-element binding is the spec's `ElementDataSource`
(`object` / `view` / `filter` / `sort` / `limit`).
Snippets verified by extracting them and running tsc against the built
workspace packages: green, and red on the old phantom imports.
Fixes#4124
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Qqyix2QcnpUC9XeYVDzx3
@vercel

vercelBot commented Aug 10, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
ProjectDeploymentActionsUpdated (UTC)
objectuiIgnoredIgnoredAug 10, 2026 11:54am

Request Review

@yinlianghui
yinlianghui marked this pull request as ready for review August 10, 2026 12:07
@yinlianghui
yinlianghui added this pull request to the merge queueAug 10, 2026
Merged via the queue into main with commit 92c0b1fAug 10, 2026
18 checks passed
@yinlianghui
yinlianghui deleted the claude/issue-4124-data-objectstack-docs-api branch August 10, 2026 12:08
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

data-objectstack docs page documents an ObjectStackProvider / useObjectStack React API the package does not export (the package is headless)

2 participants

@yinlianghui@claude