CPLAT-4843 Check for Legacy Lifecycle Methods in Component2 Declaration#301
Conversation
Security InsightsNo security relevant content was detected by automated scans. Action Items
Questions or Comments? Reach out on Slack: #support-infosec. |
aaronlademann-wf
left a comment
There was a problem hiding this comment.
Just the one indentation thing, but I'm +10 otherwise.
| final method = firstComponent2Member.getMethod(methodName); | ||
|
|
||
| if (method != null) { | ||
| error('''Error within ${firstComponent2Member.name.name}. |
There was a problem hiding this comment.
This is my bad @joebingham-wk ... but with ''' comments, in order for the indentation of the source to not influence the output, you have to wrap the string block in unindent(), which you can import from import 'package:over_react/src/util/string_util.dart';.
Otherwise... the error output in console will look like this...
There was a problem hiding this comment.
No problem - I've worked with comment blocks being logged out before and should have caught that. Thank you for pointing it out again!
There was a problem hiding this comment.
@aaronlademann-wf that's done! Also, I updated the error message to use method.name to keep the message cleaner and not include the method annotations / body. Let me know if the other way was better though
|
@Workiva/release-management-pp |

Motivation
Because of the inheritance structure of
Component2, it is possible for a consumer to utilize lifecycle methods that no longer exist within React 16. To prohibit this, a check was needed to stop the builder if a component inheriting fromComponent2was calling one those methods.Changes
declaration_parsing.dartlooking for the legacy lifecycle methods withinComponent2.ToggleButtonbecause it was breaking the build process.Release Notes
Review
See CONTRIBUTING.md for more details on review types (+1 / QA +1 / +10) and code review process.
Please review:
@aaronlademann-wf @greglittlefield-wf @kealjones-wk @sydneyjodon-wk
QA Checklist
ToggleButtonexample still behaves as expected.Merge Checklist
While we perform many automated checks before auto-merging, some manual checks are needed: