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

Null safety 3 #192

Merged
merged 11 commits into from
Nov 10, 2023
Merged

Null safety 3 #192

merged 11 commits into from
Nov 10, 2023

Conversation

sorenthompson-wk
Copy link
Contributor

Motivation

Now that we have implemented ActionV2 in w_flux 2.11.0 we can safely migrate this repo to null-safety

Changes

Run the dart migrate tool for the root app and the example app

Release Notes

Review

See CONTRIBUTING.md for more details on review types (+1 / QA +1 / +10) and code review process.

Please review:

QA Checklist

  • Tests were updated and provide good coverage of the changeset and other affected code
  • Manual testing was performed if needed

Merge Checklist

While we perform many automated checks before auto-merging, some manual checks are needed:

  • A Frontend Architecture member has reviewed these changes
  • There are no unaddressed comments - this check can be automated if reviewers use the "Request Changes" feature
  • For release PRs - Version metadata in Rosie comment is correct

@@ -8,7 +8,7 @@ analyzer:
# When compiling to JS, both implicit options apply to the current
# project and all dependencies. They are useful to find possible
# Type fixes or areas for explicit typing.
implicit-casts: true
implicit-casts: false
Copy link
Member

@robbecker-wf robbecker-wf Nov 8, 2023

Choose a reason for hiding this comment

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

I think we should use the replacements available since 2.16 https://dart.dev/tools/analysis#enabling-additional-type-checks
which would mean we'd also need to raise the SDK minimum to at least 2.16

analyzer:
  language:
    strict-casts: true

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will this replace:

analyzer:
    strong-mode:
        implicit-casts: true
        implicit-dynamic: true

or just implicit-casts: true

Copy link
Member

Choose a reason for hiding this comment

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

It would replace the whole strong-mode block.
implicit-dynamic: true is the default and doesn't do anything, so can safely be removed.

pubspec.yaml Outdated
@@ -19,3 +19,9 @@ dev_dependencies:
dart_dev: ^4.0.0
dependency_validator: ^3.0.0
test: ^1.18.2

dependency_overrides:
Copy link
Member

Choose a reason for hiding this comment

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

TODO Once react releases, we'll need to remove this override and set the react dependency minimum to the new react release (line 12 above)

@@ -387,14 +387,14 @@ void main() {
test('should support dispatch with a null payload', () async {
nullAction.listen(expectAsync1((payload) {
expect(payload, isNull);
}));
} as dynamic Function(Null)));
Copy link
Member

Choose a reason for hiding this comment

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

#nit The migration tool seems to love to add the as casts ... is this needed or can it be fixed a different way? Since the tests pass, then I consider this optional.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It looks like it is not needed. I removed the cast and the analyzer seems ok with it.

@aviary3-wk
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.

evanweible-wf
evanweible-wf previously approved these changes Nov 8, 2023
Copy link
Contributor

Choose a reason for hiding this comment

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

This file name should be analysis_options.yaml

@sorenthompson-wk
Copy link
Contributor Author

@Workiva/release-management-p ready to merge 🎉

Copy link
Contributor

@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

@rmconsole5-wk rmconsole5-wk merged commit f6e21b3 into master Nov 10, 2023
6 checks passed
@rmconsole5-wk rmconsole5-wk deleted the null-safety-3 branch November 10, 2023 18:42
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