Skip to content
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

Fixup contentLength invalidation logic #38733

Closed
wants to merge 3 commits into from

Conversation

NickGerleman
Copy link
Contributor

Summary:
I was working under the assumption that Fabric fired layout events bottom up, but it actually fires them top-down, in constrast to Paper.

Previous invalidation logic wasn't quite correct when fired bottom-up. This corrects the logic by:

  1. Deriving direction based on initial event ordering
  2. Use last cached contentLength if we are on Fabric (top-down)
  3. Use future contentLength if we are on Paper (bottom-up)

Changelog:
[General][Fixed] - Fixup contentLength invalidation logic

Differential Revision: D47978638

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner fb-exported labels Aug 2, 2023
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D47978638

@analysis-bot
Copy link

analysis-bot commented Aug 2, 2023

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,894,560 +40
android hermes armeabi-v7a 7,943,117 +44
android hermes x86 9,292,451 +35
android hermes x86_64 9,193,969 +37
android jsc arm64-v8a 9,481,382 +72
android jsc armeabi-v7a 8,422,922 +76
android jsc x86 9,465,399 +67
android jsc x86_64 9,779,640 +76

Base commit: a34ce64
Branch: main

NickGerleman added a commit to NickGerleman/react-native that referenced this pull request Aug 3, 2023
Summary:
Pull Request resolved: facebook#38733

I was working under the assumption that Fabric fired layout events bottom up, but it actually fires them top-down, in constrast to Paper.

Previous invalidation logic wasn't quite correct when fired bottom-up. This corrects the logic by:
1. Deriving direction based on initial event ordering
2. Use last cached contentLength if we are on Fabric (top-down)
3. Use future contentLength if we are on Paper (bottom-up)

Changelog:
[General][Fixed] - Fixup contentLength invalidation logic

Reviewed By: rozele

Differential Revision: D47978638

fbshipit-source-id: 3e17ccec3e23e72e0c04207086640d50c96755ed
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D47978638

1 similar comment
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D47978638

NickGerleman added a commit to NickGerleman/react-native that referenced this pull request Aug 4, 2023
Summary:
Pull Request resolved: facebook#38733

I was working under the assumption that Fabric fired layout events bottom up, but it actually fires them top-down, in constrast to Paper.

Previous invalidation logic wasn't quite correct when fired bottom-up. This corrects the logic by:
1. Deriving direction based on initial event ordering
2. Use last cached contentLength if we are on Fabric (top-down)
3. Use future contentLength if we are on Paper (bottom-up)

Changelog:
[General][Fixed] - Fixup contentLength invalidation logic

Reviewed By: rozele

Differential Revision: D47978638

fbshipit-source-id: e43e7f3479659ff7f5a4ea620464dad627fc1f03
NickGerleman and others added 3 commits August 4, 2023 10:37
Summary:
Returned measurements from the measurements cache in RTL calculate offset as distance from the left edge of the cell to the right edge of the content, when it should instead be the distance from the right edge of the cell (the logical beginning).

Changelog:
[General][Fixed] - Return right edge in RTL cell metrics

Differential Revision: D47978631

fbshipit-source-id: ac5101219b847c4c6ed7f83e2c9f573a09e7068f
Summary:
This fixes up behavior on Android so that `scrollToIndex` aligns the right edge of the cell of the given index to the right edge of the scrollview viewport. We do not incorporate RTL on iOS which inverts x/y coordinates from scroller (but not layout).

Changelog:
[General][Fixed] - Right align scrollToIndex in RTL

Differential Revision: D47978637

fbshipit-source-id: 0ec0235cb59917ce0d941c78210e9849d2311ae4
Summary:
Pull Request resolved: facebook#38733

I was working under the assumption that Fabric fired layout events bottom up, but it actually fires them top-down, in constrast to Paper.

Previous invalidation logic wasn't quite correct when fired bottom-up. This corrects the logic by:
1. Deriving direction based on initial event ordering
2. Use last cached contentLength if we are on Fabric (top-down)
3. Use future contentLength if we are on Paper (bottom-up)

Changelog:
[General][Fixed] - Fixup contentLength invalidation logic

Reviewed By: rozele

Differential Revision: D47978638

fbshipit-source-id: 8160b675dbb4946a394d7e5df7f3c4e04499c651
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D47978638

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Aug 4, 2023
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in ace0a80.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants