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

[OLD] FED 2299 Utilize new ReactNode typedef #893

Closed
wants to merge 12 commits into from

Conversation

aaronlademann-wf
Copy link
Contributor

Motivation

Workiva/react-dart#384 adds a new typedef that is an alias for Object?. We should use it!

Changes

Use it where appropriate

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 Frameworks Design 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

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

@aaronlademann-wf aaronlademann-wf changed the base branch from v5_wip to master July 23, 2024 14:14
…99_ReactNode_typedef

# Conflicts:
#	test/mockito.mocks.dart
Copy link
Contributor

@greglittlefield-wf greglittlefield-wf left a comment

Choose a reason for hiding this comment

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

Just a couple comments, otherwise looks good!


/// The children that were passed in to this component when it was built.
List<dynamic>? get children {
List<ReactNode>? get children {
Copy link
Contributor

Choose a reason for hiding this comment

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

Unfortunately this is a breaking change, since consumers will no longer be able to dynamically invoke methods on children (which they probably shouldn't be doing, and instead using proper type checks).

And I think it might mess up implicit casting in some cases too, not 100% sure.

I'd just be surprised if there aren't some usages out there that would be broken.

So, I'd say either we revert this change, or if we really wanted to, perhaps we could do some consumer static analysis testing to see if it affects anything.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The check did not do well. I'll revert this.

Copy link
Contributor Author

@aaronlademann-wf aaronlademann-wf Aug 19, 2024

Choose a reason for hiding this comment

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

lib/src/util/react_wrappers.dart Outdated Show resolved Hide resolved
lib/src/util/react_wrappers.dart Outdated Show resolved Hide resolved
@@ -67,11 +67,11 @@ mixin SuspensePropsMixin on UiProps {
/// The actual UI you intend to render. If children suspends while rendering, the Suspense boundary will
/// switch to rendering fallback.
@override
/*ReactNode*/ List<dynamic>? get children;
List<ReactNode>? get children;
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar to above, the changes to props in this component are technically breaking changes, but I think we could get away with these in particular since, by comparison, there should be almost no components that read the children/fallback props from this props mixin.

Copy link
Contributor

@greglittlefield-wf greglittlefield-wf left a comment

Choose a reason for hiding this comment

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

+10

@aaronlademann-wf
Copy link
Contributor Author

Rosie is not picking up the build even after closing/re-opening.

Closing in favor of a new PR

@aaronlademann-wf aaronlademann-wf changed the title FED-2299 Utilize new ReactNode typedef [OLD] FED 2299 Utilize new ReactNode typedef Aug 20, 2024
@rmconsole2-wf rmconsole2-wf deleted the v5/FED-2299_ReactNode_typedef branch August 20, 2024 16:08
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.

4 participants