Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1670
Embeds to Yoga's documentation reuse a tiny rasterized favicon, blown up, and full of jpeg artifacts.
{F1714492025}
This bothered me enough to make the previews look better.
This change adds a quickly whipped up opengraph sized image, replaces the favicon with one derived from logo SVG, and fixes a missing description on the homepage.
{F1714566402}
Reviewed By: yungsters
Differential Revision: D58923501
fbshipit-source-id: 249a23034f50667e32970121a90eccc380e566a3
Summary:
X-link: https://github.com/facebook/react-native/pull/44938
Yoga is transitively included in Swift targets and needs to be modular.
Changelog: [Internal]
Reviewed By: NickGerleman
Differential Revision: D58469454
fbshipit-source-id: 72bc6b5d3e5ee0710d9334a626e4e7297ce26b09
Summary:
X-link: https://github.com/facebook/react-native/pull/44792
Pull Request resolved: https://github.com/facebook/yoga/pull/1663
Fixing https://github.com/facebook/yoga/issues/1658. We had a problem where if a child had a different flex direction than its parent, and it also set a position as a percent, it would look at the wrong axis to evaluate the percent. What was happening was we were passing in the container's mainAxis size and crossAxis size to use to evaluate the position size if it was a percent. However, we matched these sizes with the main/cross axis of the child - which is wrong if the flex direction is different.
I changed it so that the function just takes in ownerWidth and ownerHeight then calls isRow to determine which one to use for the main/cross axis position. This reduces the ambiguity quite a bit imo.
Changelog: [Internal]
Reviewed By: NickGerleman
Differential Revision: D58172416
fbshipit-source-id: eafd8069e03493fc56c41a76879d1ad9b7e9236d
Summary:
X-link: https://github.com/facebook/react-native/pull/44791
Pull Request resolved: https://github.com/facebook/yoga/pull/1662
This should fix https://github.com/facebook/yoga/issues/1657. Rather insidious bug but we had code like
```
// The total padding/border for a given axis does not depend on the direction
// so hardcoding LTR here to avoid piping direction to this function
return node->style().computeInlineStartPaddingAndBorder(
axis, Direction::LTR, widthSize) +
node->style().computeInlineEndPaddingAndBorder(
axis, Direction::LTR, widthSize);
```
That comment is NOT true if someone sets both the physical edge and relative edge. So like paddingLeft and paddingEnd for RTL. This diff simply pipes the direction to that spot to use instead of hardcoding LTR. Every file changed is just to pipe `direction`.
Changelog: [Internal]
Reviewed By: NickGerleman
Differential Revision: D58169843
fbshipit-source-id: 5b4854dddc019285076bd06955557edf73ef7ec5
Summary:
D57285584 was reverted because we have service code with a faulty measure function, and adding logging to Yoga when invalid measurements were received was enough to spike error rate to elevated levels and block release.
This is a reland of the below change, with a couple modifications:
1. We log warnings instead of errors, which from what I heard, shouldn't block release, but should still make signal
2. We only zero the dimension which was NaN, to preserve exact behavior
## Original
We've started seeing assertion failures in Yoga where a `NaN` value makes its way to an `availableHeight` constraint when measuring Litho tree.
Because it's only happening on Litho, I have some suspicion this might be originating from a Litho-specific measure function. This adds sanitization in Yoga to measure function results, where we will log an error, and set size to zero, if either dimension ends up being negative of `NaN`.
This doesn't really help track down where the error was happening, but Yoga doesn't have great context to show this to begin with. If we see this is issue, next steps would be Litho internal intrumentation to find culprit.
Changelog: [Internal]
Reviewed By: sbuggay
Differential Revision: D57473295
fbshipit-source-id: 979f1b9a51f5550a8d3ca534276ec191a3cb7b9e
Summary:
X-link: https://github.com/facebook/react-native/pull/44557
We've started seeing assertion failures in Yoga where a `NaN` value makes its way to an `availableHeight` constraint when measuring Litho tree.
Because it's only happening on Litho, I have some suspicion this might be originating from a Litho-specific measure function. This adds sanitization in Yoga to measure function results, where we will log an error, and set size to zero, if either dimension ends up being negative of `NaN`.
This doesn't really help track down where the error was happening, but Yoga doesn't have great context to show this to begin with. If we see this is issue, next steps would be Litho internal intrumentation to find culprit.
Changelog: [Internal]
Reviewed By: joevilches
Differential Revision: D57285584
fbshipit-source-id: 935fcdd28c05bbac0d73e1c7654ae11a74898537
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1648
Node made a breaking change in a security release for 18/20 where `spawn()` no longer loads `.bat` files by default. 69ffc6d50d. Execute command in shell.
Reviewed By: javache
Differential Revision: D56230965
fbshipit-source-id: 52e9bd8a76664bd07ea25b6355ac54fcb24cbb9a
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1645
Right now we publish Yoga by transforming in-place, and rewriting the entrypoint to point to the generated vanilla JavaScript.
It is nice to include the original source, e.g. so that users can use sourcemaps when debugging, but putting these files on top of each other has been causing problems, like https://github.com/facebook/yoga/issues/1637#issuecomment-2049099690
This changes the packaging step to instead put all the outputs into a "dist" folder, and point the package entrypoints there. We still include original source for sourcemap usage.
Reviewed By: yungsters
Differential Revision: D56093470
fbshipit-source-id: ecd52dddd9040294aae66747cf1fdf48c7f602e7
Summary:
X-link: https://github.com/facebook/react-native/pull/44010
Pull Request resolved: https://github.com/facebook/yoga/pull/1641
Yoga has quirk where newly constructed nodes are clean, which isn't really correct. Normally never shows in in real code because setting a style or children will dirty. Fabric doesn't use the public APIs that do this dirtying, so it ends up getting creative instead.
We should fix so that newly constructed nodes are dirty. Copy-constructed Nodes (also only a Fabric thing, will retain original dirty flag.
Changelog: [Internal]
Reviewed By: sammy-SC
Differential Revision: D55855328
fbshipit-source-id: be49efaf8ac29351f8e5ec509bd9912546944332
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1640
Added two captures that were captured from a mobile device.
**profile-ios**: A profile-like view with a central picture and some text information underneath. Captured on iOS device
**feed-android** A feed-like view with a scrollable list of images and text. Captured on Android device.
Fixed a bug that would not deserialize undefined values
Reviewed By: NickGerleman
Differential Revision: D55712235
fbshipit-source-id: ed32b393c088c695d8191149c729e51008df4e7e
Summary:
X-link: https://github.com/facebook/react-native/pull/43752
Gentest tests started failing because Chrome changed behavior of overflowed align-content container. Spec says should fallback to "safe center", which is really just "start", instead of previous "center" behavior. This changes behavior accordingly.
There is one bit where I think we are doing the wrong thing wrt alignment of flex start vs start (which we don't support yet), but couldn't repro a failing chrome test.
Changelog: [Internal]
Reviewed By: joevilches
Differential Revision: D55617689
fbshipit-source-id: 08f23d198c75f2c2f51ccaa8795289e6e4a92cb8
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1635
Accidentally set to May instead of March.
Differential Revision: D55286740
fbshipit-source-id: 260f15258b265a79a2017a57152f41e4d67b6a68
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1623
I copied these over from the default Docusaurus template but they don't add much value, and it is too heavy/irrelevant right now.
Before:
{F1468497789}
After:
{F1468497977}
Reviewed By: joevilches
Differential Revision: D54886187
fbshipit-source-id: c9ad11c59c7809d14c7a110e0ee2dd735505e28a
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1620
A couple of these are labeled as TypeScript. We expose TypeScript types, but this also works as plain-old JavaScript, and is the label we use in most of the documentaion.
Reviewed By: joevilches
Differential Revision: D54884484
fbshipit-source-id: 763c56843a797db0a4f78776c55397eaa9b4a966
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1622
Update the date, link to some documentation we added, small other tweaks for consistency.
Reviewed By: joevilches
Differential Revision: D54883806
fbshipit-source-id: f20a8f1aa51c1dfe1b205aa0a3b530ef5632ffd2
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1613
So that GitHub links to edit a page point to the right place.
This will fail in OSS build until I switch the directory used by Vercel instance, but I am waiting to do that until ready to land, since that would cause other in progress changes to fail when exported.
Reviewed By: joevilches
Differential Revision: D54837857
fbshipit-source-id: 9bec90232dbe3ec8638568685671185d597fcf2d
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1612
Moving new website to `/website` before publishing, so that edit links point to the right eventual place in the GitHub repo.
Reviewed By: joevilches
Differential Revision: D54837808
fbshipit-source-id: 46de8a638ad9bce18558fd768ed8c080892b828e
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1617
tsia, this was added recently and did not exist in the old docs
Reviewed By: yungsters
Differential Revision: D54830687
fbshipit-source-id: bbc7c833fdabe281367edeb0fbdc85960fe982fb
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1616
This is based on a few comments earlier in the stack and my own discretion on what should change. But I went through all of the examples and changed the following:
* Only add code tick marks in a few cases where it would make sense. Things like `start` and `end`, `undefined` as a value, etc. There ends up not being that many after this. Previously, any property or value was tick marked even if it was more of a concept than actual code. **I replaced those cases with a link to their respective documentation as I feel like this keeps the indication that this is a keyword without labeling it as code**.
* Any reference to "element" was changed to "node"
* Capitalize words that follow a colon
* Run code examples through prettier for consistent style
Reviewed By: yungsters
Differential Revision: D54816609
fbshipit-source-id: 20ee925cf46bd1c519cc88bab9327321e926ac56
Summary: Remove some outdated information and make sure that npmjs shows the builtin TypeScript typings (now that we no longer have clever resolution schemes).
Reviewed By: javache
Differential Revision: D54788636
fbshipit-source-id: 76e7663924189fd68ac62b27730f44213b13ad85
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1608
Fixes up layout when embedded into document, and removes the copy button taking more horizontal real estate than it is worth, when we want to show a horizontal playground at 75% width.
Before:
{F1467611957}
{F1467613069}
{F1467613795}
After:
{F1467611817}
{F1467612896}
{F1467613557}
Reviewed By: javache
Differential Revision: D54787261
fbshipit-source-id: 2177d896baf81971d1b979c060eecf51535de4c5
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1599
tsia. Had to add JS api support for set/get direction
Reviewed By: yungsters
Differential Revision: D54778992
fbshipit-source-id: 346152e1d61c80aa524b515e8b30a96fe32fe7c3