Skip to content

spec(AST-093): native component specs live in each component's folder - #8033

Merged
cixzhang merged 2 commits into
mainfrom
spec/ast-093-colocated-component-specs
Oct 24, 2026
Merged

cixzhang merged 2 commits into
mainfrom
spec/ast-093-colocated-component-specs

Conversation

@cixzhang

Copy link
Copy Markdown
Contributor

Exact decision needed

Where a native component's spec lives.

Existing authority searched

  • spec:AST-093 (current) FR1 puts every native component spec in one central folder, packages/native/specs/<language>/<Name>.md, away from the component.
  • Core keeps each component's spec in the component's own folder: packages/core/src/<Name>/<Name>.spec.md (118 such files on main). Native's Swift components already have one folder each, e.g. packages/native/swift-ios-1/core/Button/.

Decision

  • FR1 A native component's spec is <Name>.spec.md in that component's own folder, beside its implementation, as core does. For Swift that's packages/native/swift-ios-<n>/core/<Name>/<Name>.spec.md.
  • Rules shared across a language's components stay in packages/native/specs/<language>/, and packages/native/specs/TEMPLATE.md stays the template.
  • FR1's verification row, the spec-area README, the template header and the Swift README now say the same.

Rejected alternatives

  • A central specs/<language>/<Name>.md file per component: it separates the spec from the code it describes and doesn't match core.

Claim scope and non-goals

The template's sections, FR2–FR6 (including the review rule) and the native group are unchanged. No component specs exist yet, so nothing moves.

Evidence and implementation relationship

Record, README, template header, and Swift README only.

Writing rubric results

  • R1 narration: none.
  • R2 research in the record: none.
  • R3 evidence naming a change: none.
  • R4 rejected alternatives: one, in this PR body; the record stays present tense.
  • R5 pull request or issue references remaining: none in the record.
  • R6 ruled open questions still listing options: none.

Scope

  • Specification record amendment plus the spec-area files that restate it; no implementation.
  • It records observable behavior and preserves equivalent internal implementations.
  • Verification states the evidence and failure signal without prescribing CI topology.
  • One durable decision.
  • Canonical owner (AST-093), affected claims, and overlapping open work are named.
  • Public text contains no internal context.

Validation

Prettier-formatted with the repository config; spec validation runs in CI.

@vercel

vercel Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
astryx Ready Ready Preview Oct 24, 2026 8:31am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 24, 2026
@astracat-bot

astracat-bot Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Oct 24, 2026, 8:51 AM UTC

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 5cd639b

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

Previews ready: Storybook and Sandbox were built with this PR's docsite. CI evidence will be added when available.

View Storybook for this PR · View Sandbox for this PR

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes: moving native component specs beside their implementation is approved direction, but FR1 and the spec-area docs need these fixes before this lands.

  • FR1 keeps one spec per language but places it inside a versioned swift-ios-<n> package, so please say which component folder holds the spec when two generations, or a macOS package, implement the same component.
  • FR1, both READMEs and the template point at a swift-ios-1 package (swift-ios-<n> in FR1) that is not on main yet; land this after #7981 or record the dependency in Current-state impact.
  • The README's example of core keeping Button.spec.md next to Button.tsx names a file that does not exist; TabList.spec.md next to TabList.tsx would work.

[Automated review]

native component has its own folder in its language's implementation, named
as the core component, and its spec is `<Name>.spec.md` in that folder, as
core does (`packages/core/src/<Name>/<Name>.spec.md`). For Swift that is
`packages/native/swift-ios-<n>/core/<Name>/<Name>.spec.md`, beside the

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FR1 still says one spec covers every implementation in the language (line 63), but this path sits inside one versioned swift-ios-<n> package. When swift-ios-2, or a macOS package, also implements the component, which folder holds the spec? Naming it here, for example the lowest-numbered live generation, keeps the FR1 verification row decidable.

├── specs/
│ ├── TEMPLATE.md # copy this for a new component spec
│ └── swift/ # rules shared by every Swift component
└── swift-ios-1/core/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

swift-ios-1/ is not on main yet; open #7981 adds it. Until that lands, this tree and step 1 describe a folder contributors would have to create by hand. Consider landing after #7981, or noting the dependency.

Comment thread packages/native/specs/README.md Outdated

One short spec per native component, per language. The rules live in
One short spec per native component, per language, kept in the component's own
folder beside its implementation, the way core keeps `Button.spec.md` next to

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

packages/core/src/Button/ has no Button.spec.md. A component with a record, such as TabList.spec.md next to TabList.tsx, would make the example accurate.

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Oct 24, 2026

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This spec amendment now waits on an owner decision: the three fixes requested on the previous commit are in, and no other defect remains. It changes the current spec:AST-093 FR1, and the earlier /approve-spec named the previous commit, so an engineering owner records the decision by commenting /approve-spec 0e89a262e695dc7c64017140a2d4e19bb9130962 on this pull request; the author may do so if they are an engineering owner. Before approving, consider settling which folder holds a component's spec when a swift-ios-<n> package and a macOS-only package share the lowest number, and what makes a package live, since FR1 names that case without resolving it.

[Automated review]

Comment on lines +65 to +68
serves `ios` and `macos`). When more than one package in a language implements
a component, such as a later `swift-ios-<n>` generation or a macOS-only
package, the spec lives in that component's folder in the lowest-numbered
live package of the language. Rules that apply across a language's components

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Lowest-numbered live package" picks one folder across swift-ios-<n> generations, but not when a swift-ios-<n> package and the macOS-only package this sentence names share the lowest number, and "live" is not defined. Which folder holds the spec in that case, and does "live" mean present on main? Settling it keeps the FR1 verification row decidable.

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 0e89a26

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Oct 24, 2026
@cixzhang
cixzhang force-pushed the spec/ast-093-colocated-component-specs branch from 0e89a26 to 9027df1 Compare October 24, 2026 05:10
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 9027df1

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommending approval: an engineering owner approved the spec:AST-093 FR1 amendment for this exact head, and the record, the spec-area README, the template header and the Swift README agree on where a native component's spec lives. The fixes requested on the first commit are all in. When swift-ios-1 lands, note that FR1 gives every native component its own folder, so Heading needs a core/Heading/ folder before it can have a spec, and the AstryxCore target may need to exclude the colocated .spec.md files.

[Automated review]

FR1 places a native component's spec beside its implementation, in a folder
per component named as core's, as <Name>.spec.md, matching core's
packages/core/src/<Name>/<Name>.spec.md. When several packages in a language
implement a component, the spec lives in the lowest-numbered live package.
Language-wide rules stay under packages/native/specs/<language>/.
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 18f2493

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes for one line: the spec:AST-093 FR1 amendment is owner-approved for this revision, and the record, the spec-area README, the template header and the Swift README agree on where a native component's spec lives. packages/native/specs/swift/library/README.md, which reached main after the previous revision, still says a component spec is ../<Name>.md (that is, packages/native/specs/swift/<Name>.md), the folder the amended FR1 and its verification row now fail; please point that sentence at <Name>.spec.md in the component's folder. Because the fix is a new commit, it will need a fresh /approve-spec from an engineering owner.

[Automated review]

├── specs/
│ ├── TEMPLATE.md # copy this for a new component spec
│ └── swift/ # rules shared by every Swift component
│ └── library/ # rules every Swift component or build step shares

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

library/README.md (not changed here) still says "A component spec (../<Name>.md, from ../../TEMPLATE.md)", that is packages/native/specs/swift/<Name>.md, which the amended FR1 and its verification row now fail. Pointing that sentence at <Name>.spec.md in the component's folder keeps the spec-area files in step.

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec a37b775

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommending approval: an engineering owner approved the spec:AST-093 FR1 amendment for this exact head, and the record, the spec-area README, the template header and both Swift READMEs now agree that a native component's spec is <Name>.spec.md in the component's own folder. The Swift library README line flagged on the previous commit is fixed. When swift-ios-1 lands, Heading needs a core/Heading/ folder of its own before it can have a spec, and colocated .spec.md files will sit among the AstryxCore target's sources.

[Automated review]

@cixzhang
cixzhang merged commit 5df9b6a into main Oct 24, 2026
69 checks passed
@github-actions
github-actions Bot deleted the spec/ast-093-colocated-component-specs branch October 25, 2026 06:20

This branch was successfully deployed

1 active deployment
Preview — a37b7757 Deployed Oct 24, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant