-
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
FED-279: Add improved prop forwarding method #829
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.
Made some comments but generally this looks great to me!
@kealjones-wk Were you still planning on updating existing documentation on prop forwarding to recommend this new pattern? Also, would you making sure the PR description is up to date? (it still mentions include
)
...component_declaration/builder_integration_tests/new_boilerplate/function_component_test.dart
Show resolved
Hide resolved
doc/new_boilerplate_migration.md
Outdated
@@ -23,18 +23,18 @@ _Preview of new boilerplate:_ | |||
|
|||
## Background | |||
|
|||
While converting the boilerplate for OverReact component declaration from Dart 1 |
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.
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.
apparently i cant even undo it 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.
eyyy TextEdit to the rescue!
@@ -781,42 +781,117 @@ UiFactory<FooProps> Foo = uiFunction( | |||
); | |||
``` | |||
|
|||
#### With Consumed Props | |||
#### With Prop Forwarding (fka Consumed Props) |
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.
Maybe this should go somewhere else? ugh i hate deciding where docs should go! @joebingham-wk i need your help lol
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 here and in the doc/props_mixin_component_composition.md section is sufficient for this PR 👍
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.
Not sure if this is ready for another full round of review, but I skimmed the docs changes and they look good to me, and I spotted a couple other things
...component_declaration/builder_integration_tests/new_boilerplate/function_component_test.dart
Outdated
Show resolved
Hide resolved
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!
Gonna see if anyone else on the team wants to weigh in before we merge
...component_declaration/builder_integration_tests/new_boilerplate/function_component_test.dart
Outdated
Show resolved
Hide resolved
cfd533e
…s/new_boilerplate/function_component_test.dart Co-authored-by: Greg Littlefield <[email protected]>
- gosh darnit greg
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 refresh
@Workiva/release-management-p |
@Workiva/release-management-p |
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 from RM
Motivation
OverReact's prop forwarding story (fka "Consumed Props") for uiFunction (and UiComponent2) feels overly verbose and tedious. It also just doesn't really match the ease that comes with traditional React prop forwarding via destructuring and spread syntax in JSX, eg.
...rest
.Changes
getPropsToForward
for use withaddAll
(ex...addAll(props.getPropsToForward(exclude: {FooPropsMixin}))
)addPropsToForward
for use withmodifyProps
(ex...modifyProps(props.addPropsToForward(exclude: {FooPropsMixin}))
)exclude
named argument will remove the props belonging to that Set of props mixins from the forwarded props.domOnly
named argument to forward only DOM based props.Release Notes
Review
See CONTRIBUTING.md for more details on review types (+1 / QA +1 / +10) and code review process.
Please review:
QA Checklist
Merge Checklist
While we perform many automated checks before auto-merging, some manual checks are needed: