Skip to content

Introduce getDiffProps for <View> (#45552) #64

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
merged 1 commit into from
May 14, 2025

Conversation

hannomargelo
Copy link

TL;DR

This cherry-picks this PR on top of our RN 0.78 branch to fix some rendering issues happening on new arch:

Details

When using FlashList with new arch on our RN 0.78 build we were seeing weird layout bugs:

after testing we found that on RN 0.79 these issues don't happen. I ran a bisect and found that this commit fixes the issue.

Weird details

Now, its odd that this commit is fixing the issue, as the function getDiffProps is nowhere called during runtime! (There is one call site in android/FabricMountingManager.cpp but thats behind a feature flag that is false).

My best assumption is that in release mode (the only place where the bug happens) some optimization flags are applied which cause some corruption (messing with the vtable as this is a virtual function?). In debug those flags aren't applied and so the bug doesn't happen.

Summary:
Pull Request resolved: facebook#45552

In this diff I'm overriding the getDiffProps for  ViewProps.
The goal is to verify what's the impact of calculating diffs of props in Android, starting with ViewProps.
Once we verify what are the implication we will automatic implement this diffing.

The full implementation of this method will be implemented in the following diffs

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D59969328

fbshipit-source-id: ce141528581e46e9ced4175dca040ddf8bed5ddb
@hannomargelo hannomargelo merged commit 0599a89 into 0.78.0-discord May 14, 2025
4 of 8 checks passed
@fabOnReact
Copy link

fabOnReact commented May 20, 2025

It's related to PR #61, which enables the feature flag (only on the new arch).

bdbaraban pushed a commit that referenced this pull request May 22, 2025
Summary:
Pull Request resolved: facebook#45552

In this diff I'm overriding the getDiffProps for  ViewProps.
The goal is to verify what's the impact of calculating diffs of props in Android, starting with ViewProps.
Once we verify what are the implication we will automatic implement this diffing.

The full implementation of this method will be implemented in the following diffs

changelog: [internal] internal

Reviewed By: NickGerleman

Differential Revision: D59969328

fbshipit-source-id: ce141528581e46e9ced4175dca040ddf8bed5ddb

Co-authored-by: David Vacca <dvacca@meta.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants