Closed getusha closed 6 months ago
Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers!
@aimane-chnaif Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]
@getusha can you please summarize changes in PR description, similar to proposal?
Replaced
keyboardType
prop with inputMode
We will have usages for which do not have equivalent values, for native. ascii-capable
and visible-password
https://github.com/Expensify/App/pull/24482/files#diff-9d6b0cc89c7cab66ac4042ac0549bfc66ddc9e7a182b6b5dbbf7f687328f10b5R760-R763editable
prop with readOnly
numberOfLines
prop with rows
nativeID
prop with id
focusable
prop with tabIndex
with values 0 and -1pointerEvents
prop with pointerEvents
styleaccessibility*
prop with aria-*
As of my investigation aria-*
props are not supported yet in react-native-testing-library
for example to query the components such as queryAllBy*
methods.
as a result of it using accessibilityLabel
for now.accessibilityRole
with role
eslint-plugin-react-native-a11y do not recognize role
only recognizes accessibilityRole
. I am seeing the code and planning to raise a PR to make it support aria-*
and role
props. this is specifically for fixing lint errors.transform
array values to spaced values
Though we can replace non animated styles without any issue, template literal with animated values will not work. it is working only with array values. we can reach out to SWM how we can use it with spaced values from react-native-reanimated please correct me if i am wrong.textAlignVertical
prop with verticalAlign
style.Patch for https://github.com/Expensify/react-native-web/pull/2 https://github.com/Expensify/react-native-web/pull/2 even though the code looks quite outdated.
Additionally added a fix inside the patch for the following issue which was caused by scaleY(-1)
https://github.com/Expensify/App/issues/16660#issuecomment-1666444603
@aimane-chnaif I hope i haven't missed a detail. thanks!
@aimane-chnaif raised the PR for eslint-plugin-react-native-a11y
to support the role
prop https://github.com/FormidableLabs/eslint-plugin-react-native-a11y/pull/150
@aimane-chnaif raised the PR for
eslint-plugin-react-native-a11y
to support therole
prop FormidableLabs/eslint-plugin-react-native-a11y#150
@roryabraham should we wait for this or patch ourselves?
I'm comfortable using patch files as long as we have created an upstream PR and actively try to get that merged ππΌ
@getusha can you please also create an issue in https://github.com/FormidableLabs/eslint-plugin-react-native-a11y as well so that you can link the PR to it and others will be able to easily find it. That way we can more easily tell if it's resolved by another PR as well
We don't necessarily have a formal process around this yet, but our thinking is that the contributor that adds the patch is meant to be responsible for getting the change merged upstream, then upgrading the dependency to remove the patch ASAP.
@getusha I see there are a number of failing tests here + some conflicts here. I'm going to add the [WIP]
prefix to the title, please remove it and ping us when this is ready for review. Thanks
Hey, I noticed you changed some webpack configuration files. This can break production builds. Did you remember to run a production build locally to verify they still work?
and i raised a PR for react-native-key-command https://github.com/Expensify/react-native-key-command/pull/31 this will fix a conflict while installing packages.
@roryabraham sorry to ping you early, the reason several tests are failing ^ i already raised the PR can we get that merged? i thought it would make sense to update the version from the root instead of patching it. thanks!
Oof I forgot that Expensify/react-native-key-command isn't a fork of a 3rd-party dependency, but an original library of ours created by @azimgd. Reviewing https://github.com/Expensify/react-native-key-command/pull/31 right now...
Update: merged and published in react-native-key-command@1.0.4
@getusha what is currently blocking?
@aimane-chnaif added patch for eslint-plugin-react-native-a11y https://github.com/Expensify/App/pull/24482/commits/916bff09978a9784ed47c334bca28bf0e88fcc48 and lint is still failing it might be related to eslint cache. I am going to remove WIP and start testing. thanks!
@aimane-chnaif @roryabraham It's ready for review!
@getusha Looks like you left a lot of accessibilityLabel
prop. Can you tell me the reason for the same?
I think you should make all of them aria-label
for consistency.
@getusha Looks like you left a lot of accessibilityLabel prop. Can you tell me the reason for the same?
@shubham1206agra please check my comment here
@getusha Looks like you left a lot of accessibilityLabel prop. Can you tell me the reason for the same?
@shubham1206agra please check my comment here
Ok But there are a lot of accessibility props left if we ignore accessibilityLabel. Can you identify them and fix them?
Copy this checklist and use this. It will be easier for you to verify/handle all the changes.
@aimane-chnaif I have doubts about one change [change] Deprecate non-standard logical styles, e.g., 'marginStart'.
Should we ignore this change as it might break cross-platform support?
@aimane-chnaif I have doubts about one change [change] Deprecate non-standard logical styles, e.g., 'marginStart'.
Should we ignore this change as it might break cross-platform support?
This is the checklist if we want to make this change. I think we should not make this change. What are your thoughts @aimane-chnaif @getusha ?
@aimane-chnaif @roryabraham It's ready for review!
@getusha The branch conflicts and also lint failing
@aimane-chnaif incase you missed my comment: https://github.com/Expensify/App/pull/24482#issuecomment-1678853696 lint is passing locally.
@aimane-chnaif incase you missed my comment: #24482 (comment) lint is passing locally.
lint error log:
Missing a11y props. Expected one of: accessibilityRole OR BOTH accessibilityLabel + accessibilityHint OR BOTH accessibilityActions + onAccessibilityAction react-native-a11y/has-valid-accessibility-descriptors
lint error log:
> eslint . --max-warnings=0 --cache --cache-location=node_modules/.cache/eslint
it's using the cache
here is the patch: https://github.com/Expensify/App/pull/24482/files#diff-b5cde766ba30f0666adfd5b473f588511ec53434ee1ca1af047044604cfd8d68
is there any way to reinstall the packages here?
@aimane-chnaif all checks have passed now.
@getusha please fix conflict
@aimane-chnaif fixed conflicts, will fix them as they come.
@getusha conflicts again
@aimane-chnaif Fixed.
@aimane-chnaif friendly bump for a review.
Hey, I've just had a quick look at this PR (because my issue is on HOLD on it).
I've found an issue. The ReportScreen
content is centered instead of at the bottom.
Main | Staging | This PR |
---|---|---|
@kosmydel thanks for bringing this up here! i also identified this previously i thought i fixed it, pushed the changes now check it again.
So far console warnings/errors caused by this PR:
Warnings:
Errors:
false
for a non-boolean attribute collapsable
.
If you want to write it to the DOM, pass a string instead: collapsable="false" or collapsable={value.toString()}.transform array values to spaced values
Though we can replace non animated styles without any issue, template literal with animated values will not work. it is working only with array values. we can reach out to SWM how we can use it with spaced values from react-native-reanimated please correct me if i am wrong.
accessibilityLabel
aria-label not being supported by react-native-testing-library
for querying components
numberOfLines (many cases)
numberOfLines is deprecated for TextInput
on the release notes, so i changed it only for the text input. i believe the remaining is only applied on Text
components.
rows={numberOfLines}
selectable (BaseHTMLEngineProvider)
Since it was an external component i assumed it might be a custom prop which will be used, i will check again and see if we can pass stylings to the component.
Web bugs so far:
https://github.com/Expensify/App/assets/96077027/3c7bebaf-48a2-4b54-9eb8-1f64375b68c0
https://github.com/Expensify/App/assets/96077027/ea5ba299-6acb-4553-96bf-8ebd4283e8ac
https://github.com/Expensify/App/assets/96077027/a3fe5c71-18f1-4c96-8fda-2c1a47b4881c
https://github.com/Expensify/App/assets/96077027/3d66c2f3-3816-4dea-85a8-f777bee3bb3f
Native bugs so far:
BUG6. Console warning
BUG7: keyboard shows unnecesarily
https://github.com/Expensify/App/assets/96077027/060d9d98-6a1a-4bff-ad28-215616f70daf
BUG8: money request view position is wrong when no messages
https://github.com/Expensify/App/assets/96077027/277ff1fb-00c5-41d3-ba56-a3371a1a3b1e
BUG9: task preview style is broken, huge gap from composer
BUG10: crash when edit task description (same root cause as BUG2)
https://github.com/Expensify/App/assets/96077027/53cf6a78-640f-4295-8c34-cd5935b38897
BUG1: no skeleton, search input label is not activated even though focused
@aimane-chnaif thanks for the review! I Identified the bug, it causes some sort of delay across most of the components/pages i am investigating the root cause from react-native-web
@aimane-chnaif fixed all bugs related to web, working on the native issues π
Though we can replace non animated styles without any issue, template literal with animated values will not work. it is working only with array values. we can reach out to SWM how we can use it with spaced values from react-native-reanimated please correct me if i am wrong.
Update: i noticed a PR Animated support for string transforms. https://github.com/necolas/react-native-web/pull/2546 I will try again following the examples.
BUG7: keyboard shows unnecesarily
@aimane-chnaif unable to reproduce this one.
https://github.com/Expensify/App/assets/75031127/5f3551f5-47b0-4041-ad0f-e0a603cbad14
@getusha Can you test this issue if this is fixed by this change? https://github.com/Expensify/App/issues/24397
@aimane-chnaif Can you help me merge this PR? https://github.com/necolas/react-native-web/pull/2569
@aimane-chnaif Can you help me merge this PR? necolas/react-native-web#2569
you want me to review https://github.com/necolas/react-native-web/pull/2569?
I think you can review it. But I think you need to merge so that the warning can be solved when using a skeleton.
BUG6. Console warning
@aimane-chnaif i am not sure why we are giving the accessibilityRole 'text' for TextInputs and also there is no equivalent for it in the new role
prop. i think we can safely remove it what do you think?
BUG6. Console warning
@aimane-chnaif i am not sure why we are giving the accessibilityRole 'text' for TextInputs and also there is no equivalent for it in the new
role
prop. i think we can safely remove it what do you think?
I don't find any instance of setting accessibilityRole in TextInput. Can you share link?
I don't find any instance of setting accessibilityRole in TextInput. Can you share link?
@aimane-chnaif for example here: https://github.com/Expensify/App/blob/34d4e54055c3fee2a04e2fc11af82fe454197ff9/src/components/AmountTextInput.js#L52
I don't find any instance of setting accessibilityRole in TextInput. Can you share link?
@aimane-chnaif for example here:
you can ask why it's necessary the PR author who added it.
Meanwhile, fix all other remaining bugs
Details
Deprecated props
nativeId
replaced withid
propfocusable
replaced withtabIndex
proppointerEvents
replaced withpointerEvents
style propertyselectable
replaced withuserSelect
style propertykeyboardType
replaced withinputMode
prop there are values which didn't have a replacement with the new prop used on native currently,visible-password
andascii-capable
they thenkeyboardType
will still be used on native files.returnKeyType
replaced withenterKeyHint
propeditable
replaced withreadOnly
propnumberOfLines
replaced withrows
prop forTextInput
componentaccessibility*
replacedaria*
props We may use someaccessibility*
props in order to prevent some 3rd part libraries from breaking. for example@testing-library/react-native
: usingaria-label
instead ofaccessibilityLabel
will cause the testing library from getting the component usingqueryByLabelText
textAlignVertical
prop replaced withverticalAlign
styleDeprecated style properties/values
transform
array value to space-separated string functions. e.g.transform: 'scale(2)'
there are limitations using the space-separated string functions with Animated components, some transforms are still using array values more info: https://github.com/necolas/react-native-web/issues/2528resizeMode
style replaced withresizeMode
propBreaking changes based on the usages in the codebase
position:relative
by default.InteractionManager
.More information can be found on this release note
Fixed Issues
$ https://github.com/Expensify/App/issues/16660 PROPOSAL: https://github.com/Expensify/App/issues/16660#issuecomment-1666425053
Tests
No Specific test cases
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android