Skip to content
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

Handle Changeable/Buildable child fields (nested classes) #31

Open
Nico04 opened this issue Nov 28, 2024 · 1 comment
Open

Handle Changeable/Buildable child fields (nested classes) #31

Nico04 opened this issue Nov 28, 2024 · 1 comment

Comments

@Nico04
Copy link

Nico04 commented Nov 28, 2024

When you have a nested class structure (like in your basic_example, with Product beeing a child field of Order), I'm a bit surprised that generated code for changeable and buildable doesn't handle that :

  • _OrderChanges.product is of type Product and not _ProductChanges
  • OrderBuilder.product is of type Product and not ProductOrder (however this makes more sense as Product is NOT buildable)

I have a lot of nested classes like that, so this limitation makes the whole generated code a lot less usefull unfortunately.
Maybe we can add an extra parameter for this ?

@Nico04 Nico04 changed the title Handle Changeable/Buildable child fields Handle Changeable/Buildable child fields (nested classes) Nov 28, 2024
@BreX900
Copy link
Owner

BreX900 commented Jan 4, 2025

It would require more generated code and the performance would decrease both for the generator and the running code. Let's say that I almost never clone/change/rebuild a class. Do you have this need very often?

I'm also waiting for the metadata to arrive in stable so I can retire the build_runner. Sorry but I don't think I have any plans to support this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants