-
Notifications
You must be signed in to change notification settings - Fork 15
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
feat: introduce WireMacros - no ticket #1694
base: develop
Are you sure you want to change the base?
Conversation
let uuid = #UUID("7411ca17-ba08-4905-92d2-0617a8c810ca") | ||
print(uuid) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these lines here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This main file is kind of a playground to develop the macros.... maybe it's not needed since we can do that in tests and/or in our other modules.
added an example how to use it in |
// Targets are the basic building blocks of a package, defining a module or a test suite. | ||
// Targets can depend on other targets in this package and products from dependencies. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd probably remove these two lines of comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I'm super in favor of adding macros if we can keep the compile performance costs are not prohibitive - especially those which can get rid of unnecessary optional values as these tend explode.
I would also consider adding something like #URL("http://example.com")
import Foundation | ||
|
||
/// A macro that, when attached to a protocol declaration, produces a | ||
/// companion "provider" protocol that can be used inject dependencies. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is pretty interesting. I need to take a look to understand the provider
pattern more
Issue
Create a
WireMacros
package:@Provided
generates a "provider" companion protocol for other protocols.#UUID
validates uuid strings at compile time.Open question: is the potential overhead of using macros a concern?
Checklist
[WPB-XXX]
.