Repository navigation
feat(native): Swift views take core's names in the Astryx module - #8299
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report
|
There was a problem hiding this comment.
Changes requested before approval. The rename and the single import Astryx hold up, and both Swift packages build and pass their tests on macOS and the iOS Simulator. Please add the AST-093 FR5 captures section to the description (the six views in light, dark and the largest text size, or a not-measured report with the reason) and update packages/native/specs/README.md, which still names component files Astryx<Name>.swift. The SwiftUI and AstryxNative re-export has no current spec yet and is recorded as a spec gap under AST-093 FR6, not as a blocker.
[Automated review]
|
|
||
| To add a component, create `Sources/Astryx/<Name>/Astryx<Name>.swift` with | ||
| core's prop names, read its tokens from `astryx`, and add tests under | ||
| To add a component, create `Sources/Astryx/<Name>/<Name>.swift` declaring |
There was a problem hiding this comment.
packages/native/specs/README.md:17 still draws each component file as Astryx<Name>.swift, and the Current state of packages/native/specs/swift/library/component-api.md still calls the views prefixed; updating both here keeps the native guides in agreement with this recipe.
There was a problem hiding this comment.
Changes requested before approval. The rename and the single import Astryx hold up, the earlier requests are addressed, and both Swift packages build and pass their tests on macOS and the iOS Simulator. Two small fixes remain:
- Add a line to the "Captures (AST-093 FR5)" section reporting the rendered accessibility tree as not measured, which AST-093's Current-state impact asks of every native change until an app-hosted iOS test target exists.
- The new Current state line in
packages/native/specs/swift/library/component-api.mdsays only Button keeps hand-written parameters, but all six views still do (and Banner has no generated contract yet).
[Automated review]
| (SwiftUI views with core's names, `Button`, `Text`, and so on, re-exporting | ||
| SwiftUI and the contracts) and the `AstryxNative` product (generated contract | ||
| types, unprefixed: `ButtonProps`, `ButtonVariant`). | ||
| - Button keeps hand-written parameters until it moves onto `ButtonProps`. |
There was a problem hiding this comment.
All six views keep hand-written parameters, not only Button: Text, Heading, Card and TextInput still take hand-written enums and shapes although their <Name>Props are generated, and Banner has no generated contract yet (AST-093's Current-state impact lists all six). Suggested wording: "The six views keep hand-written parameters until each moves onto its generated <Name>Props; Banner has no generated contract yet."
e953635 to
7f2363a
Compare
There was a problem hiding this comment.
This looks ready to approve: the six Swift views now take core's names, import Astryx brings SwiftUI and the generated contracts, and both Swift packages build and pass their tests on macOS and the iOS Simulator. The earlier requests are addressed, with the captures and the rendered accessibility tree reported as not measured and the component API's Current state naming all six hand-written views. The SwiftUI and AstryxNative re-export has no current spec yet, so it is recorded as a spec gap under AST-093 FR6 rather than a blocker. Approval can follow once the CI jobs still running on this head finish green.
[Automated review]
What changes for people
An iOS developer writes
import Astryx, thenButton(label: "Save", variant: .primary) { save() }orText("Hello"): Astryx's views have core's component names, and that one import brings SwiftUI and the generated contracts with it. In a file that also imports SwiftUI,Astryx.ButtonandSwiftUI.Buttonname each one.What this does
Applies the Swift component API spec's naming rule (
packages/native/specs/swift/library/component-api.md, A1, A1a, A1b):AstryxButton→Button,AstryxText→Text,AstryxHeading→Heading,AstryxCard→Card,AstryxTextInput→TextInput,AstryxBanner→Banner, each inSources/Astryx/<Name>/<Name>.swift.Astryxmodule re-exports SwiftUI andAstryxNative(Exports.swift), soimport Astryxis the only import an app file needs.SwiftUI.ButtonandSwiftUI.Textwherever it means the system view.Astryx; tests that also import SwiftUI writeAstryx.<Name>.packages/native/specs/README.mdand the component API Current state name the files<Name>.swiftand the views by core's names.NamesTests.swiftimports only Astryx and checks thatText,Button, andCardare Astryx's views,SwiftUI.TextandSwiftUI.Buttonare the system ones, and the generated contracts come with the import.The views keep their current parameters. Moving each view onto its generated
<Name>Props, typed token reads, andhrefdrawing aLinkfollow in separate pull requests, component by component.Captures (AST-093 FR5)
Not measured: the six views in light, dark, and the largest text size. Nothing draws differently here (names and imports only; the views' bodies are unchanged), and the author cannot draw SwiftUI where it works: Swift Package Manager's sandbox blocks
swift test, and anImageRendererprobe is stopped. The native screenshot lane that draws every state on the iOS Simulator is still open (#8027); once it is onmain, the captures come from it.Accessibility tree: not measured, for the same reason; the views' accessibility code is unchanged.
Testing
swiftc -typecheckof both modules, the tests (including the new names test), and the templates passes against the macOS 14 SDK; the Swift tests run in CI on the iOS Simulator.Every changed file is under
packages/native/.