-
Notifications
You must be signed in to change notification settings - Fork 273
RFC: readability vs RTL compatibility in API naming #1194
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
Comments
I vote for the third solution. Or even better, suggest RTL to change :) I agree that we need better name, and RTL's naming shouldn't be the lowest denominator. However having the same names is very important
|
I agree with @AugustinLF , the naming hidden is very confusing to me so I think it should change so I'm not in favor of the first option and keeping compatibility with RTL is also very important so having both names seems like the better option |
I agree with the third option as well, even though I've been working on the hidden option for quite some time now, I still have a hard time remembering what hidden:true means. |
IMO the length of the param shouldn't necessarily be a problem. Ideally you want to enable that as a global settings, and only change it when needed, which hopefully should be almost never. |
I agree with both @AugustinLF and @MattAgn on having a name as explicit as possible |
Thanks for your feedback guys! I will submit a related PR in the upcoming days. |
How should we proceed with Regarding using Re @thymikee @AugustinLF @pierrezimmermannbam @MattAgn wdyt about naming propositions. Would someone of you like to contribute PR for I think it would be beneficial to release |
I agree that the most important is to know what hidden true or false means As for For I'd be glad to take on the issue and implement the new naming we choose :) |
For the implementation, here are some of my thoughts and questions (if we were to go with
What do you think? |
@MattAgn Pls go ahead the PR, I will release RNTL after merging that 🚢 I think we should not complicate things and we should assume that if both options are present then the preferred one ( Re naming, let's seen in a PR how the use cases in our tests and doc read with shorter ( |
Alright I'm on it |
RNTL is modelled after RTL, as one of our unstated goals we strive to reimplement RTL for React Native platform, expose familiar features and APIs while accounting for platform differences.
So far we have been reasonably successful with this approach as it delivered familiar and well thought out API. However recently, when we started to implement A11y-related features I’ve found that some of them are somewhat confusingly named:
isInaccessible
- which checks if the element is hidden from accessibility, which is a different concept that being accessibility element as indicated byaccessible
prop. Values ofaccessibility
prop and results ofisInaccessible
are independent and all four combinations (true/false) are allowed.hidden
query option - this option controls whether we include elements hidden from accessibility in our queries. However, it is unintuitive whetherhidden: true
orhidden: false
includes the hidden elements and I have to refer to the documentation to check that.I think readability of our code could be improved by renaming these in a following way:
isInaccessible
->isHiddenFromAccessibility
hidden
option ->includeHidden
Note: the change is only about the naming, the arguments or behaviour do not change.
Such renaming would however break our naming compatibility with RTL.
I see couple of options how we could approach that:
I think we should consider using 3rd option, as it gives us both more explicit and readable code while catering for people with RTL background.
@thymikee @AugustinLF @pierrezimmermannbam @MattAgn What do you think?
The text was updated successfully, but these errors were encountered: