Commit Graph

2527 Commits

Author SHA1 Message Date
admirsaheta
97a4d50191 update:yoga-caching-algorithm 2024-07-11 11:12:39 +02:00
Nick Gerleman
5009f5c1ac Fix misc-misplaced-const warnings in Yoga tests (#1677)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1677

We have Clang Tidy warnings enabled internally, that will flag `const YG*Ref` as misleading, as a const pointer to non-const, instead of non-const pointer to const.

Let's remove all the misleading const in existing tests, and generated tests.

Reviewed By: joevilches

Differential Revision: D59335968

fbshipit-source-id: c66af878904ba7900f8ffcd99162968d90f8e5c7
2024-07-03 17:30:10 -07:00
Andrew Coates
e4fe14ab3e Add config version, and invalidate layout on config change (#1674)
Summary:
X-link: https://github.com/facebook/react-native/pull/45259

This is a continuation of the previous PR: https://github.com/facebook/react-native/pull/45047

I made the change more generic for allowing any kind of config change to invalidate layout.

Changelog: [Internal]

Pull Request resolved: https://github.com/facebook/yoga/pull/1674

Reviewed By: rozele

Differential Revision: D59286992

Pulled By: NickGerleman

fbshipit-source-id: f46f35b03d5d9a743b798844ee3e1a02c271ccde
2024-07-03 12:46:18 -07:00
Joe Vilches
a1e9abb9b3 Fix case where absolute nodes would sometimes not be cloned (#1675)
Summary:
X-link: https://github.com/facebook/react-native/pull/45240

Pull Request resolved: https://github.com/facebook/yoga/pull/1675

There was a bug where some crash would happen if a tree was cloned that had static/absolute parent/child pair inside it. This was because we were no longer calling `cloneChildrenIfNeeded` on the static parent, but would still layout the absolute child. So that child's owner would be stale and have new layout. In React Native this would lead to a failed assert which causes the crash.

The fix here is to clone the children of static nodes during `layoutAbsoluteDescendants` so that we guarantee the node is either cloned if it is going to have new layout.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D59175629

fbshipit-source-id: 4d110a08ba5368704327d5ab69a8695b28e746f4
2024-07-02 15:14:33 -07:00
Nick Gerleman
b9e335ebfd Put generated Java tests in a "generated" folder (#1673)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1673

Separate the generated Java tests from the non-generated ones, like all the other tests.

Reviewed By: javache

Differential Revision: D58989535

fbshipit-source-id: 4ffe92d079acdf3ba24731f7f1ef1ae6eba97da5
2024-06-26 10:56:18 -07:00
Maddie Lord
1a3bc6bfbc Add test support for intrinsic sized nodes (#1671)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1671

This diff adds support for intrinsic sizing in generated tests. This is done by importing a testing font called "Ahem" which, as used, has an exact width and height of 10px for each character. Support has been added for C++, Java, and Javascript generated tests.

Reviewed By: NickGerleman

Differential Revision: D58307002

fbshipit-source-id: e1dcc1e03310d35a32e0c70f71994880d8f7de55
2024-06-26 10:00:17 -07:00
Nick Gerleman
0888b20098 Make gentest-validate more graceful of different file organization (#1672)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1672

`gentest-validate` checks signedsource for generated tests. D58307002 adds a new directory under `java/tests/com/facebook/yoga/`, which [confuses](https://github.com/facebook/yoga/actions/runs/9653979292/job/26627690870) the current directory traversal logic.

This replaces the traversal with `glob`, and makes us skip files without a signature, instead of special-casing the Java directory.

Reviewed By: yungsters

Differential Revision: D58987293

fbshipit-source-id: a5640f5faee4aa40879c266211c5e736a0b077be
2024-06-26 01:24:08 -07:00
Nick Gerleman
53e4421178 Yoga 3.1.0 Release Notes (#1669)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1669

I made a new branch and release of Yoga corresponding to the version used by RN 0.75. This documents the changes.

Reviewed By: christophpurrer, joevilches

Differential Revision: D58922338

fbshipit-source-id: 9c29f5c30cf1fb2d0bac6d5ba33cba4945d4e4f2
2024-06-25 23:27:25 -07:00
Nick Gerleman
db383714d3 Update to docusaurus 3.4.0 (#1668)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1668

Updates to latest Docusaurus

Reviewed By: christophpurrer

Differential Revision: D58921432

fbshipit-source-id: 45ce2fc2559b2321f72b77b2434c5dff395f1cb0
2024-06-24 08:07:45 -07:00
Nick Gerleman
7970b972e5 Update lockfile dependencies with CVEs (#1667)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1667

Fixes https://github.com/facebook/yoga/pull/1666
Fixes https://github.com/facebook/yoga/pull/1634
Fixes https://github.com/facebook/yoga/pull/1642
Fixes https://github.com/facebook/yoga/pull/1636

All of these are for local Docusaurus development... but... keep the repo health robots happy, and align with the newest versions of these constraints already used in fbsource.

Reviewed By: yungsters

Differential Revision: D58921369

fbshipit-source-id: 61fd8a869940543567278bc8a6e7c88ca9dd506c
2024-06-24 08:07:45 -07:00
Nick Gerleman
1f7faf4c61 Make documentation embeds less ugly (#1670)
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
2024-06-24 07:38:05 -07:00
Richard Howell
baf670e261 make yogaApple modular
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
2024-06-13 14:18:45 -07:00
Joe Vilches
289b62732b Fix issue with alternating flex direction and percent postions (#1663)
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
2024-06-10 18:25:19 -07:00
Joe Vilches
72b7e5b5cf Fix issue where % width would be wrong if physical and relative padding defined on parent (#1662)
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
2024-06-10 18:25:19 -07:00
Nick Gerleman
fb53cb7443 Reland: Sanitize measure function results
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
2024-05-17 19:12:13 -07:00
Gilad Bar
24f0c56cce Revert D57285584: Sanitize measure function results
Differential Revision:
D57285584

Original commit changeset: 935fcdd28c05

Original Phabricator Diff: D57285584

fbshipit-source-id: 3c5d7ccefd608885af4d6f08c0d1cd00553f1f34
2024-05-14 07:13:21 -07:00
Nick Gerleman
eb1ca8ec7a Sanitize measure function results
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
2024-05-13 17:12:49 -07:00
Joe Vilches
dc23284cf7 Add some tests for padding and border for absolute positioning (#1650)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1650

See https://github.com/facebook/yoga/issues/1436#issuecomment-2070877918

Reviewed By: NickGerleman

Differential Revision: D56478788

fbshipit-source-id: 94a552ed55eb4127eddc6c2018706661fff64093
2024-04-23 21:02:36 -07:00
Nick Gerleman
932361cdbf Fixup margin: auto and justification behavior for overflowed containers (#1646)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1646

X-link: https://github.com/facebook/react-native/pull/44069

Fixes https://github.com/facebook/yoga/issues/978

1. Don't allow auto margin spaces to become a negative length
2. Replicate fallback alignment behavior specified by box-alignment spec that we are using for align-content.

Reviewed By: joevilches

Differential Revision: D56091577

fbshipit-source-id: 3c02f81f969bb947cdc5c80b15faaa0b0d39c0c2
2024-04-17 21:50:55 -07:00
Nick Gerleman
c0239e338f Fix JS build on Windows (#1648)
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
2024-04-17 03:03:02 -07:00
Soe Lynn
cd4a1b8cf6 Implement Percentage support for gap styles (#1643)
Summary:
X-link: https://github.com/facebook/react-native/pull/44067

X-link: https://github.com/facebook/litho/pull/980

Pull Request resolved: https://github.com/facebook/yoga/pull/1643

Changelog [Internal]:
- Added percentage value for flex layout gap
- Wired up to pass proper available width and height to implement this feature

Reviewed By: NickGerleman

Differential Revision: D56002340

fbshipit-source-id: c0bc86ac70a1391f115c87da99c2ef411535f68b
2024-04-15 16:44:16 -07:00
Nick Gerleman
d4247d65c0 Don't run test validation off main branch (#1644)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1644

Because Chrome behaviors can change

Reviewed By: cortinico

Differential Revision: D56088135

fbshipit-source-id: 7f760786dde061df9af034368e2184117e6e6846
2024-04-15 10:43:25 -07:00
Nick Gerleman
617fd3a6b7 Isolate Distributed JavaScript (#1645)
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
2024-04-15 09:28:23 -07:00
Nick Gerleman
70de2da05f Make new nodes dirty by default (#1641)
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
2024-04-10 22:15:25 -07:00
Bela Bohlender
bbdd1afe59 Entry point without TLA for js package (#1638)
Summary:
Follow up on https://github.com/facebook/yoga/issues/1637

TLDR: tooling for TLA is not there yet; An additional entry point without top-level-await is appropriate

- adds ./load entry to js package
- uses .js file extensions to prevent requiring [allowImportingTsExtensions](https://www.typescriptlang.org/tsconfig#allowImportingTsExtensions)

Pull Request resolved: https://github.com/facebook/yoga/pull/1638

Reviewed By: joevilches

Differential Revision: D55614636

Pulled By: NickGerleman

fbshipit-source-id: 126a94aa68d22d32b938282cfa1a5059bb9df337
2024-04-08 12:04:08 -07:00
Joe Vilches
194f83dea5 Add mobile yoga tree captures (#1640)
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
2024-04-05 14:01:54 -07:00
Nick Gerleman
6f10656868 Update align-content handling of overflow
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
2024-04-02 04:47:09 -07:00
Nick Gerleman
f12d436314 Yoga Docs: Fix Yoga 3.0 Release Data (#1635)
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
2024-03-24 00:20:09 -07:00
Willson Haw
5cbc7b4f1c Add JavaScript bindings for YGHasNewLayout (#1631)
Summary:
Adds JavaScript bindings for YGHasNewLayout which introduces
two new node methods: `hasNewLayout()` and `markLayoutSeen()`.

Closes https://github.com/facebook/yoga/issues/681

Pull Request resolved: https://github.com/facebook/yoga/pull/1631

Reviewed By: joevilches

Differential Revision: D55213296

Pulled By: NickGerleman

fbshipit-source-id: 161288c3f54c2b82a6b2b842387916fe8713c2c9
2024-03-21 17:36:36 -07:00
Bruce Mitchener
9dcd8ba9dc Fix typos. (#1629)
Summary:
This fixes a variety of spelling mistakes in file names, identifiers, and comments.

Pull Request resolved: https://github.com/facebook/yoga/pull/1629

Reviewed By: NickGerleman

Differential Revision: D54987359

Pulled By: yungsters

fbshipit-source-id: 6b7ca20f4855f5f654036672bc10f8b079288acd
2024-03-19 02:52:40 -07:00
Nick Gerleman
6ef7be293a Fix some dependency warnings (#1628)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1628

Fixes https://github.com/facebook/yoga/pull/1627

Fixes https://github.com/facebook/yoga/pull/1584

Reviewed By: yungsters

Differential Revision: D54924246

fbshipit-source-id: 4fa9f3b5b03d4277f1ec48f6d4d97a0cca5c6d7e
2024-03-15 01:52:20 -07:00
Nick Gerleman
c54e0e7fed Yoga Docs: Remove Footer Links (#1623)
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
2024-03-14 11:10:50 -07:00
Nick Gerleman
3c7ac064ad Yoga Docs: Label All JS/TS examples as JavaScript (#1620)
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
2024-03-14 11:10:50 -07:00
Nick Gerleman
522a2bfbef Yoga Docs: Fix a couple files missed in rename (#1621)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1621

These changes accidentally got removed when rebasing.

Reviewed By: joevilches

Differential Revision: D54884103

fbshipit-source-id: d2b6562be1a05934b5f19e3dd6f9e8e451377560
2024-03-14 11:10:50 -07:00
Nick Gerleman
4d3f323fa5 Yoga Docs: tweak Yoga 3.0 Relase Notes (#1622)
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
2024-03-14 11:10:50 -07:00
Nick Gerleman
206b95aba5 Yoga Docs: Rename website-next to website (#1613)
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
2024-03-13 17:25:39 -07:00
Nick Gerleman
108c2f30a2 Yoga Docs: Delete the Old website (#1612)
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
2024-03-13 15:53:21 -07:00
Nick Gerleman
d7faf2c101 Yoga Docs: Remove background color from playground section (#1611)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1611

Make it consistent everywhere

Before:
 {F1468059137}

After:
{F1468058347}

Reviewed By: joevilches

Differential Revision: D54835823

fbshipit-source-id: 87a7df758dc335861a3611d79aa6c8aef79ae9fa
2024-03-13 15:53:21 -07:00
Nick Gerleman
dfedfacd27 Yoga Docs: Fill out information about config, measure functions, incremental layout, box sizing, invalidation (#1610)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1610

Filling out a bunch more content.

 {F1468059666}

 {F1468059812}

 {F1468059886}

Reviewed By: joevilches

Differential Revision: D54831358

fbshipit-source-id: 0a988bcb7f32d4af8cc1803235ef529864176ddf
2024-03-13 15:53:21 -07:00
Joe Vilches
cafffebbe3 Add gap documentation (#1619)
Summary: Pull Request resolved: https://github.com/facebook/yoga/pull/1619

Reviewed By: NickGerleman

Differential Revision: D54859536

fbshipit-source-id: 8d351379bf6da936678bee22b208f7b6f5d161b8
2024-03-13 14:07:44 -07:00
Joe Vilches
281563501f Add documentation for space evenly in align content (#1617)
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
2024-03-13 14:07:44 -07:00
Joe Vilches
20e05881a8 Add insets documentation (#1618)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1618

tsia

Reviewed By: NickGerleman

Differential Revision: D54830359

fbshipit-source-id: 999a7fa3659b41ae532dd00e5df739e91f23905b
2024-03-13 14:07:44 -07:00
Joe Vilches
609a9a7a30 Add containing block documentation (#1615)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1615

tsia

Reviewed By: yungsters

Differential Revision: D54822992

fbshipit-source-id: b98cd32bb2a753ff7088533fda4b4e9d4ad5a6e4
2024-03-13 10:19:30 -07:00
Joe Vilches
1db7a3ff61 Clean up certain style choices on website's example documentation (#1616)
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
2024-03-13 10:19:30 -07:00
Nick Gerleman
f4facf8990 Fixup npm package README
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
2024-03-12 16:35:42 -07:00
Nick Gerleman
d1c6b9af78 Yoga Website: Tweak Playground visuals for embedding (#1608)
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
2024-03-12 15:17:57 -07:00
Nick Gerleman
066e366246 Fill out "About Yoga", "Laying out a Yoga tree" , and "Styling" (#1591)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1591

Adds initial documentation to these sections.

Reviewed By: joevilches

Differential Revision: D54708141

fbshipit-source-id: b2c1ac20573840833a3e5fde8c7b53f2770cecbd
2024-03-12 15:17:57 -07:00
Joe Vilches
a0a09b4570 Add flex basis grow shrink documentation (#1607)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1607

tsia

Reviewed By: yungsters

Differential Revision: D54783674

fbshipit-source-id: 95530db0b129d8f0fb3e677430b9bfbf0662f590
2024-03-12 11:31:46 -07:00
Joe Vilches
25f94f8bfb Add align items self documentation (#1606)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1606

tsia

Reviewed By: yungsters

Differential Revision: D54783193

fbshipit-source-id: 66d5d58eefec827024b2e029be7cbee637c5484e
2024-03-12 11:31:46 -07:00
Joe Vilches
389e715257 Add align content documentation (#1605)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1605

tsia

Reviewed By: yungsters

Differential Revision: D54782553

fbshipit-source-id: a65aaa754ea98a8dfe3b581a7cdb06dddf35f64a
2024-03-12 11:31:46 -07:00