-
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-3873 Function Components #606
CPLAT-3873 Function Components #606
Conversation
Security InsightsNo security relevant content was detected by automated scans. Action Items
Questions or Comments? Reach out on Slack: #support-infosec. |
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.
Sorry, I got a notification when this PR was opened and couldn't help but take a peek 😅
I have one question around the use of v5 and reusing existing grouping logic; let me know if you'd like to talk it over in person!
# Conflicts: # snippets/snippets.json # snippets/snippets.xml
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.
Line 705 of doc/new_boilerplate_migration.md
needs to be updated to remove the "coming soon" bit from the heading.
README.md
Outdated
// Return the rendered component contents here. | ||
// The `props` variable is typed; no need for string keys! |
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.
Can we return something here to demonstrate things like prop forwarding, etc.?
} | ||
final genericFactory = uiFunction<UiProps>(GenericFactory, null); | ||
|
||
final basicFactory = uiFunction<BasicProps>( |
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.
IMO we should also have one utilizing forwardRef
.
@@ -46,7 +46,7 @@ abstract class TypedMapImplGenerator extends BoilerplateDeclarationGenerator { | |||
|
|||
TypedMapNames get names; | |||
bool get isComponent2; | |||
FactoryNames get factoryNames; | |||
List<FactoryNames> get factoryNames; |
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.
What is the tldr; on this change?
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.
We need to generate a props config for every function component factory (even if they share the same props mixin) so that the display name is set up correctly. This has to be a list in order to get all the factory names from PropsMapViewOrFunctionComponentDeclaration.factories
. In all other cases factoryNames
would have a single element -- I just added an assert for that in _generateFactory
.
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.
Some comments around generation, but this looks awesome!!
…ponents # Conflicts: # pubspec.yaml
Addressed feedback
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.
Hey @aaronlademann-wf @greglittlefield-wf I think I addressed all your feedback except that one discussion on FunctionComponentConfig
which I put in slack. So this is ready for another round of review when you have time!
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.
Just a couple minor things; this is looking awesome! I'll try and start QAing soon
} | ||
|
||
/// Helper class used to keep track of generated information for [uiFunction]. | ||
@protected |
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.
Now that we accept it as an argument to uiFunction, this class and its members shouldn't be @protected
anymore
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
QAing now...
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.
- Test coverage looks good
- Examples look good and render as expected
- Builder changes don't affect existing code
+10 🎉
Motivation
Now that we've migrated to the new boilerplate, we need to implement function components so they can be used in
over_react
.Changes
uiFunction
,PropsFactory
) (implemented in Greg's spike branch)uiFunction
Release Notes
Review
See CONTRIBUTING.md for more details on review types (+1 / QA +1 / +10) and code review process.
Please review:
QA Checklist
pbr serve example
and verify that function components work as expected on http://localhost:8080/builder/Merge Checklist
While we perform many automated checks before auto-merging, some manual checks are needed: