Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
2.99k stars 2.5k forks source link

Upgrade to react-native-web v0.19.9 #24482

Closed getusha closed 6 months ago

getusha commented 9 months ago

Details

Deprecated props

Deprecated style properties/values

Breaking changes based on the usages in the codebase

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

Screenshots/Videos

Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android
melvin-bot[bot] commented 9 months ago

Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers!

melvin-bot[bot] commented 9 months ago

@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]

aimane-chnaif commented 9 months ago

@getusha can you please summarize changes in PR description, similar to proposal?

getusha commented 9 months ago
  1. Replaced the fork package with upstream version.

Replaced

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!

getusha commented 9 months ago

@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 commented 9 months ago

@aimane-chnaif raised the PR for eslint-plugin-react-native-a11y to support the role prop FormidableLabs/eslint-plugin-react-native-a11y#150

@roryabraham should we wait for this or patch ourselves?

roryabraham commented 9 months ago

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

roryabraham commented 9 months ago

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.

roryabraham commented 9 months ago

@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

melvin-bot[bot] commented 9 months ago

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?

getusha commented 9 months ago

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!

Screenshot 2023-08-14 at 11 20 53 PM
roryabraham commented 9 months ago

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

aimane-chnaif commented 9 months ago

@getusha what is currently blocking?

getusha commented 9 months ago

@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!

getusha commented 9 months ago

@aimane-chnaif @roryabraham It's ready for review!

shubham1206agra commented 9 months ago

@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 commented 9 months ago

@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

shubham1206agra commented 9 months ago

@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?

shubham1206agra commented 9 months ago

Copy this checklist and use this. It will be easier for you to verify/handle all the changes.

shubham1206agra commented 9 months ago

@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?

shubham1206agra commented 9 months ago

@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 commented 9 months ago

@aimane-chnaif @roryabraham It's ready for review!

@getusha The branch conflicts and also lint failing

getusha commented 9 months ago

@aimane-chnaif incase you missed my comment: https://github.com/Expensify/App/pull/24482#issuecomment-1678853696 lint is passing locally.

aimane-chnaif commented 9 months ago

@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

getusha commented 9 months ago

lint error log:

> eslint . --max-warnings=0 --cache --cache-location=node_modules/.cache/eslint

it's using the cache

getusha commented 9 months ago

here is the patch: https://github.com/Expensify/App/pull/24482/files#diff-b5cde766ba30f0666adfd5b473f588511ec53434ee1ca1af047044604cfd8d68

is there any way to reinstall the packages here?

getusha commented 9 months ago

@aimane-chnaif all checks have passed now.

aimane-chnaif commented 9 months ago

@getusha please fix conflict

getusha commented 9 months ago

@aimane-chnaif fixed conflicts, will fix them as they come.

aimane-chnaif commented 9 months ago

@getusha conflicts again

getusha commented 9 months ago

@aimane-chnaif Fixed.

getusha commented 9 months ago

@aimane-chnaif friendly bump for a review.

kosmydel commented 9 months ago

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
Screenshot 2023-08-22 at 11 29 50 Screenshot 2023-08-22 at 11 22 47 Screenshot 2023-08-22 at 11 22 41
getusha commented 9 months ago

@kosmydel thanks for bringing this up here! i also identified this previously i thought i fixed it, pushed the changes now check it again.

aimane-chnaif commented 8 months ago

So far console warnings/errors caused by this PR:

Warnings:

Errors:

getusha commented 8 months ago

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.

aimane-chnaif commented 8 months ago

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

bug3

https://github.com/Expensify/App/assets/96077027/a3fe5c71-18f1-4c96-8fda-2c1a47b4881c

https://github.com/Expensify/App/assets/96077027/3d66c2f3-3816-4dea-85a8-f777bee3bb3f

aimane-chnaif commented 8 months ago

Native bugs so far:

BUG6. Console warning

bug6

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

bug9

BUG10: crash when edit task description (same root cause as BUG2)

https://github.com/Expensify/App/assets/96077027/53cf6a78-640f-4295-8c34-cd5935b38897

getusha commented 8 months ago

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

getusha commented 8 months ago

@aimane-chnaif fixed all bugs related to web, working on the native issues πŸ™‡

getusha commented 8 months ago

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.

getusha commented 8 months ago

BUG7: keyboard shows unnecesarily

@aimane-chnaif unable to reproduce this one.

https://github.com/Expensify/App/assets/75031127/5f3551f5-47b0-4041-ad0f-e0a603cbad14

shubham1206agra commented 8 months ago

@getusha Can you test this issue if this is fixed by this change? https://github.com/Expensify/App/issues/24397

shubham1206agra commented 8 months ago

@aimane-chnaif Can you help me merge this PR? https://github.com/necolas/react-native-web/pull/2569

aimane-chnaif commented 8 months ago

@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?

shubham1206agra commented 8 months ago

I think you can review it. But I think you need to merge so that the warning can be solved when using a skeleton.

getusha commented 8 months ago

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?

aimane-chnaif commented 8 months ago

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?

getusha commented 8 months ago

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

aimane-chnaif commented 8 months ago

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

you can ask why it's necessary the PR author who added it.

Meanwhile, fix all other remaining bugs