You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to make a propose to have declarative package description by using function builder as alternative way. I think we can keep current way as it is.
There are pros and cons. This case might not work with function builders because package description has type constraints in the tree structure, but I would love to hear your opinions.
Pros
Declarative description
More understandable API
Cons
Can't have type constraints for all of contents unless we defined function builder for specific types
Compiler error is not friendly when we have wrong content at unexpected place
With this implementation, description above can be encoded because it conforms to Encodable, so that this can be mapped to existing structure easily. Here is sample encoded output as JSON
kitasuke (JIRA User) Thanks for working on this! We should discuss this on the forums so a wider audience can pitch in. Can you post this in the SwiftPM development category: https://forums.swift.org/c/development/SwiftPM
Additional Detail from JIRA
md5: 063f185e77f07f6591ed8271b385975c
Issue Description:
Overview
I would like to make a propose to have declarative package description by using function builder as alternative way. I think we can keep current way as it is.
There are pros and cons. This case might not work with function builders because package description has type constraints in the tree structure, but I would love to hear your opinions.
Pros
Declarative description
More understandable API
Cons
Can't have type constraints for all of contents unless we defined function builder for specific types
Compiler error is not friendly when we have wrong content at unexpected place
Here is my rough implementation of the functionality. Encoded data would be interface for current implementation of package description.
https://gist.github.com/kitasuke/ee73934c2eda0f63bbd371b69380c443
With this implementation, description above can be encoded because it conforms to Encodable, so that this can be mapped to existing structure easily. Here is sample encoded output as JSON
The text was updated successfully, but these errors were encountered: