Repository navigation
docs(public-component-api): interaction utilities have matching non-React equivalents; shipped APIs are grandfathered - #9973
Conversation
…object; the element ref is a named field
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
…match; one-config and grandfather rules stand alone
|
/approve-spec f8e97ac |
…match their hooks
|
/approve-spec 08136ec |
There was a problem hiding this comment.
Requesting changes. An engineering owner approved the INV22 narrowing, the new INV21a and the INV2 ref-naming rule at this exact head; the new INV21 example still needs a fix.
docs/architecture/public-component-api.mdlines 233–235 citehasSnap={useSnapPaging()}as a slot hook, but no package definesuseSnapPagingand Carousel shipshasSnapas aboolean, so the example contradicts INV3's rule that ahas…boolean has no third state; drop it, or land this after #9666 (which adds the hook and the INV3 deviation) and rebase.- The description calls that pairing "the shipped
hasSnap={useSnapPaging()}"; reword it as the pairing #9666 proposes, or remove it.
Any new commit needs a fresh /approve-spec naming the new head.
[Automated review]
| deprecation follows INV9. A hook whose value a component takes through one | ||
| slot prop is one API with that component, not a second one; for example, | ||
| `hasSnap={useSnapPaging()}` (owner decision, 2026-11-04). |
There was a problem hiding this comment.
useSnapPaging does not exist in any package yet, and Carousel's hasSnap is a boolean (hasSnap?: boolean = false in the core API report). As written, this example shows a has… prop with a third state. INV3 above forbids that, and the known-deviation list does not exempt hasSnap. Drop the example and keep the rule sentence, or land this after #9666 and rebase so the hook and its INV3 deviation are on main.
| ref a hook takes is named for the element's job, as `containerRef`, | ||
| `viewportRef`, `trackRef`, and `inputRef` are, or `ref` when the element has | ||
| no narrower job. |
There was a problem hiding this comment.
Non-blocking: viewportRef and trackRef are options of the internal usePager and appear in no API report. Public names such as scrollRef (useChatStreamScroll) or menuRef and triggerRef (useMenuPress) would ground the rule in shipped vocabulary.
PR Analysis Report🔎 Preview ·
|
… ref names in INV2
|
/approve-spec 3d192ae |
There was a problem hiding this comment.
Approved pending CI: the full CI run on this head, behind the required build, test and docsite-test checks, is still running.
The INV22 narrowing, the new INV21a, the INV21 slot-hook sentence and the INV2 ref-naming rule carry an engineering owner's approval at this head, and INV21's example is now a neutral illustration that names no unshipped API.
Two optional wording follow-ups:
- INV21 still counts only a hook that delegates entirely to its factory as one API with it, while INV22 now accepts a closely matching equivalent; one clause saying a hook and its INV22
create…equivalent are one API would close the gap. - "Slot prop" and "slot hook" reuse INV18's word for rendered content slots, where plain data passed to a prop "is not a slot"; another word or a pointer to INV18 would keep one meaning.
[Automated review]
| factories. A hook that delegates entirely to a public factory, with no | ||
| behavior of its own, and a component built entirely on a public factory are | ||
| one API with that factory, not a second one (`spec:AST-107` FR6, FR8). A |
There was a problem hiding this comment.
Non-blocking: this clause makes only a hook that delegates entirely to its factory one API with it, while the new INV22 accepts an equivalent that closely matches without delegation. For a hook whose signature cannot delegate, its new create… can read as a second API for one job, and INV21a rules out deprecating the hook. One clause such as "a hook and its INV22 create… equivalent are one API" would close the gap.
| behavior of its own, and a component built entirely on a public factory are | ||
| one API with that factory, not a second one (`spec:AST-107` FR6, FR8). A | ||
| deprecation follows INV9. A hook whose value a component takes through one | ||
| slot prop is one API with that component, not a second one, as in `const value |
There was a problem hiding this comment.
Non-blocking: "slot prop" (and "slot hook" in INV22) reuses INV18's word for rendered content slots, while INV18 says plain data passed to a prop "is not a slot". Another word, or a pointer to INV18, would keep one meaning.
People building with Astryx get non-React
create…equivalents of interaction utilities that closely match their hooks. Slot hooks that only feed a component prop have no equivalent by default. Shipped APIs stay as they are until a real need arises. Records only.Exact decision needed
None. The owner decided on 2026-11-04:
create…equivalent by default; the owner may add one.Existing authority searched
architecture:public-component-apiINV2 (naming), INV21 (one API per job) and INV22 (non-React paths), with their verification rows and the INV22 known-gaps list.containerRef,scrollRef,menuRef,triggerRef,inputRef, and others).Decision
create…) that closely match their hooks (the same option names and meanings, events and return concepts). A hook whose result only an Astryx component or StyleX can use (a slot hook, whose output feeds one Astryx component prop, oruseAnimatedLayout,useEntryAnimation,useContainerReveal,useTouchTrigger,useTableRowExpansion,useTableColumnResize) has none by default; the owner may add one."const value = useX(…); <Component x={value} />) that names no unshipped API.refwhen it has none. This is naming only, not a shape rule.create…equivalent (outside hooks whose result only an Astryx component or StyleX can use), or an equivalent whose options, events or return concepts differ.Rejected alternatives
create…functions.Claim scope and non-goals
INV22 governs only the existence and close match of non-React equivalents. Component props and API shapes stay with each component's own approval.
Changed records
docs/architecture/public-component-api.md: INV2, INV21, new INV21a, INV22 (rewritten), their verification rows, and the INV22 known-gaps line.Writing rubric results
Scope
Validation
pnpm check:knowledge: "Knowledge templates and records are aligned."git diff --check: clean