Uh oh!
There was an error while loading. Please reload this page.
feat: Add string support to the transform property - #34660
feat: Add string support to the transform property#34660gabrieldonadel wants to merge 4 commits into
Conversation
a9073f3 to
7484153Compare
Base commit: bfb36c2 |
Base commit: bfb36c2 |
facebook-github-bot
commented
Sep 12, 2022
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
facebook-github-bot
commented
Sep 15, 2022
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
| | {|+translateY: number | AnimatedNode|} | ||
| | {| | ||
| +translate: | ||
| | [number | AnimatedNode, number | AnimatedNode] |
There was a problem hiding this comment.
The tests for existing RN syntax include 3 args, but noticed that doesnt seem to be in the type def.
There was a problem hiding this comment.
Yeah, actually I couldn't find any reference to the translate param in the official docs https://reactnative.dev/docs/next/transforms#transform, maybe it's something used internally?
facebook-github-bot
commented
Sep 20, 2022
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
react-native-bot
commented
Sep 22, 2022
This pull request was successfully merged by @gabrieldonadel in 34db2d4. When will my fix make it into a release? | Upcoming Releases |
kelset
commented
Nov 9, 2022
@gabrieldonadel / @necolas I just tested in 0.71 branch and in RNTester, when I try to the test page, it crashes: |
gabrieldonadel
commented
Nov 9, 2022
@kelset seems that I forgot to update [0] on RN-Tester, gonna open a PR in few updating that to use |
acoates-ms
commented
Nov 9, 2022
I hit this when integrating 0.71 into react-native-windows. Our automation hit this crash, so I've had to manually disable this test page in our tests for now. The main thing I want to be sure of is that any transform value that was valid before this change is still valid. -- Maybe we want to enforce units on transforms going forward, but failures there should be yellowboxes not invariants during the transition period. Otherwise, it will be very hard for any package that wants to support multiple versions of RN. |
gabrieldonadel
commented
Nov 9, 2022
That shouldn't be a problem as we're only requiring units for string values, everything that was valid before is still going to be valid. |
gabrieldonadel
commented
Nov 9, 2022
Thanks for the report @kelset, I've just opened a PR fixing this #35292. This also fixes your problem @acoates-ms |
necolas
commented
Nov 9, 2022
Yes I think invalid values should be yellowboxes, mostly because soft failures with warnings are better for styling than crashes. But we still shouldn't allow invalid syntax/values to work as if it were valid |
Summary: As pointed out by kelset on #34660 (comment) accessing the `TransformExample` is currently crashing the `RNTester` app due to missing units in one of the transformers. This PR fixes it by updating the transform value to a valid string. ## Changelog [Internal] [Fixed] - Add missing translate units to `RNTester` `TransformExample` Pull Request resolved: #35292 Test Plan: 1. Open the RNTester app and navigate to the Transforms page 2. Check the transform style through the `Transform using a string` section https://user-images.githubusercontent.com/11707729/200916399-779b2eeb-2bd8-4642-97a3-f050d6dd4278.mov Reviewed By: christophpurrer Differential Revision: D41164541 Pulled By: necolas fbshipit-source-id: 4aa62980001a6f8ccf0108cb3af1e573b67e02b1

Summary
This updates the
transformproperty to support string values as requested on #34425. This also updates the existing unit tests of theprocessTransformfunction ensuring the style processing works as expected and updates the TransformExample on RNTester in order to facilitate the manual QA of this.Changelog
[General] [Added] - Add string support to the transform property
Test Plan
Transform using a stringsectionScreen.Recording.2022-09-11.at.18.57.17.mov