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-2675 Only validate required props in null-safe components #917

Merged
merged 9 commits into from
May 23, 2024

Conversation

sydneyjodon-wk
Copy link
Contributor

@sydneyjodon-wk sydneyjodon-wk commented May 15, 2024

Motivation

over_react should only perform required prop validation for components that have migrated to null safety.

That way, during null safety migrations, packages that export prop mixins will be able to make props required without also causing them to be required in components that mix in those props in other packages (assuming those downstream components haven't migrated to null safety out of order), preventing a breaking change.

Then, when the components using the prop mixins are migrated to null safety, the required prop validation errors would take effect, at which point the consumers could add the appropriate @Props(disableRequiredPropValidation: {...}) annotations.

This will make it easier and safer to make props required in mixins that are used in wrapper components, like certain RMUI props mixins (like AutocompletePropsMixin).

See [this thread] for more info and an initial spike implementation: https://workiva.slack.com/archives/C063ZQ70Y7P/p1714608338493519

Changes

  • Update runtime validation of required props to be a noop if a component isn't declared in a null-safe library (see spike impl linked above)
    • Add tests (non-null-safe props mixing in null-safe props mixin with required props)
  • Update analyzer plugin to not warn for missing required props if the concrete props class is not declared in a null-safe library
    • Add tests
  • Update required props markdown docs (added in FED-1885) to reflect this behavior

Release Notes

Review

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

Please review:

QA Checklist

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

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

@sydneyjodon-wk sydneyjodon-wk marked this pull request as ready for review May 16, 2024 17:20
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.

Changes and test coverage look great to me, +1!

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.

+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

@rmconsole6-wk rmconsole6-wk merged commit baeaf2e into master May 23, 2024
7 checks passed
@rmconsole6-wk rmconsole6-wk deleted the FED-2675-only-validate-null-safe-required-props branch May 23, 2024 15:49
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