-
Notifications
You must be signed in to change notification settings - Fork 186
Ignite v0.6.5: Introduce Variadic Generics for Expressive Typing #844
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I would like to try it, but I currently have very little free time in my spare time. I’ll try it as soon as I have time, but unfortunately I can’t promise anything - sorry. |
No pressure. Keeping you in the loop to make sure we address your concerns! |
|
@JPToroDev Errors shown: I admit that I probably don't have enough know-how to derive the solution from the above explanations. For me it would be helpful if, like the example with Grid, which I find very helpful, an example of the changes in Table were listed. My code works with Ignite 0.6.0 without any problems. |
@ralfboernemeier Most likely due to the use of a regular Table {
ForEach(dataWurmkur) { datum, medikament in
Row {
datum
medikament
}
}
} |
|
@MrSkwiggs with the suggested code I got the following error message in Xcode: |
|
@MrSkwiggs I think I have found the solution, your suggestion was very helpful - thank you! With the following code there is no more error message and the table is displayed correctly at first glance: |
|
@JPToroDev After I was able to solve the Table() problem, it was with the help of the explanations here in the ticket, in my case in particular the changes to Grid, very easy to change my website in the branch and compile it successfully. I find the idea with the examples - before and after - very helpful and intuitive! |
|
@JPToroDev May I ask a question about what I consider to be a breaking change? I have the following code: With 0.6.0, the 4 images are displayed in a row on my mobile device, i.e. next to each other. With the branch, the images on my mobile device are displayed one below the other, i.e. 4 rows below each other. It does not matter whether I reduce the size of the images to ‘20’, for example. On a PC, the icons in both versions are displayed next to each other in one row, as desired. |
|
Adding |
|
Thank you for giving this branch a whirl and for offering all the great feedback! |
|
@JPToroDev Thank you very much - that answered my question and solved the problem! |
|
@twostraws Hope you've been doing well through the iOS and macOS 26 release cycle—I know how hectic they are. When you’re over the finish line with it, would you mind taking a look at this PR? I kept all the commits nice and atomic to make the review easier. |
This PR completes the expressive typing work begun in 0.6.0 by introducing variadic generics (SwiftUI's approach) to the framework.
While this primarily affects internal types, several surface API changes were unavoidable:
Unavoidable API Changes
Grid API Redesign
The biggest change is to the
GridAPI, whose previous implementation had become unmaintainable.The new API is modeled after SwiftUI, uses CSS Grid instead of Bootstrap, and leverages deprecation messages for non-breaking changes.
Before:
After:
However,
Gridwithout modifiers now behaves differently:Like SwiftUI, each
Textnow takes up its own full row.For a complete overview of the new
GridAPI, visit: https://github.com/JPToroDev/IgniteSamples/blob/current/Sources/Pages/Concepts/GridExamples.swifttagLinks()Return Type ChangeSince
Linkis now generic,Article/tagLinks()returnssome HTMLinstead of[Link]:Before:
After:
To simplify manual
Linkconstruction,Article/linksnow returns[TagMetadata]instead of[String].TagMetadatacontains both the tag name and URL.font()Modifier forTextTo change the semantic HTML tag of
Textelements (<p>,<h1>, etc.), ensure.font()is the first modifier applied. Otherwise, it will only affect font size without changing the underlying HTML tag. Introducing environment modifiers will remove this restriction in the future.Protocol and Type Naming Changes
Protocol names changed following the pattern:
NavigationItem→NavigationElement. These shouldn't be directly conformed to, so impact should be minimal.Nested types were flattened:
Card.Style→CardStyle. This should affect few users.On Variadic Generics
Previously, Ignite erased almost everything to
AnyHTML, losing important type information. This made it difficult to handle type-specific behaviors in complex view hierarchies.Variadic generics preserve type information by allowing wrapper types to conditionally inherit protocol conformances from their content. For example, when a
Link(which conforms toLinkProvider) is wrapped in modifiers, the resultingModifiedHTMLtype also conforms toLinkProvider.This enables better type safety and more sophisticated compile-time optimizations while maintaining SwiftUI-like ergonomics. The upgrade required several new internal types:
HTMLModifier,PackHTML(equivalent to SwiftUI'sTupleView), and new result builders.