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

FED-1729 Prepare for react-dart 7.0.0 #846

Merged
merged 7 commits into from
Oct 11, 2023

Conversation

greglittlefield-wf
Copy link
Contributor

@greglittlefield-wf greglittlefield-wf commented Oct 9, 2023

Motivation

The not-yet-released react-dart 7.0.0 contains breaking changes that will need to be addressed in over_react before it's compatible.

We'll be making these compatibility changes proactively in order to make testing of the WIP react-dart 7.0.0 branch easier, and also to validate that we won't hit any blockers that require tweaks to the major changes in react-dart 7.0.0.

This PR won't be raising the upper bound of over_react's react-dart dependency, but once react-dart 7.0.0 is released, there shouldn't be any additional code changes necessary to raise that upper bound.

Changes

  • Update usage of deprecated react.main to use react.htmlMain
  • Add internal copy of react-dart's forwardRef, removed from react-dart 7.0.0 but still used by over_react's forwardRef
    • over_react's forwardRef is deprecated, and will be removed in the next major, along with this copy
  • Remove tests that rely on jsThis being null in unmounted components
    • This is in response to behavior changes in react-dart 7.0.0 to throw instead of returning null.
    • Since we didn't ever need to support unmounted components in the first place (the tested utility is only used internally on mounted components), we'll just remove the tests.
  • Reuse jsifyPropTypes super logic to avoid reimplementing JS interop
    • This eliminates JS interop logic that was duplicated from react-dart, which relied on APIs removed in react-dart 7.0.0, and in general was at risk of getting out of sync.
    • These changes were backported from the null-safety branch.
  • Add useRefInit that just forwards to react-dart's useRefInit, update analyzer plugin

Release Notes

  • Update internals to prepare for react-dart 7.0.0

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

This behavior changes in react-dart 7.0.0 to throw instead of
returning null.

Since we didn't ever need to support unmounted components in the first
place, we'll just remove the tests.
This eliminates JS interop logic that was duplicated from react-dart,
which relied on APIs removed in react-dart 7.0.0, and in general was at
risk of getting out of sync.

These changes were backported from the null-safety branch.
@rmconsole6-wk rmconsole6-wk changed the title Prepare for react-dart 7.0.0 FED-1729 Prepare for react-dart 7.0.0 Oct 9, 2023
@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.

…eact 7.0.0

The existing lack of a default was also bad behavior, since passing
`null` as children would break.
@greglittlefield-wf greglittlefield-wf marked this pull request as ready for review October 10, 2023 18:02
@greglittlefield-wf greglittlefield-wf requested review from a team and aaronlademann-wf and removed request for a team October 10, 2023 18:10
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 (passing CI)

ReactElement build(Map props, [List childrenArgs]) {
ReactElement build(Map props, [List childrenArgs = const []]) {
Copy link
Contributor

Choose a reason for hiding this comment

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

🏅

@greglittlefield-wf
Copy link
Contributor Author

@Workiva/release-management-p

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 8cd3f6c into master Oct 11, 2023
10 checks passed
@rmconsole3-wf rmconsole3-wf deleted the prepare-for-react-dart-v7 branch October 11, 2023 17:11
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.

5 participants