-
Notifications
You must be signed in to change notification settings - Fork 74
Open
Description
Currently, the runtime library for the generated syntax classes is copied into each generated syntax.
We could consider making a separate runtime library package:
- All generated code would import this package.
- This packages would need to be published on pub.dev in order for
hooks_runner
to be able to roll intoflutter_tools
.
This would have the following benefits:
- No copy pasted in helper functions in every generated file: smaller diffs, and no diffs in unrelated syntax files.
- Properly sharing base classes such as
JsonObjectSyntax
.
However, publishing a separate package would lead to more churn:
- It would make the generated code less self-contained, leading to having to do an extra publish step on rolls.
- More process to avoid version skew between the generated code and runtime library when generating.
Currently, json_syntax_generator
has many rough edges and many breaking changes, so we keep the helper library to be copy pasted into every generated file for now.