-
Notifications
You must be signed in to change notification settings - Fork 58
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
AF-3085: Transformer is aware of Dart 2 builder compatible boilerplate for Factories #205
Conversation
…tion is initialized with $<UiFactory> for Dart 2 builder compatibility and will replace the initialization with the Map BackingProps as it does currently for Dart 1
Security InsightsNo security relevant content was detected by automated scans. Action Items
Questions or Comments? Reach out on Slack: #support-infosec. |
Codecov Report
@@ Coverage Diff @@
## master #205 +/- ##
==========================================
+ Coverage 94.58% 94.59% +0.01%
==========================================
Files 34 34
Lines 1660 1661 +1
==========================================
+ Hits 1570 1571 +1
Misses 90 90 |
logger.error( | ||
'Factory variables are stubs for the generated factories, and should not have initializers.', | ||
'Factory variables are stubs for the generated factories, and should not have initializers ' | ||
'unless initialized with \$<UiFactory> for Dart 2 builder compatibility.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can have a more helpful error message here. UiFactory
is a type so I don't think it should be used as a placeholder here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, maybe just include the expected string?
'unless initialized with \$$factoryName...';
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. But i'd defer to @greglittlefield-wf for a final signoff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
QA +1
@Workiva/release-management-p |
Ultimate problem:
The Dart 2 builder compatible boilerplate for factories includes an initialization statement for a UiFactory, e.g.:
The problem is that the transformer throws an error if a UiFactory declaration is initialized.
How it was fixed:
([Map backingProps]) => new _$FooPropsImpl(backingProps);
Testing suggestions:
CI passes
Code changes and added tests make sense