Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: requestlayout improvements #9122

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

Merged

Conversation

farfromrefug
Copy link
Collaborator

This is a first pass at improving requestLayout. The biggest improvements are seen on iOS.

  • during applyAllNativeSetters or applyPendingNativeSetters prevent requestLayout calls on every property change. Instead call requestLayout if needed at the end. This is a big change on iOS as most properties are marked as affecting layout.
  • on top of that dont even call requestLayout at all if within onLoaded. it is not necessary as the parent with layout itself and thus layout all its children.

With that change, the colors fixes and the android background color change simplification, i see a 5-10% shorter loading time on android. Tested it with different apps of different complexity.

It is totally unecessary to call multiple requestLayout inside initNativeView (properties set)
Even worse we dont need to do any requestLayout from “onLoaded” as the parent will layout itself/children
@NathanaelA

This comment was marked as abuse.

@farfromrefug
Copy link
Collaborator Author

Which app are you referring to?

@NathanWalker
Copy link
Contributor

@farfromrefug npm start > type automated.ios (and you can also run automated.android) to kick them off locally.

@farfromrefug
Copy link
Collaborator Author

@NathanWalker thanks was not sure @NathanaelA was refering to another one.

@cla-bot cla-bot bot added the cla: yes label Feb 1, 2021
@farfromrefug
Copy link
Collaborator Author

@rigor789 should be all good

rigor789
rigor789 previously approved these changes Feb 1, 2021
Copy link
Member

@rigor789 rigor789 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@NathanWalker
Copy link
Contributor

@farfromrefug I'm curious if your fork may have a different setting than most? I've noticed that on all your PR's we can not update the PR with base automatically on github however for all other pr's we are able to. Is there a setting on your fork that may be preventing that? We could help get quite a few of your pr's merged if we can update them with latest master automatically here.

@NathanWalker NathanWalker added this to the 8.1 milestone Jul 12, 2021
@farfromrefug
Copy link
Collaborator Author

@NathanWalker you mean on my PR s you font have the right to update? I always create PRs from github website but I have to say I almost never ensure the checkbox for collaboration is checked or not. though it should be by default

@NathanWalker NathanWalker changed the base branch from master to release/8.1.0 August 11, 2021 18:49
@NathanWalker NathanWalker merged commit e4ce17e into NativeScript:release/8.1.0 Aug 11, 2021
NathanWalker pushed a commit that referenced this pull request Sep 8, 2021
It was unnecessary to make multiple calls requestLayout inside initNativeView (properties set)
NathanWalker added a commit that referenced this pull request Sep 10, 2021
rigor789 pushed a commit that referenced this pull request Sep 10, 2021
This reverts commit 4f5f0aa.

This commit breaks back-navigation in certain cases, most prominently with Button pseudo classes. We plan to revisit this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants