-
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
CPLAT-5211 Add @Component2 annotation #289
CPLAT-5211 Add @Component2 annotation #289
Conversation
# Conflicts: # build.yaml
Security InsightsNo security relevant content was detected by automated scans. Action Items
Questions or Comments? Reach out on Slack: #support-infosec. |
# Conflicts: # lib/src/util/react_wrappers.dart # pubspec.yaml
+ And deprecate the v1 ones
+ Without the use of fully-resolved AST since we no longer have access to it for build perf reasons (see: #280)
+ Resulting from rebasing the new 3.1.0-wip branch
7641397
to
a99be36
Compare
80e6778
to
d0931c7
Compare
# Conflicts: # pubspec.yaml
# Conflicts: # build.yaml
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.
+10
These changes look perfect, @aaronlademann-wf; nice job!!
@@ -477,18 +537,21 @@ class ParsedDeclarations { | |||
final bool declaresComponent; | |||
|
|||
/// Helper function that returns the single value of a [list], or null if it is empty. | |||
static dynamic singleOrNull(List list) => list.isNotEmpty ? list.single : null; | |||
static singleOrNull(List list) => list.isNotEmpty ? list.single : null; |
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.
#nit Ooh we could make this generic (generics functions weren't supported when this method was authored):
static singleOrNull(List list) => list.isNotEmpty ? list.single : null; | |
static T singleOrNull<T>(List<T> list) => list.isNotEmpty ? list.single : null; |
+1 to 6856a62 @Workiva/release-management-pp |
Motivation
Since #280 modified the builder to no longer utilize fully-resolved AST when parsing annotations / component declarations, we must update the builder for our React 16 / over_react 3.1.0 work to differentiate
UiComponent2
instances without traversing the class hierarchy to tell if a component extends another component class that extendsComponent2
.We need to know if it is a "v2" component instance so we can modify the generated boilerplate to utilize JS-backed maps instead of the Dart maps that V1 components rely on.
Changes
@Component
/@AbstractComponent
annotations@Component2
/@AbstractComponent2
annotations@Component2
annotation instead of fully-resolved ASTBoy Scoutin'
UiComponent
/UiStatefulComponent
UiComponent2
/UiStatefulComponent2
dart:js_util
Review
See CONTRIBUTING.md for more details on review types (+1 / QA +1 / +10) and code review process.
Please review: @greglittlefield-wf @joebingham-wk @kealjones-wk @evanweible-wf
QA Checklist
@Component2
annotation.Merge Checklist
While we perform many automated checks before auto-merging, some manual checks are needed: