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-471 Add utilities for jsifying/unsifying context props #785

Merged
merged 4 commits into from
Oct 13, 2022

Conversation

greglittlefield-wf
Copy link
Contributor

@greglittlefield-wf greglittlefield-wf commented Oct 12, 2022

Motivation

Some JS components accept a custom React Context as a prop, and we want to support interop-ing with those components in a consumer-friendly way.

In react-dart/over_react, APIs that deal with React context, like createContext and useContext, use a Dart wrapper around the JS React context object.

So, consumers are dealing with Dart context, while JS components need JS context. Ideally, consumers shouldn't have to manually wrap/unwrap context when they're passing it to/from JS components.

Changes

  • Add unjsifyContextProp/jsifyContextProp utility methods, similar to the ones for refs and maps
  • Add test cases
  • Update JS interop documentation

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

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

@greglittlefield-wf greglittlefield-wf marked this pull request as ready for review October 12, 2022 22:54
@rmconsole-wf rmconsole-wf changed the title Add utilities for jsifying/unsifying context props FED-471 Add utilities for jsifying/unsifying context props Oct 12, 2022
@greglittlefield-wf greglittlefield-wf requested review from a team, aaronlademann-wf and brianphillips-wk and removed request for a team and aaronlademann-wf October 12, 2022 23:02
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

AWESOME!

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

  • Tested in unified using the analogous RMUI branch, everything context related works as expected.

@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

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