Repository navigation
Refactor VitePress homepage with professional SDUI positioning - #98
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
|
✅ All checks passed!
|
There was a problem hiding this comment.
Pull request overview
This pull request refactors the VitePress homepage to better position ObjectUI as a professional Server-Driven UI (SDUI) engine for modern frontend developers. The new content emphasizes the product's unique positioning as the "JSON-to-Shadcn Bridge" that combines low-code speed with high-quality design using React + Tailwind + Shadcn.
Changes:
- Rewrote hero section with stronger value proposition: "Stop Hand-Coding Enterprise UIs"
- Restructured feature cards into 3 pillars: The Stack You Love, Server-Driven Agility, and Enterprise Ready-Made
- Added comprehensive "Magic Trick" section demonstrating JSON → UI transformation with concrete data-table example
- Expanded architecture explanation with clear 3-layer model (Protocol, Engine, Renderer)
- Added extensibility section addressing lock-in concerns with custom component registration examples
- Enhanced ObjectStack ecosystem positioning while maintaining backend-agnostic stance
| import { registerRenderer } from '@object-ui/core'; | ||
| import { MyCustomWidget } from './components/MyCustomWidget'; | ||
|
|
||
| // Register your custom component | ||
| registerRenderer('custom-widget', MyCustomWidget); |
There was a problem hiding this comment.
The function registerRenderer does not exist in the @object-ui/core package. Based on the actual codebase, the correct API is either:
ComponentRegistry.register()(imported from@object-ui/core)getComponentRegistry().register()(imported from@object-ui/react)
This inconsistency could confuse developers trying to use the documented API. Update to use the actual API that exists in the codebase.
| import { registerRenderer } from '@object-ui/core'; | |
| import { MyCustomWidget } from './components/MyCustomWidget'; | |
| // Register your custom component | |
| registerRenderer('custom-widget', MyCustomWidget); | |
| import { ComponentRegistry } from '@object-ui/core'; | |
| import { MyCustomWidget } from './components/MyCustomWidget'; | |
| // Register your custom component | |
| ComponentRegistry.register('custom-widget', MyCustomWidget); |
| import { registerRenderer } from '@object-ui/core'; | ||
| import { MyCustomButton } from './components/MyCustomButton'; | ||
|
|
||
| // Override the built-in button | ||
| registerRenderer('button', MyCustomButton); |
There was a problem hiding this comment.
The function registerRenderer does not exist in the @object-ui/core package. Based on the actual codebase, the correct API is either:
ComponentRegistry.register()(imported from@object-ui/core)getComponentRegistry().register()(imported from@object-ui/react)
This inconsistency could confuse developers trying to use the documented API. Update to use the actual API that exists in the codebase.
| import { registerRenderer } from '@object-ui/core'; | |
| import { MyCustomButton } from './components/MyCustomButton'; | |
| // Override the built-in button | |
| registerRenderer('button', MyCustomButton); | |
| import { ComponentRegistry } from '@object-ui/core'; | |
| import { MyCustomButton } from './components/MyCustomButton'; | |
| // Override the built-in button | |
| ComponentRegistry.register('button', MyCustomButton); |
| "actions": [ | ||
| { | ||
| "label": "Edit", | ||
| "type": "button", | ||
| "variant": "outline", | ||
| "onClick": { | ||
| "action": "navigate", | ||
| "target": "/users/${row.id}/edit" | ||
| } | ||
| } | ||
| ] |
There was a problem hiding this comment.
The JSON schema example shows an actions array with an onClick handler structure that doesn't match the actual DataTableSchema type definition. According to the types in packages/types/src/data-display.ts, the DataTableSchema interface doesn't have an actions property. Instead, it uses onRowEdit and onRowDelete callback handlers.
The example also shows onClick with an object containing action and target properties, but the actual EventHandler interface (from api-types.ts) uses type and navigate properties for navigation actions.
Update the example to match the actual schema implementation, or if this represents future functionality, add a note indicating this is a planned feature.
| "actions": [ | |
| { | |
| "label": "Edit", | |
| "type": "button", | |
| "variant": "outline", | |
| "onClick": { | |
| "action": "navigate", | |
| "target": "/users/${row.id}/edit" | |
| } | |
| } | |
| ] | |
| "onRowEdit": { | |
| "type": "navigate", | |
| "navigate": "/users/${row.id}/edit" | |
| } |
| - **Manages** component state and data flow | ||
| - **Registers** custom components | ||
|
|
||
| **Zero React dependencies.** The core is pure TypeScript logic—fully testable, fully portable. | ||
|
|
There was a problem hiding this comment.
The documentation states that @object-ui/core has "Zero React dependencies" and is "pure TypeScript logic." However, it also claims that custom components can be registered using registerRenderer from @object-ui/core.
Based on the codebase examination, the actual API is ComponentRegistry.register() from @object-ui/core, and the component registry accepts React components. This creates a conceptual inconsistency - if core is truly React-free, it shouldn't be importing or registering React components directly.
Consider clarifying that while the core logic (validation, expressions) is React-free, the component registry is part of the bridge layer that connects to React components.
| - **Manages** component state and data flow | |
| - **Registers** custom components | |
| **Zero React dependencies.** The core is pure TypeScript logic—fully testable, fully portable. | |
| - **Manages** component state, expressions, and data flow | |
| The engine is implemented as **pure TypeScript logic** and can run fully outside of React (Node.js, edge runtimes, tests) for validation, expression evaluation, and action handling. | |
| > Note: React-specific concerns—like wiring `"type"` strings to concrete React components and registering custom renderers—live in the runtime/bridge layer, not in the core logic. This keeps `@object-ui/core` React-free while still allowing you to plug in your own React components where you render the schema. |
…ent, point at objectui#8598 Implements decision batch #98 on objectui#8344 (comment 5587037055), Finding 3 of the contract review of `ca2037680` (PR #8501 comment 5587000173). The byte pair `base.zod.ts` quoted (369,733 / 1,144,999) and the pair the changeset quoted (370,652 / 1,149,749) were the same measurement taken on two heads. Both texts now cite ONE measurement, taken on this head with a named instrument: a Vite 8.2.1 lib build of the published `dist/zod` face, `es`, esbuild-minified, `zod` 4.4.3 and `@objectstack/spec` external, each entry built alone and read in a fresh Node process — barrel, CardSchema + AnyComponentSchema 750,542 / 206,815 REFUSED fill present barrel, CardSchema only 212,567 / 61,025 ACCEPTED fill absent deep-link entry at layout.zod.js 212,563 / 61,030 ACCEPTED fill absent Minified so that editing this very docblock cannot move the figure it carries. The stale "its disposition is a ruling in flight" sentence is gone: the ruling is in. The gap ships DECLARED, the declaration names who is exposed (an external consumer whose bundler honours `sideEffects: false` and never reads `AnyComponentSchema` keeps the pre-redirect accept set for NESTED nodes; root-level enforcement and every union-reading graph get the new set), and the changeset's leak paragraph points at objectui#8598 — the `./zod` face built as one module — as the card that closes it. No source outside comments moved. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TezFG8ZMrNH6n5VTNpPpdH
…objectstack-ai#8344) (objectstack-ai#8501) * feat(types)!: redirect the node recursion point at AnyComponentSchema (objectstack-ai#8344) Every child slot is `z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)])`, and `SchemaNodeSchema`'s component arm was `BaseSchemaCore` — the ~21 base keys and nothing type-specific — so per-type enforcement was ROOT-ONLY at every depth, for every component type. That is objectui#7869, measured there: an off-spec `size` on a nested `icon` node was accepted while the same node alone was refused. The arm is now `AnyComponentSchema`. ⛔ Nothing here is `.strict()`; no declaration is repaired. Measured over the catalog + docs corpora on c90395b (554 node documents): 45 refused before, 54 after — the nine documents the card enumerates, each pre-existing debt this surfaces rather than creates. Two mechanical constraints, both measured rather than assumed: - `AnyComponentSchema` is built in `index.zod.ts` from all 13 category modules while 14 modules import `base.zod.ts`, so the arm cannot be an import: `z.lazy` defers evaluation, not the module graph, and the import deadlocks on `BaseSchema`'s TDZ when the graph is entered at `base.zod.js`. - It is a written `z.union` OPTION SLOT and not a `z.lazy` holder, because `z.lazy` memoises: a holder lets whichever module graph parses first decide the accept set for the whole process. `z.union` re-reads its options every parse, so the fill is live and no first parse can freeze the pre-fill answer in. `complex.zod.ts#DashboardWidgetSchema.component` names `BaseSchema` explicitly now. It is the one slot where the redirect would reverse a standing ruling: `metric-card` is objectui's CLOSED widget-slot component extension (objectstack#8593), admitted there and deliberately not an arm of `AnyComponentSchema`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CZY49skxUBYyJcdnTcYPrE * fix(types): record the DashboardWidgetSchema.component drift the objectstack-ai#8344 carve-out creates The parity ledger is a TYPE MAP over the mirrors, so the `complex.zod.ts` change in ae99480 moved a drift row INSIDE zod-mirror-parity.test.ts without editing it: `DashboardWidgetSchema.component` names `BaseSchema` where TS declares `SchemaNode`, so the five primitive arms are newly narrower-than-declared. Re-derived from the tree with the compiler API, not copied: `DriftOf` for the pair resolves to 'component' | 'options'. The header figure moves with it, 64 -> 65 keys across an unchanged 42 entries, derived by an AST count of the interface. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CZY49skxUBYyJcdnTcYPrE * docs(types): declare the chatbot widening, the bundle caveat and the memoisation Three accept/reject facts and one caveat the changeset owed a reader: - `DashboardWidgetSchema.component` narrows (a primitive in that slot was accepted and is refused now); - `SchemaNodeSchema` moves TDZ_BOUND -> MEMOISED; - `ChatbotSchema.body` is a record and therefore WIDER than the base arm, so a nested chatbot node carrying one is refused before and accepted now. Measured with a corpus-valid seed at two child slots, against both the narrowing and a legal-node control; - the `sideEffects: false` bundle caveat: a bundler that drops the barrel body leaves the redirect inert, measured on this repo's own Vite/rollup lib build. The pin's header claimed `getter() === getter()` is FALSE for the exported wrapper. Measured on the built face, that holds on `main` and NOT at this head: the redirect made this const MEMOISED, and the `fill is LIVE` leg works because of it. The header now states both readings and why the wrapper is still the handle the pin uses. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CZY49skxUBYyJcdnTcYPrE * docs(changeset): point the chatbot widening at its follow-up, and state the bundle caveat as measured The widening declaration now names objectui#8572, the card filed for the narrowing decision, so the declaration reads as "declared, follow-up filed" rather than as an accepted permanent state. The bundle caveat is restated from what was actually measured this round. Three candidate fixes were tried on disk and none of them is a manifest edit this change may make on its own: - narrowing `sideEffects` to an array is not a legal declaration for this package. `scripts/check-side-effects-array.mjs` requires an array to name every ENTRY FORM (12 missing on a one-element array); `scripts/__tests__/side-effects-declaration-consistency.test.ts` refuses a named entry that has no load-time effect. This package's entry forms are pure, so the two rules have no common solution here. Both readings taken from the gates themselves. - a bare top-level call in the barrel is dropped too: `"sideEffects": false` is a package-level promise that no in-module spelling overrides. Measured with the statement on disk and in `dist`: the probe entry still ACCEPTED the nested off-spec node. - removing the field closes the leak at +16,078 gzipped bytes on the console `framework` chunk — which now FITS, since the ceiling raise landed — but it drops the workspace census from 5 packages to 4 and fails that same pin's population floor. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CZY49skxUBYyJcdnTcYPrE * docs(changeset): name the two follow-up cards the bundle caveat leaves open The caveat now points at objectui#8577 (the leak and the manifest decision, carrying every measured figure and the maintainer-floor census edit the closing route needs) and objectui#8578 (the classifier that scores this package zero load-time registrations because it counts top-level call statements and cannot see an effect inside a `const` initializer). Changeset text only. No source, no manifest, no test moved. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CZY49skxUBYyJcdnTcYPrE * feat(types)!: bind the component union in the getter, and narrow the chatbot arm Implements decision batch objectstack-ai#93 (objectui#8344 comment 5585333656), items F2, F3, F5 and the stale-text half of items 8/9. Changeset text is NOT yet updated in this commit; its three false "by ruling" attributions are the next push. F3 — the tree-shake leak. `base.zod.ts` now imports `AnyComponentSchema` and reads that binding INSIDE `SchemaNodeSchema`'s `z.lazy` getter. The option-array write, `defineNodeComponentUnion` and its identity assertion are gone with it. `"sideEffects": false` stays true and untouched: this module performs no load-time write at all now. Measured, not assumed — this repo's own Vite/rollup lib build, an entry importing ONLY `CardSchema`: before this commit 370,652 raw / 113,887 gzip, no fill, nested off-spec node ACCEPTED — the redirect silently inert after 1,147,266 raw / 342,193 gzip, nested off-spec node REFUSED — the union is retained because the binding is read A graph that never evaluates the barrel now throws `ReferenceError: Cannot access 'BaseSchema' before initialization` at import instead of quietly answering as `main`. That is the ruled behaviour, and its cost is paid here: 102 `packages/types` test files entered at a category module and now carry a barrel-first import. Whole unit project after the fix: 989 files, 16,837 tests, 0 failures. F2 — the chatbot widening, eliminated rather than declared. The arm the getter installs is `AnyComponentSchema.superRefine(...)`, which checks a nested `chatbot` node's `body` against `BaseSchemaCore.shape.body`. The root mirror is untouched, so a root `chatbot` with a record `body` still parses and the same node one slot down does not. Both directions pinned, plus a non-vacuity leg and a leg asserting the refusal names `body`. The discrimination objectui#8498 added survives the wrapper (`propValues` intact), so a nested refusal still costs one arm. F5 — depth on the redirected path: 276 / 3,626 / 8,404 / 14,610 / 22,244 chars at depths 0-4, all refused, none throwing. New pins cover depths 0-4 through `safeValidateSchema`, a linear-growth ceiling at depth 4, and a legal-leaf control. Items 8/9 — `any-component-union-fanout.test.ts`'s rationale said a nested document is "simply ACCEPTED"; corrected in place. The pin's identity-leg comment and header now describe THIS head. The objectui#7918 row returns to `TDZ_BOUND`: the getter builds the node union per call again, so `getter() === getter()` is FALSE, and `unstableLazyExports` reads 8 again. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CZY49skxUBYyJcdnTcYPrE * docs(changeset): state what ships, and drop three attributions that were never ruled Batch objectstack-ai#93 refused the routes the previous revision described, so the changeset described a PR that does not exist. Corrected, not softened: - the widening fact said "Declared here rather than eliminated, by ruling". No ruling said that; objectstack-ai#93 ordered it eliminated. It now records the nested refusal and the untouched root, and points the root question at objectui#8572. - the `TDZ_BOUND -> MEMOISED` fact is gone: that byproduct belonged to the option-array spelling and the row is `TDZ_BOUND` again. - the bundle caveat said the fix was "a maintainer-floor authorisation, deliberately not taken here" and "Until objectui#8577 is ruled". Both false against objectstack-ai#93: the ruled route needs no manifest change and no census-floor edit, and it ships in this PR. The section now states the wiring, the measured before/after, and both byte costs. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CZY49skxUBYyJcdnTcYPrE * fix(types): revert the F3 import binding — CI proved it breaks a real consumer ⛔ The `Build Docs` failure on 2ac5381 is THIS BRANCH'S CODE, not the changeset text: `ReferenceError: Cannot access 'BaseSchema' before initialization` out of `packages/types/dist/zod/app.zod.js`, prerendering `/docs/guide/schema-catalog` through `plugin-view`. Reproduced locally in one line — with the binding in place, importing `dist/zod/app.zod.js` throws; without it, it loads clean. Mechanism, measured rather than reasoned: making `base.zod.ts` import the barrel gives the cycle an edge that is only safe when the barrel is evaluated FIRST. Node honours that if the entry is `./zod`; a bundler is free to order the cycle category-module-first, and the site's build does. ⇒ the ruled F3 spelling is sound for a module graph and unsound for a bundle, which is the opposite of the property it was chosen for. My own docblock claim that "consumers cannot hit that" was falsified by CI, and the 102-file barrel-first hygiene could not have helped: the failing consumer already imports the barrel. This commit therefore restores the wiring CI was last green on (`d375037a8`) and KEEPS batch objectstack-ai#93's F2 in the spelling the reviewer originally wrote it in: the slot-0 write installs `union.superRefine(...)`, so a nested `chatbot` node with a record `body` is refused while the published root mirror is untouched. The identity assertion now checks the WRAPPER it installed, and the pin says why a `toBe(AnyComponentSchema)` assertion would go green if the narrowing were dropped. The 102 barrel-first imports are reverted with the binding that needed them; the objectui#7918 row is `MEMOISED` again, matching this wiring. ⇒ F2 and F5 ship; F3 does NOT, and the changeset now states the gap, the CI evidence and all four measured candidates instead of claiming a fix. Green on this tree: build 0, type-check 0 (all three projects), packages/types 148 files / 2,824 tests / 0 failed, the four changeset gates 0, and the category-first import that CI choked on now loads clean. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CZY49skxUBYyJcdnTcYPrE * docs(types): declare the tree-shake gap as shipped, cite one measurement, point at objectui#8598 Implements decision batch objectstack-ai#98 on objectui#8344 (comment 5587037055), Finding 3 of the contract review of `ca2037680` (PR objectstack-ai#8501 comment 5587000173). The byte pair `base.zod.ts` quoted (369,733 / 1,144,999) and the pair the changeset quoted (370,652 / 1,149,749) were the same measurement taken on two heads. Both texts now cite ONE measurement, taken on this head with a named instrument: a Vite 8.2.1 lib build of the published `dist/zod` face, `es`, esbuild-minified, `zod` 4.4.3 and `@objectstack/spec` external, each entry built alone and read in a fresh Node process — barrel, CardSchema + AnyComponentSchema 750,542 / 206,815 REFUSED fill present barrel, CardSchema only 212,567 / 61,025 ACCEPTED fill absent deep-link entry at layout.zod.js 212,563 / 61,030 ACCEPTED fill absent Minified so that editing this very docblock cannot move the figure it carries. The stale "its disposition is a ruling in flight" sentence is gone: the ruling is in. The gap ships DECLARED, the declaration names who is exposed (an external consumer whose bundler honours `sideEffects: false` and never reads `AnyComponentSchema` keeps the pre-redirect accept set for NESTED nodes; root-level enforcement and every union-reading graph get the new set), and the changeset's leak paragraph points at objectui#8598 — the `./zod` face built as one module — as the card that closes it. No source outside comments moved. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TezFG8ZMrNH6n5VTNpPpdH --------- Co-authored-by: Claude <noreply@anthropic.com>
Homepage content didn't effectively position ObjectUI for modern frontend developers or differentiate from low-code tools. Needed to communicate Server-Driven UI value while emphasizing professional-grade flexibility with React + Tailwind + Shadcn.
Changes
Hero Section
/protocol/overviewand/components/Feature Cards (3 Pillars)
Magic Trick Section
Shows JSON schema → rendered UI transformation with concrete data-table example:
{ "type": "data-table", "dataSource": { "api": "/api/users" }, "columns": [ { "key": "name", "sortable": true }, { "key": "status", "render": "badge" } ], "actions": [ { "label": "Edit", "onClick": { "action": "navigate" } } ] }Output description lists: server-side fetching, sorting, actions, responsive, a11y, themes.
Architecture (3-Layer Flow)
Extensibility
registerRenderer('custom-widget', MyWidget)registerRenderer('button', MyCustomButton)ObjectStack Ecosystem
Screenshot
Files:
docs/index.md(+284, -35)Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.