Uh oh!
There was an error while loading. Please reload this page.
refactor(types): derive ListViewSchema.userActions from the spec (single-source pilot) - #2119
Merged
Merged
Conversation
…gle-source pilot) `userActions` was a hand-maintained mirror of the spec's UserActionsConfig — exactly the "never redefine types, always import them" rule this file states, violated. A hand mirror is a drift hazard: the type and the spec can silently diverge (the prior `editInline` round was this — three hand-touched layers). Derive it instead: `userActions?: Partial<UserActionsConfig>`, where UserActionsConfig comes from @objectstack/spec/ui. `Partial<>` because authoring is opt-in (write only the toggles you set; the rest fall back to spec defaults) — shape-identical to the old hand-written type, so no consumer changes (types + app-shell type-check clean). `editInline` is carried as a transitional `&`-extension only because the pinned @objectstack/spec release predates it (it's in the source via framework#2468, not yet released to npm). Once the spec dep is bumped, Partial<UserActionsConfig> supplies editInline itself and the extension becomes redundant — this is the release-lag #1 (spec single-source) has to design around, made explicit here. A small pilot for that direction: shows objectui types can derive from the spec rather than mirror it, and how to handle the not-yet-released tail. No behavior change; no changeset (shape-identical type-only refactor). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
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.
What
ListViewSchema.userActionswas a hand-maintained mirror of the spec'sUserActionsConfig. Replace it with a derivation:Why
This file literally states the rule "Never Redefine Types. ALWAYS import them." — and
userActionswas violating it. A hand mirror is a drift hazard: the type and the spec can silently diverge. The recenteditInlinework was exactly that pain — the same field touched by hand in three layers.This is a small pilot for the "spec single-source derivation" direction: prove objectui types can be derived from the spec rather than copied, and work out how to handle the realistic wrinkles.
Details
Partial<UserActionsConfig>because authoring is opt-in — you write only the toggles you set, the rest fall back to the spec's defaults. This is shape-identical to the old hand-written type, so there are no consumer changes (types + app-shell type-check clean).editInlineis carried as a transitional&-extension only because the pinned@objectstack/specrelease predates it (it's in the source via framework#2468, not yet released to npm). Once the spec dep is bumped,Partial<UserActionsConfig>supplieseditInlineitself and the extension is redundant. This is the release-lag that Implement visual designer for Object UI schemas #1 has to design around — made explicit here rather than hidden.ListViewGalleryConfig = GalleryConfig & { …legacy… }).Verification
@object-ui/types+@object-ui/app-shelltsc --noEmitclean; ESLint clean. No behavior change; no changeset (shape-identical, type-only).🤖 Generated with Claude Code