-
Notifications
You must be signed in to change notification settings - Fork 43
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
Support strict staged builders on collections/optionals #1682
Comments
Every change would result in an Abi break for consumers. It could make sense with conjure-local, but I think it would be too dangerous everywhere else.
…-ck
On Feb 24, 2022, at 18:26, Sander Kromwijk ***@***.***> wrote:
What happened?
Omitting optional fields reduces boilerplate, but also makes it easier to accidentally forget to plumb through a new field across different parts of an application.
What did you want to happen?
Either a flag or a separate builder which generates stages for required & optional fields (& forces passing in explicitly empty collections/optionals)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
|
I don't think either of the 2 proposed "approaches" (separate builder or a flag) would be breaking for consumers. We have also had a few cases in our product where this would be useful, even though I am not sure it would deliver the value as promised, meaning if it would actually get used enough organically. |
The generator flag would break any consumer with uses the generated objects. |
There's a potential solution where we use one implementation for compilation, and another (more lenient) at runtime. Requires some interesting build/compilation hacking to get the best of both worlds.... |
@carterkozak Sorry for the gap in comms, need to fix my notifications 😓 Do we have other places where we do this already, or would this be a first? On the multiple types of builder, could this be solved by adding a linter? It feels like it should be possible to e.g. forbid the non-strict builder for a given package (e.g. by forbidding all uses of builders w/ a The main issue here for us is actually project-internal (not so much our client's usage) |
What happened?
Omitting optional fields reduces boilerplate, but also makes it easier to accidentally forget to plumb through a new field across different parts of an application.
What did you want to happen?
Either a flag or a separate builder which generates stages for required & optional fields (& forces passing in explicitly empty collections/optionals)
The text was updated successfully, but these errors were encountered: