dart-lang / source_gen

Automatic source code generation for Dart
https://pub.dev/packages/source_gen
BSD 3-Clause "New" or "Revised" License
484 stars 105 forks source link

Add "Reviver" functionality. #680

Open Nexushunter opened 1 year ago

Nexushunter commented 1 year ago

It would be nicer as a builder library to allow for users to extend our classes and allow them to leverage our builder while not adding the user's custom logic into our builder. This means that we would need the ability to store ConstantReaders and DartObject?s within memory.

We have all the needed functionality currently with the dart:mirrors library (which currently has usage by the TypeChecker). This could be listed as an unstable functionality (as dart:mirrors is listed as unstable) until a new direction is found (be that metaprogramming etc). This would give builder package maintainers the ability to make some of our functionality more flexible, while not adding to the maintainers burden.

An example of what this would look like is available in #679.