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

Unify platform behavior of processTransform #33579

Closed
wants to merge 4 commits into from

Conversation

acoates-ms
Copy link
Contributor

@acoates-ms acoates-ms commented Apr 6, 2022

Currently both iOS and Android send over the list of transforms as an array. But there is an if statement that causes other platforms to get a matrix. This prevents other platforms from being able to use the fabric ViewProps class and the conversion functions as they exist in core, as those expect the transforms to be an array.

Summary

Stop special casing iOS and android. - Which will allow for example Windows to be able to share more fabric code.

Changelog

[Internal] [Changed] - All platforms should get transform sent to native as an array of transform operations instead of a matrix

Test Plan

Similar change made in react-native-windows.
microsoft/react-native-windows#9797

@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: Microsoft Partner: Microsoft Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Apr 6, 2022
@analysis-bot
Copy link

analysis-bot commented Apr 6, 2022

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 7,826,119 -5,000
android hermes armeabi-v7a 7,216,983 -4,998
android hermes x86 8,138,731 -5,004
android hermes x86_64 8,117,247 -4,996
android jsc arm64-v8a 9,704,212 -2,642
android jsc armeabi-v7a 8,458,887 -2,633
android jsc x86 9,654,774 -2,643
android jsc x86_64 10,253,240 -2,643

Base commit: a21a1f8
Branch: main

@analysis-bot
Copy link

analysis-bot commented Apr 6, 2022

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: a21a1f8
Branch: main

@elicwhite
Copy link
Member

Does React Native Web need this code?

@acoates-ms
Copy link
Contributor Author

Ah, Is that the other platform? Was trying to work out why this if existed at all. -- Shouldn't that be something that react-native-web can change? This will likely be a change for many out of tree platforms. But I'd rather have the default match ios/android, and platforms can fork this code back if they want to maintain the old behavior or update their projection to native to handle the new format. As it stands, we have to fork the code to align with core, which seems like the wrong way around.

@ecreeth
Copy link
Contributor

ecreeth commented Apr 7, 2022

Does React Native Web need this code?

I couldn't find anything related in the react native web repository. They have their own implementation of the StyleSheet API. Much more now in the new version that is about to be deployed in necolas/react-native-web#2248

@ecreeth
Copy link
Contributor

ecreeth commented Jul 28, 2022

cc @cortinico

@cortinico
Copy link
Contributor

Can we get a rebase + have the CI green before we import/merge this @acoates-ms ?

@acoates-ms
Copy link
Contributor Author

@cortinico - Done.

@ecreeth
Copy link
Contributor

ecreeth commented Aug 9, 2022

It would be great if you could also remove the MatrixMath.js helper, it was only used by the processTransform.js

@facebook-github-bot
Copy link
Contributor

@cortinico has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @acoates-ms in ee33385.

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

@react-native-bot react-native-bot added the Merged This PR has been merged. label Aug 15, 2022
roryabraham pushed a commit to Expensify/react-native that referenced this pull request Aug 17, 2022
Summary:
Currently both iOS and Android send over the list of transforms as an array.   But there is an if statement that causes other platforms to get a matrix.  This prevents other platforms from being able to use the fabric ViewProps class and the conversion functions as they exist in core, as those expect the transforms to be an array.

Stop special casing iOS and android. - Which will allow for example Windows to be able to share more fabric code.

## Changelog

[Internal] [Changed] - All platforms should get transform sent to native as an array of transform operations instead of a matrix

Pull Request resolved: facebook#33579

Test Plan:
Similar change made in react-native-windows.
microsoft/react-native-windows#9797

Reviewed By: NickGerleman

Differential Revision: D38615676

Pulled By: cortinico

fbshipit-source-id: 8861afe6bf34bebb09dd82f7365faf007dd79cbf
roryabraham pushed a commit to Expensify/react-native that referenced this pull request Aug 17, 2022
Summary:
Currently both iOS and Android send over the list of transforms as an array.   But there is an if statement that causes other platforms to get a matrix.  This prevents other platforms from being able to use the fabric ViewProps class and the conversion functions as they exist in core, as those expect the transforms to be an array.

Stop special casing iOS and android. - Which will allow for example Windows to be able to share more fabric code.

## Changelog

[Internal] [Changed] - All platforms should get transform sent to native as an array of transform operations instead of a matrix

Pull Request resolved: facebook#33579

Test Plan:
Similar change made in react-native-windows.
microsoft/react-native-windows#9797

Reviewed By: NickGerleman

Differential Revision: D38615676

Pulled By: cortinico

fbshipit-source-id: 8861afe6bf34bebb09dd82f7365faf007dd79cbf
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. Merged This PR has been merged. p: Microsoft Partner: Microsoft Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants