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

fix: resolve AccessibilityState import issue due to types migration to react-native package #1355

Merged
merged 1 commit into from
Mar 3, 2023

Conversation

mdjastrzebski
Copy link
Member

Summary

Duplicate AccessibilityState type as AccessibilityStateMatcher type in order to avoid issues occurring during migration period from @types/react-native to built-in react-native types. See #1351 for details.

This fix will be first applied to v12 branch to verify that it fixes the issue, and later will be backported to v11.

Resolves #1351

Test plan

Verification by @AugustinLF after v12 RC2 is released.

@mdjastrzebski mdjastrzebski changed the title fix: duplicate AccessibilityState type fix: resolve AccessibilityState import issue due to types migration to react-native package Mar 3, 2023
@mdjastrzebski
Copy link
Member Author

@thymikee perhaps you'll have some alternative solution to the exposing RN types issue during migration from @types/react-native to built-in react-native type defs.

@codecov
Copy link

codecov bot commented Mar 3, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.03 🎉

Comparison is base (2168860) 96.10% compared to head (760c918) 96.13%.

Additional details and impacted files
@@            Coverage Diff             @@
##              v12    #1355      +/-   ##
==========================================
+ Coverage   96.10%   96.13%   +0.03%     
==========================================
  Files          49       49              
  Lines        3283     3314      +31     
  Branches      491      491              
==========================================
+ Hits         3155     3186      +31     
  Misses        128      128              
Impacted Files Coverage Δ
src/helpers/matchers/accessibilityState.ts 100.00% <100.00%> (ø)
src/queries/a11yState.ts 100.00% <100.00%> (ø)
src/queries/role.ts 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@pierrezimmermannbam
Copy link
Collaborator

We're also using AccessibilityValue type from React Native

@mdjastrzebski
Copy link
Member Author

@pierrezimmermannbam true, but somehow we use it only internally and do not re-export it. When searching in build folder there are no more any import("react-native") nor import("react-native/types") statements in .d.ts files.

@AugustinLF
Copy link
Collaborator

Yep the errors I saw were only pointing out to AccessibilityState

@pierrezimmermannbam
Copy link
Collaborator

Oh indeed we're redeclaring the type AccessibilityValueMatcher so it's not a problem

@mdjastrzebski mdjastrzebski merged commit fba97a2 into v12 Mar 3, 2023
@mdjastrzebski mdjastrzebski deleted the fix/accessibility-state-type-import branch March 3, 2023 17:00
@mdjastrzebski
Copy link
Member Author

Just released RC2 with this fix. @AugustinLF let me know if this fixes the error, then I will backport it to v11 versions on main branch.

@AugustinLF
Copy link
Collaborator

It works!

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