Skip to content
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

Update OverReact syntax to support Dart 2.9+ #111

Merged

Conversation

sourcegraph-wk
Copy link

Motivation

In order to enable Workiva to transition to Dart >=2.9.0 with ease, a slight update to OverReact factory syntax
is required.

Important:

  1. Remember to update your snippets in order to prevent accidental regressions in boilerplate. Here
    is the reference for OverReact snippets.
  2. To prevent incompatible boilerplate from being introduced, a react-boilerplate core-check has been activated. This
    core check will fail if the incompatible mixin based boilerplate is introduced again to a project that has migrated already.

For more information on why this migration is important, see this wiki update.

NOTE: Only the mixin based boilerplate factories will be migrated. In other words, if your factory is still
using the @Factory annotation, it will not be migrated to the Dart 2.9-compatible boilerplate and must first
be migrated to the mixin based syntax.
For additional reference, here
are the instructions to migrate for projects depedent on Web Skin Dart.

Changes

Below are two examples of the minor tweaks that will occur. For a reference of all the small changes that will occur
(including to the connect syntax), refer to option #2 here.
Note that ignore comments are not included in those examples.

  1. Switch factory declarations to use the new syntax.
    UiFactory<FooProps> Foo = 
    -    _$Foo; // ignore: undefined_identifier, invalid_assignment
    +   castUiFactory(_$Foo); // ignore: undefined_identifier
  2. For functional components, use the private config instead of the public one.
    UiFactory<FooProps> Foo = uiFunction(
      (props) {
        return 'Foo';
      },
    -  $FooConfig, // ignore: undefined_identifier
    +  _$FooConfig, // ignore: undefined_identifier
    );
  3. Bump minimum over_react version to be compatible with the new syntax.

Release Notes

Migrate mixin based factories to the Dart 2.9-compatible boilerplate.

QA

These changes are not expected to require any special form of QA. As long as CI performs analysis on Dart code and runs a Dart build,
a passing CI is sufficient to merge these changes.

For more information or questions, reach out to us in the #support-ui-platform Slack channel.

Created by Sourcegraph campaign Workiva/dart2_9_boilerplate_migration.

@aviary-wf
Copy link

Security Insights

No security relevant content was detected by automated scans.

Action Items

  • Review PR for security impact; comment "security review required" if needed or unsure
  • Verify aviary.yaml coverage of security relevant code

Questions or Comments? Reach out on Slack: #support-infosec.

Copy link
Contributor

@aaronlademann-wf aaronlademann-wf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 / +10

@Workiva/release-management-pp

Copy link

@rmconsole-wf rmconsole-wf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 from RM

@rmconsole3-wf rmconsole3-wf merged commit 4af93cb into master Feb 4, 2021
@rmconsole3-wf rmconsole3-wf deleted the campaign/client_platform/dart2-9-boilerplate-migration branch February 4, 2021 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants