google / reflectable.dart

Reflectable is a Dart library that allows programmers to eliminate certain usages of dynamic reflection by specialization of reflective code to an equivalent implementation using only static techniques. The use of dynamic reflection is constrained in order to ensure that the specialized code can be generated and will have a reasonable size.
https://pub.dev/packages/reflectable
BSD 3-Clause "New" or "Revised" License
382 stars 57 forks source link

[Feature Request] separate Builder from types needed at runtime #336

Open devmil opened 3 days ago

devmil commented 3 days ago

We currently face an issue where a library we use, uses reflectable and therefore transitively introduces the Builder bundled with reflectable. We have a highly dynamic and huge package landscape and a couple of them use other Builders to generate code. The reflectable Builder is now causing issues (out of memory) and all those packages need to disable the reflector Builder in their build.yaml to continue working.

I think it would be better to have the Builder separated so that it can be used as a dev dependency not leaking it to all consumers.

d-silveira commented 3 days ago

please, please, do like json_serializable and other packaged builders, and split reflectable into 2 different packages, 1 for the builder and another for the annotation, so we don't need to introduce a lot of unneeded dependencies beyond the dev dependencies declaration!

eernstg commented 3 days ago

Makes sense. I'll take a look.