-
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
Merge Dart 2.9 boilerplate wip #679
Conversation
…ry-configs-private CPLAT-12620 Make factory config syntax use private variables
…art-2.9-boilerplate-wip
…19-support-new-factory-syntax
…orkiva/over_react into CPLAT-12619-support-new-factory-syntax
…act into CPLAT-12619-support-new-factory-syntax
…out-generated-files
Opt main lib out of react_boilerplate core-check
Co-authored-by: Greg Littlefield <greg.littlefield@workiva.com>
Security InsightsNo security relevant content was detected by automated scans. Action Items
Questions or Comments? Reach out on Slack: #support-infosec. |
…rated-files CPLAT-13170 Analyze over_react examples without generated code
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
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.
QA +1
- All over_react subpackages build (including over_react itself)
- Smoke tested all over_react apps / examples
- Consumer test built
@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
Dart 2.9 removed support for ignoring error-severity analyzer errors. This is already an issue, as the library currently relies on those ignore comments for undefined identifiers. Into this future, this issue will be exasperated by the enforcement of implicit cast errors that will be enforced when NNBD is introduced in Dart 2.12.
For more context, see this issue.
Changes
Introducing
castUiFactory
!The main change is that a new utility,
castUiFactory
, was introduced. This utility works by using generics to infer the typing from the surrounding context. This utility works around the implicit cast issue by inferring the typing from the surround context.For a reference of all permutations of the boilerplate with this utility, see the over_react examples.
Private Generated Factory Configs
The solution to the
undefined_identifier
errors is that identifiers prefixed with_$
will bedynamic
in the future.Component factory declarations already followed this convention, but functional component's generated
UiFactoryConfig
s did not. Therefore, the public config is still generated, but is deprecated. Instead, use the private config. For example:Migrating
To migrate, you should first ensure you have migrated to the mixin-based syntax.
From there, you can run an over_react_codemod script to perform the migration!