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

INTL-1208: Change parameters typed Function in formattedMessage calls to Object #215

Merged
merged 3 commits into from
Apr 6, 2023

Conversation

alanknight-wk
Copy link
Contributor

@alanknight-wk alanknight-wk commented Apr 3, 2023

Motivation

Intl.formattedMessage calls take parameters that are Functions. But if the containing function types those arguments as Function it's a problem. This is because Dart then tears off the [call] method from those objects and passes it instead of the object. For React components, which implement call, then we no longer have access to the component, so we can't check properly for how many arguments it wants (by checking explicitly for the known zero-argument functions like Dom.br()). So make the codemod automatically change such arguments from Function to Object.

Changes

In IntlMessage, change the function parameters when reading the file, so rewriting it will use the updated form.

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

@alanknight-wk alanknight-wk marked this pull request as draft April 3, 2023 21:31
@aviary2-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.

@alanknight-wk alanknight-wk marked this pull request as ready for review April 4, 2023 14:03
@alanknight-wk alanknight-wk changed the title Change parameters typed Function in formattedMessage calls to Object INTL-1208: Change parameters typed Function in formattedMessage calls to Object Apr 4, 2023
@alanknight-wk
Copy link
Contributor Author

@Workiva/release-management-p

@alanknight-wk
Copy link
Contributor Author

QA +1

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

@rmconsole4-wk rmconsole4-wk merged commit 6a13cac into master Apr 6, 2023
@rmconsole4-wk rmconsole4-wk deleted the remove_function_types branch April 6, 2023 13:31
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