Skip to content

Conversation

@JasonVMo
Copy link
Contributor

Platforms Impacted

  • All

Description of changes

Type Updates

This updates the types in the memo-cache package to split the untyped and typed usage. Previously it used any in ways would make it look like it was typed, when in fact it had lost the type inferences. Now there are two patterns:

  • Typed - this is equivalent to GetMemoValue<MyType> and getMemoCache<MyType>() except things are more explicitly typed here. The previous utilities are replaced by GetTypedMemoValue<T> and getTypedMemoCache<T>
  • Untyped - this replaces what happens when the above were used untyped. In this case the returned signature is a function that inferences its type from the parameters (or it can be specified). This is what we want in this case, not any behavior.

The previous usage was type unsafe, fails a bunch of more advanced lint rules and TS 5+ compilations, and at times would break inferencing in the project.

Security Fix

This fix addresses the code scanning issue: https://github.com/microsoft/fluentui-react-native/security/code-scanning/4 by making the calls to ensure entries in the underlying cache explicit rather than using the helper function.

Export entry removals

This also removes the export map entries for immutable-merge, memo-cache, and merge-props from framework base. These would require special handling in metro bundling to use and I don't want to tempt people into using something that breaks their bundling. It also eliminates another place where additional exports would need to be added.

Verification

Builds work, tests run, the changes should be almost entirely type only.

@JasonVMo JasonVMo requested a review from a team as a code owner July 22, 2025 19:11
@JasonVMo JasonVMo merged commit dd4d507 into main Jul 22, 2025
11 checks passed
@JasonVMo JasonVMo deleted the user/jasonvmo/memo-types branch July 22, 2025 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants