-
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
CPLAT-6938 Add flag to upgrade abstract components #46
CPLAT-6938 Add flag to upgrade abstract components #46
Conversation
… CPLAT-6938-upgrade-abstract-components-flag
…grade-abstract-components-flag # Conflicts: # lib/src/component2_suggestors/class_name_and_annotation_migrator.dart # lib/src/component2_suggestors/componentdidupdate_migrator.dart # lib/src/component2_suggestors/componentwillmount_migrator.dart # lib/src/component2_suggestors/copyunconsumeddomprops_migrator.dart # lib/src/component2_suggestors/deprecated_lifecycle_suggestor.dart # lib/src/component2_suggestors/setstate_updater.dart # lib/src/executables/component2_upgrade.dart
…grade-abstract-components-flag
Security InsightsNo security relevant content was detected by automated scans. Action Items
Questions or Comments? Reach out on Slack: #support-infosec. |
…abstract-components-flag
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.
Woops
@@ -148,7 +167,7 @@ void classNameAndAnnotationTests({bool allowPartialUpgrades}) { | |||
expectedPatchCount: allowPartialUpgrades ? 2 : 0, | |||
input: ''' | |||
@Component() | |||
class FooComponent extends UiComponent<FooProps> { | |||
class FooComponent extends UiComponent { |
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 am assuming you removed all these generics aka <FooProps>
because you thought that meant this class was abstract. Thats my bad for not fully explaining. Having the generics aka <FooProps>
on the class that this class extends from is fine and doesn't make it "abstract". Having a generic on the class name itself would make it extendable/abstract...
so if it looks like this:
class FooComponent extends UiComponent { | |
class FooComponent<BarProps> extends UiComponent<FooProps> { |
In the above the <BarProps>
is what makes this component "extendable"/"abstract"
test/component2_suggestors/class_name_and_annotation_migrator_test.dart
Outdated
Show resolved
Hide resolved
test/component2_suggestors/class_name_and_annotation_migrator_test.dart
Outdated
Show resolved
Hide resolved
test/component2_suggestors/class_name_and_annotation_migrator_test.dart
Outdated
Show resolved
Hide resolved
test/component2_suggestors/class_name_and_annotation_migrator_test.dart
Outdated
Show resolved
Hide resolved
test/component2_suggestors/class_name_and_annotation_migrator_test.dart
Outdated
Show resolved
Hide resolved
test/component2_suggestors/class_name_and_annotation_migrator_test.dart
Outdated
Show resolved
Hide resolved
test/component2_suggestors/copyunconsumeddomprops_migrator_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.
+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.
+1
@Workiva/release-management-pp
Reliant on CPLAT-6936 (#42)
Because this PR uses the test functions created in #42, the base of this branch is
CPLAT-6936-no-partial-upgrades-flag
.Motivation
If a component is upgraded to Component2, any components that extend from it could potentially break. Within a library, this is fine, but it's problematic if the component is exported.
For an easier incremental upgrade process, we should an option to have our codemod only upgrade components that can't be extended from.
That way, we can run and commit these partial upgrades separately, which will make rolling them back easier if it's determined that they cannot be upgraded without causing any breakages.
Changes
--upgrade-abstract-components
to Component2 codemod executable that will allow the codemod to upgrade abstract components.abstract
keyword on component class@AbstractProps
in the same fileRelease Notes
Review
See CONTRIBUTING.md for more details on review types (+1 / QA +1 / +10) and code review process.
Please review:
@kealjones-wk @aaronlademann-wf @greglittlefield-wf @joebingham-wk
QA Checklist
--upgrade-abstract-components
flag and verify that the codemod updates abstract components based on the above criteria.pub global run over_react_codemod:component2_upgrade --upgrade-abstract-components
Merge Checklist
While we perform many automated checks before auto-merging, some manual checks are needed: