Skip to content

spec(native): a Swift view's two initializers are one API - #8532

Merged
cixzhang merged 1 commit into
mainfrom
spec/native-a3-one-api
Oct 26, 2026
Merged

cixzhang merged 1 commit into
mainfrom
spec/native-a3-one-api

Conversation

@cixzhang

@cixzhang cixzhang commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A Swift Astryx view has two initializers: a labeled one for app code, and one that takes the generated <Name>Props for generated and wire-driven callers. A view with a component slot also has convenience initializers that take that component's props (slots S3). A reviewer applying public-component-api INV21 ("one API per job") could read them as two APIs for one job. They are one API in two Swift spellings: the labeled initializer builds the same props the other takes. Component API A3 now says so.

What changes

  • One sentence in specs/swift/library/component-api.md A3: "The two initializers, and the convenience initializers that take a slot component's props (slots S3), are one API in several Swift spellings (architecture:public-component-api INV21): each builds the <Name>Props and slot values the props initializer takes."
  • No behavior or API change.

Existing authority searched

Search terms: INV18–INV21, one API per job, A3, two initializers. Records found: architecture:public-component-api INV21 (current) and Swift component API A3, which this clarifies. Overlapping open pull requests inspected: #8308, #8310, #8420, #8422; none edits A3.

Writing rubric results

  • R1 present tense: yes.
  • R2–R4: none.
  • R5 user impact first: the sentence says what an app writes and what it means.
  • R6 open questions: none.

Tests

  • pnpm check:knowledge.

@vercel

vercel Bot commented Oct 26, 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 26, 2026 1:41pm UTC

Request Review

@astracat-bot

astracat-bot Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Oct 26, 2026, 2:04 PM UTC

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 9a93550

@github-actions

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.

Recommending approval: the added A3 sentence is consistent with architecture:public-component-api INV21, matches what the Swift views on generated props already do, and has an exact-head spec approval from an engineering owner. Nothing else is required; under AST-093 FR6 an engineering owner can approve once the required checks pass. Two optional touch-ups: the description's R5 rubric line reports user impact instead of the rubric's R5 (no pull request or issue references, which the record passes), and slots.md S3's per-component convenience initializer is a third way in that the new sentence does not cover.

[Automated review]

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 26, 2026
@cixzhang
cixzhang merged commit 63581ab into main Oct 26, 2026
72 checks passed

This branch was successfully deployed

1 active deployment
Preview — 9a93550b Deployed Oct 26, 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