Uh oh!
There was an error while loading. Please reload this page.
docs(data-objectstack): document the real headless surface, not a phantom React API - #4129
Merged
Merged
Conversation
…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_017Qqyix2QcnpUC9XeYVDzx3The latest updates on your projects. Learn more about Vercel for GitHub. |
yinlianghui
marked this pull request as ready for review
August 10, 2026 12:07
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes#4124
Docs-only. Rewrites
content/docs/utilities/data-objectstack.mdxaround the surface the package actually exports.Ordering
PR #4127 (#3781) edits the same page and has merged —
1b6188d41, the tip oforigin/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.packages/data-objectstack/src/index.tsisObjectStackAdapter,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:
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/ObjectStackAdapterinjected via@object-ui/react'sSchemaRendererProvider, which is what the README,content/docs/guide/data-source.mdand seven plugin READMEs already teach.The
REACT_APP_OBJECTSTACK_*environment variables went with it: the package reads no environment variable of its own (grepforprocess.envin itssrc/finds only a JSDoc example).2. The JSON
dataSourceshape — found by the page-wide sweep the card asked for. Every JSON block used atype: "objectstack"discriminator with aquery: { filters, sort, limit }body. That shape has zero occurrences repo-wide (grepover all.ts/.tsx/.json). The real per-element binding is the spec'sElementDataSource, validated byElementDataSourceSchemain@objectstack/spec:"type": "objectstack"objectobject(required)query.filters: [{field, operator, value}]filter: FilterCondition(object form, e.g.{ "total": { "$gt": 100 } })query.sort: [{field, direction}]sort: [{ field, order }]query.limitlimitviewThe spec schema is
z.strict, so the oldtypekey 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);kanbanas written had no registration at all.Corrected symbols
ObjectStackProvideruseObjectStackObjectStackDataSource(interface)ElementDataSourceapiUrl/apiKey/organizationIdpropsbaseUrl/tokenREACT_APP_OBJECTSTACK_*client.query/client.aggregatefind/findOne/create/update/deletecreateObjectStackAdapterfetch,cache, reconnect optionsObjectStackAdapterSchemaRendererProviderThree 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:
create()returnsunknownunless the adapter is parameterised, souser.iddid not compile. The docs now show the generic form.bulkandbatchTransactionare optional members ofDataSource(bulk?(...),batchTransaction?(...)), so through aDataSource-typed value they need feature-detection. The page now says so and shows the class type for those calls.getConnectionState/onConnectionStateChangeare not onDataSourceat all — they areObjectStackAdapterclass members. The method list is now split into "on theDataSourceinterface" 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.mjsis an unwired one-off migration tool, not a gate), so per the card I extracted the snippets and rantscagainst the built workspace packages.tsc(extracted, strict, against builtdist/*.d.ts)tscon the OLD phantom imports (reverse)pnpm turbo run build --filter=@object-ui/site --force29 successful, 29 total,0 cached, 2m13snode 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 '...^...') sotscread real declarations rather than stale ones.A note on the docs build: an unforced re-run reported
29 cached / FULL TURBOin 80ms after I had edited the mdx — turbo's input hash for@object-ui/sitedoes not appear to trackcontent/docs/**. The green above is therefore from a--forcerun. 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,organizationIdand"type": "objectstack"all render 0 times;createObjectStackAdapter17,SchemaRendererProvider6,ElementDataSource4.Changeset: none owed, per the presence script's own arbitration (docs-only). Labelled
skip-changeset.Out of scope, deliberately
**Version:** 0.3.1at:~380is stale (the package is at17.4.0) but is already filed as Two utilities docs pages hardcode "Version: 0.3.1" in their Package Information block while both packages are at 17.4.0 #4125 — left alone so this PR does not collide with that card.packages/data-objectstack/README.md:16still saysnpm install @object-ui/data-objectstack @objectstack/client, the same claim docs(data-objectstack): describe the real dependency contract, not a peer one #4127 corrected on this docs page. Filed separately rather than fixed here.Generated by Claude Code