-
Notifications
You must be signed in to change notification settings - Fork 984
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
migrate reagent part 7 #19316
migrate reagent part 7 #19316
Conversation
Jenkins BuildsClick to see older builds (23)
|
@@ -1,5 +1,5 @@ | |||
import { useAnimatedReaction, withTiming, runOnJS } from 'react-native-reanimated'; | |||
import { useState } from "react" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these changes are needed? seems to just be a clash of formatter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was done by lint-fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my bad, forgot i didn't have a formatter for js on save :(. It's strange the CI didn't fail bc of this.
on-press]}] | ||
(let [theme (quo.theme/use-theme-value) | ||
[pressed? set-pressed] (rn/use-state false) | ||
on-press-in (rn/use-callback #(set-pressed true)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems there is some questions on how much memoization we want to add to components. Particularly simple ui components like this which don't really have much need /use for this level of optimzation. As discussed in #19298 by @BalogunofAfrica.
It would be nice to figure this detail out before we merge all these refactor pr's so that we don't have to refactor the refactors :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all should be memoized, it's cheap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@flexsurfer It does comes at a cost of more memory been used. I would be curious to see how this play out in a resource constrained (low RAM) Android device
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this would also hold true for us memoizing every component by default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@flexsurfer I also think memoizing everything is too much.
Memoizing callbacks is important when we pass these callbacks to components that will re-render but not all of our components suffer from it. IMO applying memoization (in general, not just React) is a process done after identifying bottlenecks, not a thing that must be done all the time since it's not for free.
Also @cammellos was in favour of making this rule more leninent:
#19033 (comment)
wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reagent already memo hundreds of components by default, adding a few callbacks won't change the picture much, in react it's not done by default because comparison is expensive and not always possible or effective not because of memory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, reagent memoizes (makes use of memo
) because it needs to add a custom way to compare data across rerenders, otherwise, everything may be re-rendered all the time.
adding a few callbacks won't change the picture much
They aren't few callbacks, they'd be all the callbacks.
Anyway, again just wanted to share my thoughts on this topic.
:on-press-out on-press-out | ||
:style (style/add-account-container {:theme theme | ||
:metrics? metrics? | ||
:pressed? pressed?})} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw the reason this is a pressable wrapping a button is to expand the styling beyond the button, which is centered in the component.
as far as I recall the thing is that the border of this component also has some pressed state styling to it so it needs to be aware of when it's pressed in etc as well.
Perhaps there was something more to it but pretty sure it was along that lines of why this was handled this way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i just removed on-press handlers from the button
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah makes sense, I wonder does that affect the styles of the button in pressed state then.
31% of end-end tests have passed
Failed tests (32)Click to expandClass TestOneToOneChatMultipleSharedDevicesNewUiTwo:
Class TestActivityCenterContactRequestMultipleDevicePR:
Class TestActivityMultipleDevicePRTwo:
Class TestCommunityMultipleDeviceMergedTwo:
Class TestActivityMultipleDevicePR:
Class TestCommunityMultipleDeviceMerged:
Class TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestGroupChatMultipleDeviceMergedNewUI:
Expected to fail tests (1)Click to expandClass TestCommunityOneDeviceMerged:
Passed tests (15)Click to expandClass TestOneToOneChatMultipleSharedDevicesNewUiTwo:
Class TestActivityCenterContactRequestMultipleDevicePR:
Class TestCommunityMultipleDeviceMergedTwo:
Class TestDeepLinksOneDevice:
Class TestCommunityOneDeviceMerged:
|
85% of end-end tests have passed
Failed tests (6)Click to expandClass TestGroupChatMultipleDeviceMergedNewUI:
Class TestDeepLinksOneDevice:
Expected to fail tests (1)Click to expandClass TestCommunityOneDeviceMerged:
Passed tests (41)Click to expandClass TestGroupChatMultipleDeviceMergedNewUI:
Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:
Class TestCommunityOneDeviceMerged:
Class TestActivityMultipleDevicePRTwo:
Class TestCommunityMultipleDeviceMergedTwo:
Class TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestActivityMultipleDevicePR:
Class TestActivityCenterContactRequestMultipleDevicePR:
Class TestCommunityMultipleDeviceMerged:
|
@flexsurfer can you please elaborate on what should be tested in this PR and what is the possible scope of regression and also resolve the conflicts and reabse PR? |
1f64cba
to
810674f
Compare
@churik added description, thank you |
88% of end-end tests have passed
Failed tests (5)Click to expandClass TestDeepLinksOneDevice:
Class TestCommunityMultipleDeviceMergedTwo:
Class TestWalletOneDevice:
Expected to fail tests (1)Click to expandClass TestCommunityOneDeviceMerged:
Passed tests (46)Click to expandClass TestActivityMultipleDevicePR:
Class TestCommunityMultipleDeviceMerged:
Class TestActivityCenterContactRequestMultipleDevicePR:
Class TestCommunityOneDeviceMerged:
Class TestGroupChatMultipleDeviceMergedNewUI:
Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:
Class TestWalletMultipleDevice:
Class TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestCommunityMultipleDeviceMergedTwo:
Class TestActivityMultipleDevicePRTwo:
|
@flexsurfer thanks for the PR. Please take a look at the issue ISSUE 1 '+' icon inside Add new account button does not respond on tapSteps:
Actual result: '+' icon does not react in tap. Rest area of the Add new account button reacts on tap. telegram-cloud-document-2-5244745854052485599.mp4 |
1885656
to
b36f9d3
Compare
good catch @pavloburykh , fixed |
52% of end-end tests have passed
Failed tests (24)Click to expandClass TestCommunityMultipleDeviceMergedTwo:
Class TestCommunityOneDeviceMerged:
Class TestDeepLinksOneDevice:
Class TestCommunityMultipleDeviceMerged:
Class TestActivityMultipleDevicePR:
Class TestGroupChatMultipleDeviceMergedNewUI:
Class TestActivityMultipleDevicePRTwo:
Expected to fail tests (1)Click to expandClass TestCommunityOneDeviceMerged:
Passed tests (27)Click to expandClass TestCommunityOneDeviceMerged:
Class TestWalletOneDevice:
Class TestWalletMultipleDevice:
Class TestActivityCenterContactRequestMultipleDevicePR:
Class TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:
Class TestGroupChatMultipleDeviceMergedNewUI:
|
@flexsurfer thanks for the fix. Failed e2e are not PR related. Ready for merge. |
this is the latest change for quo, and it's free from reagent :)
Affected quo components:
wallet/account_card
wallet/amount_input
wallet/keypair
wallet/network_routing
wallet/token_input
wallet/wallet_activity
For QA: A smoke test should be enough, but pls contact me if you need more info or help