-
Notifications
You must be signed in to change notification settings - Fork 7
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-1721 Null safety preparation for class component default props / initial state #284
FED-1721 Null safety preparation for class component default props / initial state #284
Conversation
that is essentially identical to the defaultProps one
prevalent in WSD
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 they're mostly minor. This looks awesome!
lib/src/dart3_suggestors/null_safety_prep/utils/class_component_required_fields.dart
Outdated
Show resolved
Hide resolved
lib/src/dart3_suggestors/null_safety_prep/utils/class_component_required_fields.dart
Outdated
Show resolved
Hide resolved
lib/src/dart3_suggestors/null_safety_prep/utils/class_component_required_fields.dart
Outdated
Show resolved
Hide resolved
lib/src/dart3_suggestors/null_safety_prep/utils/class_component_required_fields.dart
Outdated
Show resolved
Hide resolved
lib/src/dart3_suggestors/null_safety_prep/utils/class_component_required_fields.dart
Outdated
Show resolved
Hide resolved
lib/src/dart3_suggestors/null_safety_prep/class_component_required_default_props.dart
Outdated
Show resolved
Hide resolved
test/dart3_suggestors/null_safety_prep/class_component_required_default_props_test.dart
Outdated
Show resolved
Hide resolved
test/dart3_suggestors/null_safety_prep/class_component_required_default_props_test.dart
Show resolved
Hide resolved
test/dart3_suggestors/null_safety_prep/class_component_required_initial_state_test.dart
Outdated
Show resolved
Hide resolved
test/dart3_suggestors/null_safety_prep/class_component_required_initial_state_test.dart
Outdated
Show resolved
Hide resolved
and fix the issue it uncovered
…ED-1721_class-component-default-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.
+1, gonna take a break then do some QAing!
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 things found while QAing. Tested on a few repos and the output looks fantastic!
lib/src/dart3_suggestors/null_safety_prep/class_component_required_default_props.dart
Outdated
Show resolved
Hide resolved
lib/src/dart3_suggestors/null_safety_prep/utils/class_component_required_fields.dart
Outdated
Show resolved
Hide resolved
…ED-1721_class-component-default-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.
+10
@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
Class based components use
defaultProps
andinitialState
to set the value of certain props / state fields when the class is constructed.To map this pattern to null safety - we need props that are defaulted, and state that is initialized to be marked with a
/*late*/
hint to indicate that it will be set at the time of class construction, and a/*!*/
hint to assist the null safety migrator so it knows that defaulted props / initialized state will never be null.Changes
null_safety_migrator_companion
executable.What it does
Before
After
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: