Skip to content

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

Merged
mdjastrzebski merged 1 commit into
v12from
fix/accessibility-state-type-import
Mar 3, 2023
Merged

fix: resolve AccessibilityState import issue due to types migration to react-native package#1355
mdjastrzebski merged 1 commit into
v12from
fix/accessibility-state-type-import

Conversation

@mdjastrzebski

Copy link
Copy Markdown
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
Copy Markdown
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

codecov Bot commented Mar 3, 2023

Copy link
Copy Markdown

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
Copy Markdown
Collaborator

We're also using AccessibilityValue type from React Native

@mdjastrzebski

Copy link
Copy Markdown
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
Copy Markdown
Collaborator

Yep the errors I saw were only pointing out to AccessibilityState

@pierrezimmermannbam

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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