CPLAT-11143 Emit a build error for mismatched components in the new boilerplate#496
Merged
rmconsole2-wf merged 5 commits intomasterfrom May 20, 2020
Merged
Conversation
Security InsightsNo security relevant content was detected by automated scans. Action Items
Questions or Comments? Reach out on Slack: #support-infosec. |
Contributor
Author
Comment on lines
+450
to
+463
| final confidences = VersionConfidences( | ||
| // If the component extends from a base class known to be supported by the new boilerplate, | ||
| // has no annotation, is not abstract, and does not have $isClassGenerated, then it's | ||
| // most likely intended to be part of a new boilerplate class component declaration. | ||
| // | ||
| // Make this `likely` so that components that don't get associated with factory/props | ||
| // due to naming issues aren't silently ignored. | ||
| v4_mixinBased: !classish.hasAbstractKeyword && | ||
| !_overridesIsClassGenerated(classish) && | ||
| mixinBoilerplateBaseClasses.contains(classish.superclass?.nameWithoutPrefix) | ||
| ? Confidence.likely | ||
| : Confidence.neutral, | ||
| v2_legacyBackwardsCompat: Confidence.neutral, | ||
| v3_legacyDart2Only: Confidence.neutral, |
Contributor
Author
There was a problem hiding this comment.
Thanks! I'm super happy that the confidence approach made this kind of change easy
evanweible-wf
previously approved these changes
May 15, 2020
willdrach-wk
suggested changes
May 15, 2020
willdrach-wk
left a comment
There was a problem hiding this comment.
One quick little thing but overall looks good!
85c7073
aaronlademann-wf
approved these changes
May 15, 2020
joebingham-wk
approved these changes
May 15, 2020
Contributor
Author
QA +1 |
Contributor
Author
|
@Workiva/release-management-p |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
If a component isn't named correctly in the new boilerplate, it won't get associated with the factory and props class the author intended it to be.
Currently, this mismatched component is ignored and the component gets interpreted as a props mapview, and when the consumer invokes the builder, they get a runtime error.
It would be better if it failed the build.
Changes
v4_mixinBasedconfidence of components to aboveneutral, resulting in mismatched components emitting errors instead of getting silently ignored.Release Notes
Emit a build error for mismatched components in the new boilerplate
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: