App icon indicating copy to clipboard operation
App copied to clipboard

[HOLD for payment 2024-12-17] Replace `react-native` Animated API with `react-native-reanimated`

Open blazejkustra opened this issue 1 year ago • 41 comments

Full proposal here.

Replace Animated API with Reanimated, which runs animations on the UI thread (instead of JS thread), ensuring great performance. Reanimated integrates deeply with react-native-gesture-handler (used throughout our app), offers advanced animations, and supports higher frame rates — exceeding 60fps.

https://github.com/user-attachments/assets/dc578b3d-080b-4d1e-91ba-ff10c171abd2

Issue OwnerCurrent Issue Owner: @stephanieelliott

blazejkustra avatar Nov 21 '24 16:11 blazejkustra

Triggered auto assignment to @stephanieelliott (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

melvin-bot[bot] avatar Nov 21 '24 16:11 melvin-bot[bot]

Current assignee @stephanieelliott is eligible for the NewFeature assigner, not assigning anyone new.

melvin-bot[bot] avatar Nov 21 '24 16:11 melvin-bot[bot]

:warning: It looks like this issue is labelled as a New Feature but not tied to any GitHub Project. Keep in mind that all new features should be tied to GitHub Projects in order to properly track external CAP software time :warning:

melvin-bot[bot] avatar Nov 21 '24 16:11 melvin-bot[bot]

Happy to help push this one along

mountiny avatar Nov 21 '24 16:11 mountiny

Triggered auto assignment to Design team member for new feature review - @dubielzyk-expensify (NewFeature)

melvin-bot[bot] avatar Nov 21 '24 16:11 melvin-bot[bot]

Update: I created a draft PR with just the Switch component. I will get back to it next week, and involve @sumo-slonik to speed up the process 😄

blazejkustra avatar Nov 22 '24 12:11 blazejkustra

Oh boy this is wonderful. Is there any particular part of the app I can help review?

Also, sidenote, but I would secretly love to add these kinda animations on that page if performance now permits this kinda stuff:

https://github.com/user-attachments/assets/43e48c18-6b18-4ec6-bc7f-3238f125d616

dubielzyk-expensify avatar Nov 25 '24 05:11 dubielzyk-expensify

Also, sidenote, but I would secretly love to add these kinda animations on that page if performance now permits this kinda stuff:

That looks neat, we could look into this but perhaps as a separate issue? @dubielzyk-expensify

blazejkustra avatar Nov 25 '24 09:11 blazejkustra

Yeah we can do that in a separate issue for sure

mountiny avatar Nov 25 '24 19:11 mountiny

Sounds good to me 😄 This is excellent and it just got me a bit too excited haha 😅 60fps FTW

dubielzyk-expensify avatar Nov 26 '24 02:11 dubielzyk-expensify

sky is the limit, 120 fps 🚀

mountiny avatar Nov 26 '24 11:11 mountiny

I have already managed to migrate the tooltip as well, I am now working on the tabs component and checking what could be improved in it :)

sumo-slonik avatar Nov 26 '24 16:11 sumo-slonik

UPDATE:

I migrated AttachmentModal and GrowlNotification.

Now I'm working on migrating

  • TextInput
  • TabSelector
  • BaseOverlay
  • SearchTypeMenuNarrow

sumo-slonik avatar Nov 27 '24 14:11 sumo-slonik

GrowlNotification is not used in the app, is it? we should probably remove it

mountiny avatar Nov 28 '24 08:11 mountiny

GrowlNotification is not used in the app, is it? we should probably remove it

it seems to me that we can't remove it because there are places where we continue to show it: image

sumo-slonik avatar Nov 28 '24 11:11 sumo-slonik

@mountiny we also found the use of react-native-animatable would we like to swap that too with this PR? image

sumo-slonik avatar Nov 28 '24 11:11 sumo-slonik

Update: TextInput is now ready

sumo-slonik avatar Nov 28 '24 12:11 sumo-slonik

@sumo-slonik @blazejkustra just to confirm, can we do this in some batches in multiple PRs? So we dont have one large PR with X components. This will help us catch regressions easier

mountiny avatar Nov 28 '24 13:11 mountiny

I think we will eventually remove it, but that is out of scope here, thanks for checking

mountiny avatar Nov 28 '24 13:11 mountiny

GrowlNotification is not used in the app, is it? we should probably remove it

it seems to me that we can't remove it because there are places where we continue to show it: image

This is related to Onfido flows. Can we do something else here and deprecate Growl in this issue? Maybe in a separate PR.

shubham1206agra avatar Nov 29 '24 09:11 shubham1206agra

Lets leave that out for different issue, feel free to write a proposal in open source and tag design team

mountiny avatar Nov 29 '24 09:11 mountiny

First PR is up! @shubham1206agra

blazejkustra avatar Nov 29 '24 12:11 blazejkustra

@blazejkustra I see a bug in recent switch PR.

Steps:

  1. Launch hybrid or ND app.
  2. Create a Collect workspace.
  3. Go to More features.
  4. Enable Rules.
  5. Close the upgrade modal without finishing.
  6. Observe that the switch is on and it is stuck there.

Sorry, I didn't see this earlier.

cc @sumo-slonik

shubham1206agra avatar Dec 02 '24 05:12 shubham1206agra

@shubham1206agra I'll check where it came from

sumo-slonik avatar Dec 02 '24 08:12 sumo-slonik

PR for the second part is ready: https://github.com/Expensify/App/pull/53321

sumo-slonik avatar Dec 02 '24 10:12 sumo-slonik

@blazejkustra I see a bug in recent switch PR.

Steps:

  1. Launch hybrid or ND app.
  2. Create a Collect workspace.
  3. Go to More features.
  4. Enable Rules.
  5. Close the upgrade modal without finishing.
  6. Observe that the switch is on and it is stuck there.

Sorry, I didn't see this earlier.

cc @sumo-slonik

I see that a similar problem is also for credit cards, but I think I know how to fix it, I'm already dealing with it

sumo-slonik avatar Dec 02 '24 10:12 sumo-slonik

@shubham1206agra Would the expected behavior be for the switch to be false if we leave the update tab?

sumo-slonik avatar Dec 02 '24 11:12 sumo-slonik

Yes

shubham1206agra avatar Dec 02 '24 11:12 shubham1206agra

@blazejkustra I see a bug in recent switch PR. Steps:

  1. Launch hybrid or ND app.
  2. Create a Collect workspace.
  3. Go to More features.
  4. Enable Rules.
  5. Close the upgrade modal without finishing.
  6. Observe that the switch is on and it is stuck there.

Sorry, I didn't see this earlier. cc @sumo-slonik

PR with bugfix: https://github.com/Expensify/App/pull/53379

sumo-slonik avatar Dec 02 '24 13:12 sumo-slonik

Reviewing label has been removed, please complete the "BugZero Checklist".

melvin-bot[bot] avatar Dec 04 '24 01:12 melvin-bot[bot]