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

Support passing in children directly when cloning nodes #39817

Closed
wants to merge 1 commit into from

Conversation

javache
Copy link
Member

@javache javache commented Oct 4, 2023

Update the UIManagerBinding interface to support the upcoming API changes in facebook/react#27458

Changelog: [Internal]

Differential Revision: D49912532

@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 Oct 4, 2023
@facebook-github-bot
Copy link
Contributor

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

@analysis-bot
Copy link

analysis-bot commented Oct 4, 2023

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 17,231,396 +4,109
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 20,599,506 +4,096
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: 1719a07
Branch: main

@facebook-github-bot
Copy link
Contributor

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

javache added a commit to javache/react-native that referenced this pull request Oct 5, 2023
Summary:
Update the UIManagerBinding interface to support the upcoming API changes in facebook/react#27458

Changelog: [Internal]


Differential Revision: D49912532
@facebook-github-bot
Copy link
Contributor

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

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

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

javache added a commit to javache/react-native that referenced this pull request Oct 6, 2023
Summary:
Update the UIManagerBinding interface to support the upcoming API changes in facebook/react#27458

Changelog: [Internal]


Reviewed By: rubennorte, sammy-SC

Differential Revision: D49912532
@javache javache force-pushed the export-D49912532 branch 2 times, most recently from 8e7abcd to 5261097 Compare October 6, 2023 12:22
javache added a commit to javache/react-native that referenced this pull request Oct 6, 2023
Summary:
Update the UIManagerBinding interface to support the upcoming API changes in facebook/react#27458

Changelog: [Internal]


Reviewed By: rubennorte, sammy-SC

Differential Revision: D49912532
@facebook-github-bot
Copy link
Contributor

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

javache added a commit to javache/react-native that referenced this pull request Oct 6, 2023
Summary:
Update the UIManagerBinding interface to support the upcoming API changes in facebook/react#27458

Changelog: [Internal]


Reviewed By: rubennorte, sammy-SC

Differential Revision: D49912532
javache added a commit to javache/react-native that referenced this pull request Oct 6, 2023
Summary:
Update the UIManagerBinding interface to support the upcoming API changes in facebook/react#27458

Changelog: [Internal]


Reviewed By: rubennorte, sammy-SC

Differential Revision: D49912532
@facebook-github-bot
Copy link
Contributor

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

javache added a commit to javache/react-native that referenced this pull request Oct 6, 2023
Summary:
Update the UIManagerBinding interface to support the upcoming API changes in facebook/react#27458

Changelog: [Internal]


Reviewed By: rubennorte, sammy-SC

Differential Revision: D49912532
@facebook-github-bot
Copy link
Contributor

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

javache added a commit to javache/react-native that referenced this pull request Oct 6, 2023
Summary:
Update the UIManagerBinding interface to support the upcoming API changes in facebook/react#27458

Changelog: [Internal]


Reviewed By: rubennorte, sammy-SC

Differential Revision: D49912532
@facebook-github-bot
Copy link
Contributor

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

Summary:
Update the UIManagerBinding interface to support the upcoming API changes in facebook/react#27458

Changelog: [Internal]


Reviewed By: rubennorte, sammy-SC

Differential Revision: D49912532
@facebook-github-bot
Copy link
Contributor

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

@github-actions
Copy link

github-actions bot commented Oct 6, 2023

This pull request was successfully merged by @javache in 239079e.

When will my fix make it into a release? | Upcoming Releases

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

This pull request has been merged in 239079e.

@javache javache deleted the export-D49912532 branch October 6, 2023 15:15
javache added a commit to facebook/react that referenced this pull request Oct 10, 2023
## Summary

Currently when cloning nodes in Fabric, we reset a node's children on
each clone, and then repeatedly call appendChild to restore the previous
list of children (even if it was quasi-identical to before). This causes
unnecessary invalidation of the layout state in Fabric's ShadowNode data
(which in turn may require additional yoga clones) and extra JSI calls.

This PR adds a feature flag to pass in the children as part of the clone
call, so Fabric always has a complete view of the node that's being
mutated.

This feature flag requires matching changes in the react-native repo:
facebook/react-native#39817

## How did you test this change?

Unit test added demonstrates the new behaviour 

```
yarn test -r www-modern ReactFabric-test
yarn test ReactFabric-test.internal
```

Tested a manual sync into React Native and verified core surfaces render
correctly.
github-actions bot pushed a commit to facebook/react that referenced this pull request Oct 10, 2023
## Summary

Currently when cloning nodes in Fabric, we reset a node's children on
each clone, and then repeatedly call appendChild to restore the previous
list of children (even if it was quasi-identical to before). This causes
unnecessary invalidation of the layout state in Fabric's ShadowNode data
(which in turn may require additional yoga clones) and extra JSI calls.

This PR adds a feature flag to pass in the children as part of the clone
call, so Fabric always has a complete view of the node that's being
mutated.

This feature flag requires matching changes in the react-native repo:
facebook/react-native#39817

## How did you test this change?

Unit test added demonstrates the new behaviour

```
yarn test -r www-modern ReactFabric-test
yarn test ReactFabric-test.internal
```

Tested a manual sync into React Native and verified core surfaces render
correctly.

DiffTrain build for [151e75a](151e75a)
alunyov pushed a commit to alunyov/react that referenced this pull request Oct 11, 2023
## Summary

Currently when cloning nodes in Fabric, we reset a node's children on
each clone, and then repeatedly call appendChild to restore the previous
list of children (even if it was quasi-identical to before). This causes
unnecessary invalidation of the layout state in Fabric's ShadowNode data
(which in turn may require additional yoga clones) and extra JSI calls.

This PR adds a feature flag to pass in the children as part of the clone
call, so Fabric always has a complete view of the node that's being
mutated.

This feature flag requires matching changes in the react-native repo:
facebook/react-native#39817

## How did you test this change?

Unit test added demonstrates the new behaviour 

```
yarn test -r www-modern ReactFabric-test
yarn test ReactFabric-test.internal
```

Tested a manual sync into React Native and verified core surfaces render
correctly.
jerrydev0927 added a commit to jerrydev0927/react that referenced this pull request Jan 5, 2024
## Summary

Currently when cloning nodes in Fabric, we reset a node's children on
each clone, and then repeatedly call appendChild to restore the previous
list of children (even if it was quasi-identical to before). This causes
unnecessary invalidation of the layout state in Fabric's ShadowNode data
(which in turn may require additional yoga clones) and extra JSI calls.

This PR adds a feature flag to pass in the children as part of the clone
call, so Fabric always has a complete view of the node that's being
mutated.

This feature flag requires matching changes in the react-native repo:
facebook/react-native#39817

## How did you test this change?

Unit test added demonstrates the new behaviour

```
yarn test -r www-modern ReactFabric-test
yarn test ReactFabric-test.internal
```

Tested a manual sync into React Native and verified core surfaces render
correctly.

DiffTrain build for [151e75a128d0fd436dce365335b96c5686f704d4](facebook/react@151e75a)
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
## Summary

Currently when cloning nodes in Fabric, we reset a node's children on
each clone, and then repeatedly call appendChild to restore the previous
list of children (even if it was quasi-identical to before). This causes
unnecessary invalidation of the layout state in Fabric's ShadowNode data
(which in turn may require additional yoga clones) and extra JSI calls.

This PR adds a feature flag to pass in the children as part of the clone
call, so Fabric always has a complete view of the node that's being
mutated.

This feature flag requires matching changes in the react-native repo:
facebook/react-native#39817

## How did you test this change?

Unit test added demonstrates the new behaviour 

```
yarn test -r www-modern ReactFabric-test
yarn test ReactFabric-test.internal
```

Tested a manual sync into React Native and verified core surfaces render
correctly.
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