Skip to content

Update NativeModule documentation to show correct event emitter usage - #1894

Merged
brentvatne merged 1 commit into
react:masterfrom
colinramsay:patch-1
Jul 7, 2015
Merged

brentvatne merged 1 commit into
react:masterfrom
colinramsay:patch-1

Conversation

@colinramsay

Copy link
Copy Markdown
Contributor

It looks like in the various changes to native module events, the documentation has become a little confused. As far as I can tell, if you use sendAppEventWithName then the NativeAppEventEmitter is used and if sendDeviceEventWithName then it should be DeviceEventEmitter.

It looks like in the various changes to native module events, the documentation has become a little confused. As far as I can tell, if you use `sendAppEventWithName` then the `NativeAppEventEmitter` is used and if `sendDeviceEventWithName` then it should be `DeviceEventEmitter`.
@facebook-github-bot facebook-github-bot added GH Review: review-needed CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels Jul 7, 2015
@brentvatne

Copy link
Copy Markdown
Collaborator

Thanks @colinramsay!

brentvatne added a commit that referenced this pull request Jul 7, 2015
Update NativeModule documentation to show correct event emitter usage
@brentvatne
brentvatne merged commit c27defe into react:master Jul 7, 2015
ide-agent pushed a commit to expo/react-native that referenced this pull request Aug 17, 2026
…pstream)

Grid lanes (css-grid-3) is defined on top of Grid's track sizing algorithm:
it imports <track-size>, minmax(), fr, repeat(), auto-fill/auto-fit and
line placement from css-grid-2 by name. That algorithm does not exist in
our tree — PR 1/9 of the upstream series landed the style types
(GridTrackSize, GridLine, gridTemplateColumns/Rows) but not the algorithm
behind them.

Rather than write a second one-axis track sizer, vendor the upstream
implementation verbatim:

  react/yoga#1894 "CSS Grid 2/9: Grid layout algorithm"
  by Nishan Bende (intergalacticspacehighway), open since 2026-02-25

  algorithm/grid/AutoPlacement.h   css-grid-1 §8.5 auto-placement
  algorithm/grid/GridLayout.{h,cpp} entry point, implicit tracks
  algorithm/grid/GridTrack.h        per-track layout state
  algorithm/grid/TrackSizing.h      css-grid-2 §12 track sizing

TrackSizing is parameterized by Dimension — it runs per axis — which is
exactly the shape grid lanes needs, since lanes sizes tracks in the grid
axis only and flows content in the other.

Not our code: nothing in algorithm/grid/ is modified, so that directory
can be deleted wholesale and replaced when the upstream series lands
instead of being merged. Only the integration points are ours, and only
because the PR could not supply them — our CalculateLayout.cpp has
diverged (block formatting contexts) and our Yoga is 197 commits behind:

  - CalculateLayout.cpp: the Display::Grid dispatch, next to Display::Block
  - yoga/CMakeLists.txt: an explicit algorithm/grid/*.cpp glob, since
    CMake's ** matches one level; Android builds through this same file
    and iOS globs recursively via the podspec

The PR's YGNodeStyle.cpp hunk is deliberately omitted: it adds a fallback
return to silence GCC -Wreturn-type, and our tree already handles those
switches better with fatalWithMessage("Unknown YGGridTrackType").

Verified, not assumed: verify-grid-vendor.sh builds yogacore with the
vendored directory and lays out

  display: grid; width: 600px; gap: 10px;
  grid-template-columns: 100px 1fr 2fr; grid-template-rows: 50px auto;

comparing every coordinate against the same CSS rendered by real Safari
(grid-vendor-verify.html, read via safaridriver). 25/25 values match
exactly, including fr distribution (160/320 of 480 remaining) and the
auto row resolving to its tallest item.

Upstream status: react#1894 is being re-split after review — react#1923 (data
structures) and react#1994 (auto-placement) are open, but the track-sizing
split has not been posted, which is why this vendors the original PR.
See algorithm/grid/README-VENDORED.md.

Co-authored-by: ide <379606+ide@users.noreply.github.com>
ide-agent pushed a commit to expo/react-native that referenced this pull request Aug 17, 2026
…pstream)

Grid lanes (css-grid-3) is defined on top of Grid's track sizing algorithm:
it imports <track-size>, minmax(), fr, repeat(), auto-fill/auto-fit and
line placement from css-grid-2 by name. That algorithm does not exist in
our tree — PR 1/9 of the upstream series landed the style types
(GridTrackSize, GridLine, gridTemplateColumns/Rows) but not the algorithm
behind them.

Rather than write a second one-axis track sizer, vendor the upstream
implementation verbatim:

  react/yoga#1894 "CSS Grid 2/9: Grid layout algorithm"
  by Nishan Bende (intergalacticspacehighway), open since 2026-02-25

  algorithm/grid/AutoPlacement.h   css-grid-1 §8.5 auto-placement
  algorithm/grid/GridLayout.{h,cpp} entry point, implicit tracks
  algorithm/grid/GridTrack.h        per-track layout state
  algorithm/grid/TrackSizing.h      css-grid-2 §12 track sizing

TrackSizing is parameterized by Dimension — it runs per axis — which is
exactly the shape grid lanes needs, since lanes sizes tracks in the grid
axis only and flows content in the other.

Not our code: nothing in algorithm/grid/ is modified, so that directory
can be deleted wholesale and replaced when the upstream series lands
instead of being merged. Only the integration points are ours, and only
because the PR could not supply them — our CalculateLayout.cpp has
diverged (block formatting contexts) and our Yoga is 197 commits behind:

  - CalculateLayout.cpp: the Display::Grid dispatch, next to Display::Block
  - yoga/CMakeLists.txt: an explicit algorithm/grid/*.cpp glob, since
    CMake's ** matches one level; Android builds through this same file
    and iOS globs recursively via the podspec

The PR's YGNodeStyle.cpp hunk is deliberately omitted: it adds a fallback
return to silence GCC -Wreturn-type, and our tree already handles those
switches better with fatalWithMessage("Unknown YGGridTrackType").

Verified, not assumed: verify-grid-vendor.sh builds yogacore with the
vendored directory and lays out

  display: grid; width: 600px; gap: 10px;
  grid-template-columns: 100px 1fr 2fr; grid-template-rows: 50px auto;

comparing every coordinate against the same CSS rendered by real Safari
(grid-vendor-verify.html, read via safaridriver). 25/25 values match
exactly, including fr distribution (160/320 of 480 remaining) and the
auto row resolving to its tallest item.

Upstream status: react#1894 is being re-split after review — react#1923 (data
structures) and react#1994 (auto-placement) are open, but the track-sizing
split has not been posted, which is why this vendors the original PR.
See algorithm/grid/README-VENDORED.md.

Co-authored-by: ide <379606+ide@users.noreply.github.com>
ide-agent pushed a commit to expo/react-native that referenced this pull request Aug 17, 2026
…pstream)

Grid lanes (css-grid-3) is defined on top of Grid's track sizing algorithm:
it imports <track-size>, minmax(), fr, repeat(), auto-fill/auto-fit and
line placement from css-grid-2 by name. That algorithm does not exist in
our tree — PR 1/9 of the upstream series landed the style types
(GridTrackSize, GridLine, gridTemplateColumns/Rows) but not the algorithm
behind them.

Rather than write a second one-axis track sizer, vendor the upstream
implementation verbatim:

  react/yoga#1894 "CSS Grid 2/9: Grid layout algorithm"
  by Nishan Bende (intergalacticspacehighway), open since 2026-02-25

  algorithm/grid/AutoPlacement.h   css-grid-1 §8.5 auto-placement
  algorithm/grid/GridLayout.{h,cpp} entry point, implicit tracks
  algorithm/grid/GridTrack.h        per-track layout state
  algorithm/grid/TrackSizing.h      css-grid-2 §12 track sizing

TrackSizing is parameterized by Dimension — it runs per axis — which is
exactly the shape grid lanes needs, since lanes sizes tracks in the grid
axis only and flows content in the other.

Not our code: nothing in algorithm/grid/ is modified, so that directory
can be deleted wholesale and replaced when the upstream series lands
instead of being merged. Only the integration points are ours, and only
because the PR could not supply them — our CalculateLayout.cpp has
diverged (block formatting contexts) and our Yoga is 197 commits behind:

  - CalculateLayout.cpp: the Display::Grid dispatch, next to Display::Block
  - yoga/CMakeLists.txt: an explicit algorithm/grid/*.cpp glob, since
    CMake's ** matches one level; Android builds through this same file
    and iOS globs recursively via the podspec

The PR's YGNodeStyle.cpp hunk is deliberately omitted: it adds a fallback
return to silence GCC -Wreturn-type, and our tree already handles those
switches better with fatalWithMessage("Unknown YGGridTrackType").

Verified, not assumed: verify-grid-vendor.sh builds yogacore with the
vendored directory and lays out

  display: grid; width: 600px; gap: 10px;
  grid-template-columns: 100px 1fr 2fr; grid-template-rows: 50px auto;

comparing every coordinate against the same CSS rendered by real Safari
(grid-vendor-verify.html, read via safaridriver). 25/25 values match
exactly, including fr distribution (160/320 of 480 remaining) and the
auto row resolving to its tallest item.

Upstream status: react#1894 is being re-split after review — react#1923 (data
structures) and react#1994 (auto-placement) are open, but the track-sizing
split has not been posted, which is why this vendors the original PR.
See algorithm/grid/README-VENDORED.md.

Co-authored-by: ide <379606+ide@users.noreply.github.com>
ide-agent pushed a commit to expo/react-native that referenced this pull request Aug 17, 2026
…pstream)

Grid lanes (css-grid-3) is defined on top of Grid's track sizing algorithm:
it imports <track-size>, minmax(), fr, repeat(), auto-fill/auto-fit and
line placement from css-grid-2 by name. That algorithm does not exist in
our tree — PR 1/9 of the upstream series landed the style types
(GridTrackSize, GridLine, gridTemplateColumns/Rows) but not the algorithm
behind them.

Rather than write a second one-axis track sizer, vendor the upstream
implementation verbatim:

  react/yoga#1894 "CSS Grid 2/9: Grid layout algorithm"
  by Nishan Bende (intergalacticspacehighway), open since 2026-02-25

  algorithm/grid/AutoPlacement.h   css-grid-1 §8.5 auto-placement
  algorithm/grid/GridLayout.{h,cpp} entry point, implicit tracks
  algorithm/grid/GridTrack.h        per-track layout state
  algorithm/grid/TrackSizing.h      css-grid-2 §12 track sizing

TrackSizing is parameterized by Dimension — it runs per axis — which is
exactly the shape grid lanes needs, since lanes sizes tracks in the grid
axis only and flows content in the other.

Not our code: nothing in algorithm/grid/ is modified, so that directory
can be deleted wholesale and replaced when the upstream series lands
instead of being merged. Only the integration points are ours, and only
because the PR could not supply them — our CalculateLayout.cpp has
diverged (block formatting contexts) and our Yoga is 197 commits behind:

  - CalculateLayout.cpp: the Display::Grid dispatch, next to Display::Block
  - yoga/CMakeLists.txt: an explicit algorithm/grid/*.cpp glob, since
    CMake's ** matches one level; Android builds through this same file
    and iOS globs recursively via the podspec

The PR's YGNodeStyle.cpp hunk is deliberately omitted: it adds a fallback
return to silence GCC -Wreturn-type, and our tree already handles those
switches better with fatalWithMessage("Unknown YGGridTrackType").

Verified, not assumed: verify-grid-vendor.sh builds yogacore with the
vendored directory and lays out

  display: grid; width: 600px; gap: 10px;
  grid-template-columns: 100px 1fr 2fr; grid-template-rows: 50px auto;

comparing every coordinate against the same CSS rendered by real Safari
(grid-vendor-verify.html, read via safaridriver). 25/25 values match
exactly, including fr distribution (160/320 of 480 remaining) and the
auto row resolving to its tallest item.

Upstream status: react#1894 is being re-split after review — react#1923 (data
structures) and react#1994 (auto-placement) are open, but the track-sizing
split has not been posted, which is why this vendors the original PR.
See algorithm/grid/README-VENDORED.md.

Co-authored-by: ide <379606+ide@users.noreply.github.com>
ide-agent pushed a commit to expo/react-native that referenced this pull request Aug 17, 2026
…pstream)

Grid lanes (css-grid-3) is defined on top of Grid's track sizing algorithm:
it imports <track-size>, minmax(), fr, repeat(), auto-fill/auto-fit and
line placement from css-grid-2 by name. That algorithm does not exist in
our tree — PR 1/9 of the upstream series landed the style types
(GridTrackSize, GridLine, gridTemplateColumns/Rows) but not the algorithm
behind them.

Rather than write a second one-axis track sizer, vendor the upstream
implementation verbatim:

  react/yoga#1894 "CSS Grid 2/9: Grid layout algorithm"
  by Nishan Bende (intergalacticspacehighway), open since 2026-02-25

  algorithm/grid/AutoPlacement.h   css-grid-1 §8.5 auto-placement
  algorithm/grid/GridLayout.{h,cpp} entry point, implicit tracks
  algorithm/grid/GridTrack.h        per-track layout state
  algorithm/grid/TrackSizing.h      css-grid-2 §12 track sizing

TrackSizing is parameterized by Dimension — it runs per axis — which is
exactly the shape grid lanes needs, since lanes sizes tracks in the grid
axis only and flows content in the other.

Not our code: nothing in algorithm/grid/ is modified, so that directory
can be deleted wholesale and replaced when the upstream series lands
instead of being merged. Only the integration points are ours, and only
because the PR could not supply them — our CalculateLayout.cpp has
diverged (block formatting contexts) and our Yoga is 197 commits behind:

  - CalculateLayout.cpp: the Display::Grid dispatch, next to Display::Block
  - yoga/CMakeLists.txt: an explicit algorithm/grid/*.cpp glob, since
    CMake's ** matches one level; Android builds through this same file
    and iOS globs recursively via the podspec

The PR's YGNodeStyle.cpp hunk is deliberately omitted: it adds a fallback
return to silence GCC -Wreturn-type, and our tree already handles those
switches better with fatalWithMessage("Unknown YGGridTrackType").

Verified, not assumed: verify-grid-vendor.sh builds yogacore with the
vendored directory and lays out

  display: grid; width: 600px; gap: 10px;
  grid-template-columns: 100px 1fr 2fr; grid-template-rows: 50px auto;

comparing every coordinate against the same CSS rendered by real Safari
(grid-vendor-verify.html, read via safaridriver). 25/25 values match
exactly, including fr distribution (160/320 of 480 remaining) and the
auto row resolving to its tallest item.

Upstream status: react#1894 is being re-split after review — react#1923 (data
structures) and react#1994 (auto-placement) are open, but the track-sizing
split has not been posted, which is why this vendors the original PR.
See algorithm/grid/README-VENDORED.md.

Co-authored-by: ide <379606+ide@users.noreply.github.com>
ide-agent pushed a commit to expo/react-native that referenced this pull request Aug 17, 2026
…pstream)

Grid lanes (css-grid-3) is defined on top of Grid's track sizing algorithm:
it imports <track-size>, minmax(), fr, repeat(), auto-fill/auto-fit and
line placement from css-grid-2 by name. That algorithm does not exist in
our tree — PR 1/9 of the upstream series landed the style types
(GridTrackSize, GridLine, gridTemplateColumns/Rows) but not the algorithm
behind them.

Rather than write a second one-axis track sizer, vendor the upstream
implementation verbatim:

  react/yoga#1894 "CSS Grid 2/9: Grid layout algorithm"
  by Nishan Bende (intergalacticspacehighway), open since 2026-02-25

  algorithm/grid/AutoPlacement.h   css-grid-1 §8.5 auto-placement
  algorithm/grid/GridLayout.{h,cpp} entry point, implicit tracks
  algorithm/grid/GridTrack.h        per-track layout state
  algorithm/grid/TrackSizing.h      css-grid-2 §12 track sizing

TrackSizing is parameterized by Dimension — it runs per axis — which is
exactly the shape grid lanes needs, since lanes sizes tracks in the grid
axis only and flows content in the other.

Not our code: nothing in algorithm/grid/ is modified, so that directory
can be deleted wholesale and replaced when the upstream series lands
instead of being merged. Only the integration points are ours, and only
because the PR could not supply them — our CalculateLayout.cpp has
diverged (block formatting contexts) and our Yoga is 197 commits behind:

  - CalculateLayout.cpp: the Display::Grid dispatch, next to Display::Block
  - yoga/CMakeLists.txt: an explicit algorithm/grid/*.cpp glob, since
    CMake's ** matches one level; Android builds through this same file
    and iOS globs recursively via the podspec

The PR's YGNodeStyle.cpp hunk is deliberately omitted: it adds a fallback
return to silence GCC -Wreturn-type, and our tree already handles those
switches better with fatalWithMessage("Unknown YGGridTrackType").

Verified, not assumed: verify-grid-vendor.sh builds yogacore with the
vendored directory and lays out

  display: grid; width: 600px; gap: 10px;
  grid-template-columns: 100px 1fr 2fr; grid-template-rows: 50px auto;

comparing every coordinate against the same CSS rendered by real Safari
(grid-vendor-verify.html, read via safaridriver). 25/25 values match
exactly, including fr distribution (160/320 of 480 remaining) and the
auto row resolving to its tallest item.

Upstream status: react#1894 is being re-split after review — react#1923 (data
structures) and react#1994 (auto-placement) are open, but the track-sizing
split has not been posted, which is why this vendors the original PR.
See algorithm/grid/README-VENDORED.md.

Co-authored-by: ide <379606+ide@users.noreply.github.com>
ide-agent pushed a commit to expo/react-native that referenced this pull request Aug 17, 2026
…pstream)

Grid lanes (css-grid-3) is defined on top of Grid's track sizing algorithm:
it imports <track-size>, minmax(), fr, repeat(), auto-fill/auto-fit and
line placement from css-grid-2 by name. That algorithm does not exist in
our tree — PR 1/9 of the upstream series landed the style types
(GridTrackSize, GridLine, gridTemplateColumns/Rows) but not the algorithm
behind them.

Rather than write a second one-axis track sizer, vendor the upstream
implementation verbatim:

  react/yoga#1894 "CSS Grid 2/9: Grid layout algorithm"
  by Nishan Bende (intergalacticspacehighway), open since 2026-02-25

  algorithm/grid/AutoPlacement.h   css-grid-1 §8.5 auto-placement
  algorithm/grid/GridLayout.{h,cpp} entry point, implicit tracks
  algorithm/grid/GridTrack.h        per-track layout state
  algorithm/grid/TrackSizing.h      css-grid-2 §12 track sizing

TrackSizing is parameterized by Dimension — it runs per axis — which is
exactly the shape grid lanes needs, since lanes sizes tracks in the grid
axis only and flows content in the other.

Not our code: nothing in algorithm/grid/ is modified, so that directory
can be deleted wholesale and replaced when the upstream series lands
instead of being merged. Only the integration points are ours, and only
because the PR could not supply them — our CalculateLayout.cpp has
diverged (block formatting contexts) and our Yoga is 197 commits behind:

  - CalculateLayout.cpp: the Display::Grid dispatch, next to Display::Block
  - yoga/CMakeLists.txt: an explicit algorithm/grid/*.cpp glob, since
    CMake's ** matches one level; Android builds through this same file
    and iOS globs recursively via the podspec

The PR's YGNodeStyle.cpp hunk is deliberately omitted: it adds a fallback
return to silence GCC -Wreturn-type, and our tree already handles those
switches better with fatalWithMessage("Unknown YGGridTrackType").

Verified, not assumed: verify-grid-vendor.sh builds yogacore with the
vendored directory and lays out

  display: grid; width: 600px; gap: 10px;
  grid-template-columns: 100px 1fr 2fr; grid-template-rows: 50px auto;

comparing every coordinate against the same CSS rendered by real Safari
(grid-vendor-verify.html, read via safaridriver). 25/25 values match
exactly, including fr distribution (160/320 of 480 remaining) and the
auto row resolving to its tallest item.

Upstream status: react#1894 is being re-split after review — react#1923 (data
structures) and react#1994 (auto-placement) are open, but the track-sizing
split has not been posted, which is why this vendors the original PR.
See algorithm/grid/README-VENDORED.md.

Co-authored-by: ide <379606+ide@users.noreply.github.com>
ide-agent pushed a commit to expo/react-native that referenced this pull request Aug 18, 2026
…pstream)

Grid lanes (css-grid-3) is defined on top of Grid's track sizing algorithm:
it imports <track-size>, minmax(), fr, repeat(), auto-fill/auto-fit and
line placement from css-grid-2 by name. That algorithm does not exist in
our tree — PR 1/9 of the upstream series landed the style types
(GridTrackSize, GridLine, gridTemplateColumns/Rows) but not the algorithm
behind them.

Rather than write a second one-axis track sizer, vendor the upstream
implementation verbatim:

  react/yoga#1894 "CSS Grid 2/9: Grid layout algorithm"
  by Nishan Bende (intergalacticspacehighway), open since 2026-02-25

  algorithm/grid/AutoPlacement.h   css-grid-1 §8.5 auto-placement
  algorithm/grid/GridLayout.{h,cpp} entry point, implicit tracks
  algorithm/grid/GridTrack.h        per-track layout state
  algorithm/grid/TrackSizing.h      css-grid-2 §12 track sizing

TrackSizing is parameterized by Dimension — it runs per axis — which is
exactly the shape grid lanes needs, since lanes sizes tracks in the grid
axis only and flows content in the other.

Not our code: nothing in algorithm/grid/ is modified, so that directory
can be deleted wholesale and replaced when the upstream series lands
instead of being merged. Only the integration points are ours, and only
because the PR could not supply them — our CalculateLayout.cpp has
diverged (block formatting contexts) and our Yoga is 197 commits behind:

  - CalculateLayout.cpp: the Display::Grid dispatch, next to Display::Block
  - yoga/CMakeLists.txt: an explicit algorithm/grid/*.cpp glob, since
    CMake's ** matches one level; Android builds through this same file
    and iOS globs recursively via the podspec

The PR's YGNodeStyle.cpp hunk is deliberately omitted: it adds a fallback
return to silence GCC -Wreturn-type, and our tree already handles those
switches better with fatalWithMessage("Unknown YGGridTrackType").

Verified, not assumed: verify-grid-vendor.sh builds yogacore with the
vendored directory and lays out

  display: grid; width: 600px; gap: 10px;
  grid-template-columns: 100px 1fr 2fr; grid-template-rows: 50px auto;

comparing every coordinate against the same CSS rendered by real Safari
(grid-vendor-verify.html, read via safaridriver). 25/25 values match
exactly, including fr distribution (160/320 of 480 remaining) and the
auto row resolving to its tallest item.

Upstream status: react#1894 is being re-split after review — react#1923 (data
structures) and react#1994 (auto-placement) are open, but the track-sizing
split has not been posted, which is why this vendors the original PR.
See algorithm/grid/README-VENDORED.md.

Co-authored-by: ide <379606+ide@users.noreply.github.com>
ide-agent pushed a commit to expo/react-native that referenced this pull request Aug 18, 2026
…pstream)

Grid lanes (css-grid-3) is defined on top of Grid's track sizing algorithm:
it imports <track-size>, minmax(), fr, repeat(), auto-fill/auto-fit and
line placement from css-grid-2 by name. That algorithm does not exist in
our tree — PR 1/9 of the upstream series landed the style types
(GridTrackSize, GridLine, gridTemplateColumns/Rows) but not the algorithm
behind them.

Rather than write a second one-axis track sizer, vendor the upstream
implementation verbatim:

  react/yoga#1894 "CSS Grid 2/9: Grid layout algorithm"
  by Nishan Bende (intergalacticspacehighway), open since 2026-02-25

  algorithm/grid/AutoPlacement.h   css-grid-1 §8.5 auto-placement
  algorithm/grid/GridLayout.{h,cpp} entry point, implicit tracks
  algorithm/grid/GridTrack.h        per-track layout state
  algorithm/grid/TrackSizing.h      css-grid-2 §12 track sizing

TrackSizing is parameterized by Dimension — it runs per axis — which is
exactly the shape grid lanes needs, since lanes sizes tracks in the grid
axis only and flows content in the other.

Not our code: nothing in algorithm/grid/ is modified, so that directory
can be deleted wholesale and replaced when the upstream series lands
instead of being merged. Only the integration points are ours, and only
because the PR could not supply them — our CalculateLayout.cpp has
diverged (block formatting contexts) and our Yoga is 197 commits behind:

  - CalculateLayout.cpp: the Display::Grid dispatch, next to Display::Block
  - yoga/CMakeLists.txt: an explicit algorithm/grid/*.cpp glob, since
    CMake's ** matches one level; Android builds through this same file
    and iOS globs recursively via the podspec

The PR's YGNodeStyle.cpp hunk is deliberately omitted: it adds a fallback
return to silence GCC -Wreturn-type, and our tree already handles those
switches better with fatalWithMessage("Unknown YGGridTrackType").

Verified, not assumed: verify-grid-vendor.sh builds yogacore with the
vendored directory and lays out

  display: grid; width: 600px; gap: 10px;
  grid-template-columns: 100px 1fr 2fr; grid-template-rows: 50px auto;

comparing every coordinate against the same CSS rendered by real Safari
(grid-vendor-verify.html, read via safaridriver). 25/25 values match
exactly, including fr distribution (160/320 of 480 remaining) and the
auto row resolving to its tallest item.

Upstream status: react#1894 is being re-split after review — react#1923 (data
structures) and react#1994 (auto-placement) are open, but the track-sizing
split has not been posted, which is why this vendors the original PR.
See algorithm/grid/README-VENDORED.md.

Co-authored-by: ide <379606+ide@users.noreply.github.com>
ide-agent pushed a commit to expo/react-native that referenced this pull request Aug 18, 2026
…pstream)

Grid lanes (css-grid-3) is defined on top of Grid's track sizing algorithm:
it imports <track-size>, minmax(), fr, repeat(), auto-fill/auto-fit and
line placement from css-grid-2 by name. That algorithm does not exist in
our tree — PR 1/9 of the upstream series landed the style types
(GridTrackSize, GridLine, gridTemplateColumns/Rows) but not the algorithm
behind them.

Rather than write a second one-axis track sizer, vendor the upstream
implementation verbatim:

  react/yoga#1894 "CSS Grid 2/9: Grid layout algorithm"
  by Nishan Bende (intergalacticspacehighway), open since 2026-02-25

  algorithm/grid/AutoPlacement.h   css-grid-1 §8.5 auto-placement
  algorithm/grid/GridLayout.{h,cpp} entry point, implicit tracks
  algorithm/grid/GridTrack.h        per-track layout state
  algorithm/grid/TrackSizing.h      css-grid-2 §12 track sizing

TrackSizing is parameterized by Dimension — it runs per axis — which is
exactly the shape grid lanes needs, since lanes sizes tracks in the grid
axis only and flows content in the other.

Not our code: nothing in algorithm/grid/ is modified, so that directory
can be deleted wholesale and replaced when the upstream series lands
instead of being merged. Only the integration points are ours, and only
because the PR could not supply them — our CalculateLayout.cpp has
diverged (block formatting contexts) and our Yoga is 197 commits behind:

  - CalculateLayout.cpp: the Display::Grid dispatch, next to Display::Block
  - yoga/CMakeLists.txt: an explicit algorithm/grid/*.cpp glob, since
    CMake's ** matches one level; Android builds through this same file
    and iOS globs recursively via the podspec

The PR's YGNodeStyle.cpp hunk is deliberately omitted: it adds a fallback
return to silence GCC -Wreturn-type, and our tree already handles those
switches better with fatalWithMessage("Unknown YGGridTrackType").

Verified, not assumed: verify-grid-vendor.sh builds yogacore with the
vendored directory and lays out

  display: grid; width: 600px; gap: 10px;
  grid-template-columns: 100px 1fr 2fr; grid-template-rows: 50px auto;

comparing every coordinate against the same CSS rendered by real Safari
(grid-vendor-verify.html, read via safaridriver). 25/25 values match
exactly, including fr distribution (160/320 of 480 remaining) and the
auto row resolving to its tallest item.

Upstream status: react#1894 is being re-split after review — react#1923 (data
structures) and react#1994 (auto-placement) are open, but the track-sizing
split has not been posted, which is why this vendors the original PR.
See algorithm/grid/README-VENDORED.md.

Co-authored-by: ide <379606+ide@users.noreply.github.com>
ide-agent pushed a commit to expo/react-native that referenced this pull request Aug 18, 2026
…pstream)

Grid lanes (css-grid-3) is defined on top of Grid's track sizing algorithm:
it imports <track-size>, minmax(), fr, repeat(), auto-fill/auto-fit and
line placement from css-grid-2 by name. That algorithm does not exist in
our tree — PR 1/9 of the upstream series landed the style types
(GridTrackSize, GridLine, gridTemplateColumns/Rows) but not the algorithm
behind them.

Rather than write a second one-axis track sizer, vendor the upstream
implementation verbatim:

  react/yoga#1894 "CSS Grid 2/9: Grid layout algorithm"
  by Nishan Bende (intergalacticspacehighway), open since 2026-02-25

  algorithm/grid/AutoPlacement.h   css-grid-1 §8.5 auto-placement
  algorithm/grid/GridLayout.{h,cpp} entry point, implicit tracks
  algorithm/grid/GridTrack.h        per-track layout state
  algorithm/grid/TrackSizing.h      css-grid-2 §12 track sizing

TrackSizing is parameterized by Dimension — it runs per axis — which is
exactly the shape grid lanes needs, since lanes sizes tracks in the grid
axis only and flows content in the other.

Not our code: nothing in algorithm/grid/ is modified, so that directory
can be deleted wholesale and replaced when the upstream series lands
instead of being merged. Only the integration points are ours, and only
because the PR could not supply them — our CalculateLayout.cpp has
diverged (block formatting contexts) and our Yoga is 197 commits behind:

  - CalculateLayout.cpp: the Display::Grid dispatch, next to Display::Block
  - yoga/CMakeLists.txt: an explicit algorithm/grid/*.cpp glob, since
    CMake's ** matches one level; Android builds through this same file
    and iOS globs recursively via the podspec

The PR's YGNodeStyle.cpp hunk is deliberately omitted: it adds a fallback
return to silence GCC -Wreturn-type, and our tree already handles those
switches better with fatalWithMessage("Unknown YGGridTrackType").

Verified, not assumed: verify-grid-vendor.sh builds yogacore with the
vendored directory and lays out

  display: grid; width: 600px; gap: 10px;
  grid-template-columns: 100px 1fr 2fr; grid-template-rows: 50px auto;

comparing every coordinate against the same CSS rendered by real Safari
(grid-vendor-verify.html, read via safaridriver). 25/25 values match
exactly, including fr distribution (160/320 of 480 remaining) and the
auto row resolving to its tallest item.

Upstream status: react#1894 is being re-split after review — react#1923 (data
structures) and react#1994 (auto-placement) are open, but the track-sizing
split has not been posted, which is why this vendors the original PR.
See algorithm/grid/README-VENDORED.md.

Co-authored-by: ide <379606+ide@users.noreply.github.com>
ide-agent pushed a commit to expo/react-native that referenced this pull request Aug 19, 2026
…pstream)

Grid lanes (css-grid-3) is defined on top of Grid's track sizing algorithm:
it imports <track-size>, minmax(), fr, repeat(), auto-fill/auto-fit and
line placement from css-grid-2 by name. That algorithm does not exist in
our tree — PR 1/9 of the upstream series landed the style types
(GridTrackSize, GridLine, gridTemplateColumns/Rows) but not the algorithm
behind them.

Rather than write a second one-axis track sizer, vendor the upstream
implementation verbatim:

  react/yoga#1894 "CSS Grid 2/9: Grid layout algorithm"
  by Nishan Bende (intergalacticspacehighway), open since 2026-02-25

  algorithm/grid/AutoPlacement.h   css-grid-1 §8.5 auto-placement
  algorithm/grid/GridLayout.{h,cpp} entry point, implicit tracks
  algorithm/grid/GridTrack.h        per-track layout state
  algorithm/grid/TrackSizing.h      css-grid-2 §12 track sizing

TrackSizing is parameterized by Dimension — it runs per axis — which is
exactly the shape grid lanes needs, since lanes sizes tracks in the grid
axis only and flows content in the other.

Not our code: nothing in algorithm/grid/ is modified, so that directory
can be deleted wholesale and replaced when the upstream series lands
instead of being merged. Only the integration points are ours, and only
because the PR could not supply them — our CalculateLayout.cpp has
diverged (block formatting contexts) and our Yoga is 197 commits behind:

  - CalculateLayout.cpp: the Display::Grid dispatch, next to Display::Block
  - yoga/CMakeLists.txt: an explicit algorithm/grid/*.cpp glob, since
    CMake's ** matches one level; Android builds through this same file
    and iOS globs recursively via the podspec

The PR's YGNodeStyle.cpp hunk is deliberately omitted: it adds a fallback
return to silence GCC -Wreturn-type, and our tree already handles those
switches better with fatalWithMessage("Unknown YGGridTrackType").

Verified, not assumed: verify-grid-vendor.sh builds yogacore with the
vendored directory and lays out

  display: grid; width: 600px; gap: 10px;
  grid-template-columns: 100px 1fr 2fr; grid-template-rows: 50px auto;

comparing every coordinate against the same CSS rendered by real Safari
(grid-vendor-verify.html, read via safaridriver). 25/25 values match
exactly, including fr distribution (160/320 of 480 remaining) and the
auto row resolving to its tallest item.

Upstream status: react#1894 is being re-split after review — react#1923 (data
structures) and react#1994 (auto-placement) are open, but the track-sizing
split has not been posted, which is why this vendors the original PR.
See algorithm/grid/README-VENDORED.md.

Co-authored-by: ide <379606+ide@users.noreply.github.com>
ide-agent pushed a commit to expo/react-native that referenced this pull request Aug 31, 2026
…pstream)

Grid lanes (css-grid-3) is defined on top of Grid's track sizing algorithm:
it imports <track-size>, minmax(), fr, repeat(), auto-fill/auto-fit and
line placement from css-grid-2 by name. That algorithm does not exist in
our tree — PR 1/9 of the upstream series landed the style types
(GridTrackSize, GridLine, gridTemplateColumns/Rows) but not the algorithm
behind them.

Rather than write a second one-axis track sizer, vendor the upstream
implementation verbatim:

  react/yoga#1894 "CSS Grid 2/9: Grid layout algorithm"
  by Nishan Bende (intergalacticspacehighway), open since 2026-02-25

  algorithm/grid/AutoPlacement.h   css-grid-1 §8.5 auto-placement
  algorithm/grid/GridLayout.{h,cpp} entry point, implicit tracks
  algorithm/grid/GridTrack.h        per-track layout state
  algorithm/grid/TrackSizing.h      css-grid-2 §12 track sizing

TrackSizing is parameterized by Dimension — it runs per axis — which is
exactly the shape grid lanes needs, since lanes sizes tracks in the grid
axis only and flows content in the other.

Not our code: nothing in algorithm/grid/ is modified, so that directory
can be deleted wholesale and replaced when the upstream series lands
instead of being merged. Only the integration points are ours, and only
because the PR could not supply them — our CalculateLayout.cpp has
diverged (block formatting contexts) and our Yoga is 197 commits behind:

  - CalculateLayout.cpp: the Display::Grid dispatch, next to Display::Block
  - yoga/CMakeLists.txt: an explicit algorithm/grid/*.cpp glob, since
    CMake's ** matches one level; Android builds through this same file
    and iOS globs recursively via the podspec

The PR's YGNodeStyle.cpp hunk is deliberately omitted: it adds a fallback
return to silence GCC -Wreturn-type, and our tree already handles those
switches better with fatalWithMessage("Unknown YGGridTrackType").

Verified, not assumed: verify-grid-vendor.sh builds yogacore with the
vendored directory and lays out

  display: grid; width: 600px; gap: 10px;
  grid-template-columns: 100px 1fr 2fr; grid-template-rows: 50px auto;

comparing every coordinate against the same CSS rendered by real Safari
(grid-vendor-verify.html, read via safaridriver). 25/25 values match
exactly, including fr distribution (160/320 of 480 remaining) and the
auto row resolving to its tallest item.

Upstream status: react#1894 is being re-split after review — react#1923 (data
structures) and react#1994 (auto-placement) are open, but the track-sizing
split has not been posted, which is why this vendors the original PR.
See algorithm/grid/README-VENDORED.md.

Co-authored-by: ide <379606+ide@users.noreply.github.com>
(cherry picked from commit 08d6986)
ide-agent pushed a commit to expo/react-native that referenced this pull request Sep 12, 2026
…pstream)

Grid lanes (css-grid-3) is defined on top of Grid's track sizing algorithm:
it imports <track-size>, minmax(), fr, repeat(), auto-fill/auto-fit and
line placement from css-grid-2 by name. That algorithm does not exist in
our tree — PR 1/9 of the upstream series landed the style types
(GridTrackSize, GridLine, gridTemplateColumns/Rows) but not the algorithm
behind them.

Rather than write a second one-axis track sizer, vendor the upstream
implementation verbatim:

  react/yoga#1894 "CSS Grid 2/9: Grid layout algorithm"
  by Nishan Bende (intergalacticspacehighway), open since 2026-02-25

  algorithm/grid/AutoPlacement.h   css-grid-1 §8.5 auto-placement
  algorithm/grid/GridLayout.{h,cpp} entry point, implicit tracks
  algorithm/grid/GridTrack.h        per-track layout state
  algorithm/grid/TrackSizing.h      css-grid-2 §12 track sizing

TrackSizing is parameterized by Dimension — it runs per axis — which is
exactly the shape grid lanes needs, since lanes sizes tracks in the grid
axis only and flows content in the other.

Not our code: nothing in algorithm/grid/ is modified, so that directory
can be deleted wholesale and replaced when the upstream series lands
instead of being merged. Only the integration points are ours, and only
because the PR could not supply them — our CalculateLayout.cpp has
diverged (block formatting contexts) and our Yoga is 197 commits behind:

  - CalculateLayout.cpp: the Display::Grid dispatch, next to Display::Block
  - yoga/CMakeLists.txt: an explicit algorithm/grid/*.cpp glob, since
    CMake's ** matches one level; Android builds through this same file
    and iOS globs recursively via the podspec

The PR's YGNodeStyle.cpp hunk is deliberately omitted: it adds a fallback
return to silence GCC -Wreturn-type, and our tree already handles those
switches better with fatalWithMessage("Unknown YGGridTrackType").

Verified, not assumed: verify-grid-vendor.sh builds yogacore with the
vendored directory and lays out

  display: grid; width: 600px; gap: 10px;
  grid-template-columns: 100px 1fr 2fr; grid-template-rows: 50px auto;

comparing every coordinate against the same CSS rendered by real Safari
(grid-vendor-verify.html, read via safaridriver). 25/25 values match
exactly, including fr distribution (160/320 of 480 remaining) and the
auto row resolving to its tallest item.

Upstream status: react#1894 is being re-split after review — react#1923 (data
structures) and react#1994 (auto-placement) are open, but the track-sizing
split has not been posted, which is why this vendors the original PR.
See algorithm/grid/README-VENDORED.md.

Co-authored-by: ide <379606+ide@users.noreply.github.com>
(cherry picked from commit 08d6986)
ide-agent pushed a commit to expo/react-native that referenced this pull request Sep 13, 2026
…pstream)

Grid lanes (css-grid-3) is defined on top of Grid's track sizing algorithm:
it imports <track-size>, minmax(), fr, repeat(), auto-fill/auto-fit and
line placement from css-grid-2 by name. That algorithm does not exist in
our tree — PR 1/9 of the upstream series landed the style types
(GridTrackSize, GridLine, gridTemplateColumns/Rows) but not the algorithm
behind them.

Rather than write a second one-axis track sizer, vendor the upstream
implementation verbatim:

  react/yoga#1894 "CSS Grid 2/9: Grid layout algorithm"
  by Nishan Bende (intergalacticspacehighway), open since 2026-02-25

  algorithm/grid/AutoPlacement.h   css-grid-1 §8.5 auto-placement
  algorithm/grid/GridLayout.{h,cpp} entry point, implicit tracks
  algorithm/grid/GridTrack.h        per-track layout state
  algorithm/grid/TrackSizing.h      css-grid-2 §12 track sizing

TrackSizing is parameterized by Dimension — it runs per axis — which is
exactly the shape grid lanes needs, since lanes sizes tracks in the grid
axis only and flows content in the other.

Not our code: nothing in algorithm/grid/ is modified, so that directory
can be deleted wholesale and replaced when the upstream series lands
instead of being merged. Only the integration points are ours, and only
because the PR could not supply them — our CalculateLayout.cpp has
diverged (block formatting contexts) and our Yoga is 197 commits behind:

  - CalculateLayout.cpp: the Display::Grid dispatch, next to Display::Block
  - yoga/CMakeLists.txt: an explicit algorithm/grid/*.cpp glob, since
    CMake's ** matches one level; Android builds through this same file
    and iOS globs recursively via the podspec

The PR's YGNodeStyle.cpp hunk is deliberately omitted: it adds a fallback
return to silence GCC -Wreturn-type, and our tree already handles those
switches better with fatalWithMessage("Unknown YGGridTrackType").

Verified, not assumed: verify-grid-vendor.sh builds yogacore with the
vendored directory and lays out

  display: grid; width: 600px; gap: 10px;
  grid-template-columns: 100px 1fr 2fr; grid-template-rows: 50px auto;

comparing every coordinate against the same CSS rendered by real Safari
(grid-vendor-verify.html, read via safaridriver). 25/25 values match
exactly, including fr distribution (160/320 of 480 remaining) and the
auto row resolving to its tallest item.

Upstream status: react#1894 is being re-split after review — react#1923 (data
structures) and react#1994 (auto-placement) are open, but the track-sizing
split has not been posted, which is why this vendors the original PR.
See algorithm/grid/README-VENDORED.md.

Co-authored-by: ide <379606+ide@users.noreply.github.com>
(cherry picked from commit 08d6986)
ide-agent pushed a commit to expo/react-native that referenced this pull request Sep 28, 2026
…pstream)

Grid lanes (css-grid-3) is defined on top of Grid's track sizing algorithm:
it imports <track-size>, minmax(), fr, repeat(), auto-fill/auto-fit and
line placement from css-grid-2 by name. That algorithm does not exist in
our tree — PR 1/9 of the upstream series landed the style types
(GridTrackSize, GridLine, gridTemplateColumns/Rows) but not the algorithm
behind them.

Rather than write a second one-axis track sizer, vendor the upstream
implementation verbatim:

  react/yoga#1894 "CSS Grid 2/9: Grid layout algorithm"
  by Nishan Bende (intergalacticspacehighway), open since 2026-02-25

  algorithm/grid/AutoPlacement.h   css-grid-1 §8.5 auto-placement
  algorithm/grid/GridLayout.{h,cpp} entry point, implicit tracks
  algorithm/grid/GridTrack.h        per-track layout state
  algorithm/grid/TrackSizing.h      css-grid-2 §12 track sizing

TrackSizing is parameterized by Dimension — it runs per axis — which is
exactly the shape grid lanes needs, since lanes sizes tracks in the grid
axis only and flows content in the other.

Not our code: nothing in algorithm/grid/ is modified, so that directory
can be deleted wholesale and replaced when the upstream series lands
instead of being merged. Only the integration points are ours, and only
because the PR could not supply them — our CalculateLayout.cpp has
diverged (block formatting contexts) and our Yoga is 197 commits behind:

  - CalculateLayout.cpp: the Display::Grid dispatch, next to Display::Block
  - yoga/CMakeLists.txt: an explicit algorithm/grid/*.cpp glob, since
    CMake's ** matches one level; Android builds through this same file
    and iOS globs recursively via the podspec

The PR's YGNodeStyle.cpp hunk is deliberately omitted: it adds a fallback
return to silence GCC -Wreturn-type, and our tree already handles those
switches better with fatalWithMessage("Unknown YGGridTrackType").

Verified, not assumed: verify-grid-vendor.sh builds yogacore with the
vendored directory and lays out

  display: grid; width: 600px; gap: 10px;
  grid-template-columns: 100px 1fr 2fr; grid-template-rows: 50px auto;

comparing every coordinate against the same CSS rendered by real Safari
(grid-vendor-verify.html, read via safaridriver). 25/25 values match
exactly, including fr distribution (160/320 of 480 remaining) and the
auto row resolving to its tallest item.

Upstream status: react#1894 is being re-split after review — react#1923 (data
structures) and react#1994 (auto-placement) are open, but the track-sizing
split has not been posted, which is why this vendors the original PR.
See algorithm/grid/README-VENDORED.md.

Co-authored-by: ide <379606+ide@users.noreply.github.com>
(cherry picked from commit 08d6986)
ide-agent pushed a commit to expo/react-native that referenced this pull request Oct 2, 2026
…pstream)

Grid lanes (css-grid-3) is defined on top of Grid's track sizing algorithm:
it imports <track-size>, minmax(), fr, repeat(), auto-fill/auto-fit and
line placement from css-grid-2 by name. That algorithm does not exist in
our tree — PR 1/9 of the upstream series landed the style types
(GridTrackSize, GridLine, gridTemplateColumns/Rows) but not the algorithm
behind them.

Rather than write a second one-axis track sizer, vendor the upstream
implementation verbatim:

  react/yoga#1894 "CSS Grid 2/9: Grid layout algorithm"
  by Nishan Bende (intergalacticspacehighway), open since 2026-02-25

  algorithm/grid/AutoPlacement.h   css-grid-1 §8.5 auto-placement
  algorithm/grid/GridLayout.{h,cpp} entry point, implicit tracks
  algorithm/grid/GridTrack.h        per-track layout state
  algorithm/grid/TrackSizing.h      css-grid-2 §12 track sizing

TrackSizing is parameterized by Dimension — it runs per axis — which is
exactly the shape grid lanes needs, since lanes sizes tracks in the grid
axis only and flows content in the other.

Not our code: nothing in algorithm/grid/ is modified, so that directory
can be deleted wholesale and replaced when the upstream series lands
instead of being merged. Only the integration points are ours, and only
because the PR could not supply them — our CalculateLayout.cpp has
diverged (block formatting contexts) and our Yoga is 197 commits behind:

  - CalculateLayout.cpp: the Display::Grid dispatch, next to Display::Block
  - yoga/CMakeLists.txt: an explicit algorithm/grid/*.cpp glob, since
    CMake's ** matches one level; Android builds through this same file
    and iOS globs recursively via the podspec

The PR's YGNodeStyle.cpp hunk is deliberately omitted: it adds a fallback
return to silence GCC -Wreturn-type, and our tree already handles those
switches better with fatalWithMessage("Unknown YGGridTrackType").

Verified, not assumed: verify-grid-vendor.sh builds yogacore with the
vendored directory and lays out

  display: grid; width: 600px; gap: 10px;
  grid-template-columns: 100px 1fr 2fr; grid-template-rows: 50px auto;

comparing every coordinate against the same CSS rendered by real Safari
(grid-vendor-verify.html, read via safaridriver). 25/25 values match
exactly, including fr distribution (160/320 of 480 remaining) and the
auto row resolving to its tallest item.

Upstream status: react#1894 is being re-split after review — react#1923 (data
structures) and react#1994 (auto-placement) are open, but the track-sizing
split has not been posted, which is why this vendors the original PR.
See algorithm/grid/README-VENDORED.md.

Co-authored-by: ide <379606+ide@users.noreply.github.com>
(cherry picked from commit 08d6986)
ide-agent pushed a commit to expo/react-native that referenced this pull request Oct 3, 2026
…pstream)

Grid lanes (css-grid-3) is defined on top of Grid's track sizing algorithm:
it imports <track-size>, minmax(), fr, repeat(), auto-fill/auto-fit and
line placement from css-grid-2 by name. That algorithm does not exist in
our tree — PR 1/9 of the upstream series landed the style types
(GridTrackSize, GridLine, gridTemplateColumns/Rows) but not the algorithm
behind them.

Rather than write a second one-axis track sizer, vendor the upstream
implementation verbatim:

  react/yoga#1894 "CSS Grid 2/9: Grid layout algorithm"
  by Nishan Bende (intergalacticspacehighway), open since 2026-02-25

  algorithm/grid/AutoPlacement.h   css-grid-1 §8.5 auto-placement
  algorithm/grid/GridLayout.{h,cpp} entry point, implicit tracks
  algorithm/grid/GridTrack.h        per-track layout state
  algorithm/grid/TrackSizing.h      css-grid-2 §12 track sizing

TrackSizing is parameterized by Dimension — it runs per axis — which is
exactly the shape grid lanes needs, since lanes sizes tracks in the grid
axis only and flows content in the other.

Not our code: nothing in algorithm/grid/ is modified, so that directory
can be deleted wholesale and replaced when the upstream series lands
instead of being merged. Only the integration points are ours, and only
because the PR could not supply them — our CalculateLayout.cpp has
diverged (block formatting contexts) and our Yoga is 197 commits behind:

  - CalculateLayout.cpp: the Display::Grid dispatch, next to Display::Block
  - yoga/CMakeLists.txt: an explicit algorithm/grid/*.cpp glob, since
    CMake's ** matches one level; Android builds through this same file
    and iOS globs recursively via the podspec

The PR's YGNodeStyle.cpp hunk is deliberately omitted: it adds a fallback
return to silence GCC -Wreturn-type, and our tree already handles those
switches better with fatalWithMessage("Unknown YGGridTrackType").

Verified, not assumed: verify-grid-vendor.sh builds yogacore with the
vendored directory and lays out

  display: grid; width: 600px; gap: 10px;
  grid-template-columns: 100px 1fr 2fr; grid-template-rows: 50px auto;

comparing every coordinate against the same CSS rendered by real Safari
(grid-vendor-verify.html, read via safaridriver). 25/25 values match
exactly, including fr distribution (160/320 of 480 remaining) and the
auto row resolving to its tallest item.

Upstream status: react#1894 is being re-split after review — react#1923 (data
structures) and react#1994 (auto-placement) are open, but the track-sizing
split has not been posted, which is why this vendors the original PR.
See algorithm/grid/README-VENDORED.md.

Co-authored-by: ide <379606+ide@users.noreply.github.com>
(cherry picked from commit 08d6986)
ide-agent pushed a commit to expo/react-native that referenced this pull request Oct 3, 2026
…pstream)

Grid lanes (css-grid-3) is defined on top of Grid's track sizing algorithm:
it imports <track-size>, minmax(), fr, repeat(), auto-fill/auto-fit and
line placement from css-grid-2 by name. That algorithm does not exist in
our tree — PR 1/9 of the upstream series landed the style types
(GridTrackSize, GridLine, gridTemplateColumns/Rows) but not the algorithm
behind them.

Rather than write a second one-axis track sizer, vendor the upstream
implementation verbatim:

  react/yoga#1894 "CSS Grid 2/9: Grid layout algorithm"
  by Nishan Bende (intergalacticspacehighway), open since 2026-02-25

  algorithm/grid/AutoPlacement.h   css-grid-1 §8.5 auto-placement
  algorithm/grid/GridLayout.{h,cpp} entry point, implicit tracks
  algorithm/grid/GridTrack.h        per-track layout state
  algorithm/grid/TrackSizing.h      css-grid-2 §12 track sizing

TrackSizing is parameterized by Dimension — it runs per axis — which is
exactly the shape grid lanes needs, since lanes sizes tracks in the grid
axis only and flows content in the other.

Not our code: nothing in algorithm/grid/ is modified, so that directory
can be deleted wholesale and replaced when the upstream series lands
instead of being merged. Only the integration points are ours, and only
because the PR could not supply them — our CalculateLayout.cpp has
diverged (block formatting contexts) and our Yoga is 197 commits behind:

  - CalculateLayout.cpp: the Display::Grid dispatch, next to Display::Block
  - yoga/CMakeLists.txt: an explicit algorithm/grid/*.cpp glob, since
    CMake's ** matches one level; Android builds through this same file
    and iOS globs recursively via the podspec

The PR's YGNodeStyle.cpp hunk is deliberately omitted: it adds a fallback
return to silence GCC -Wreturn-type, and our tree already handles those
switches better with fatalWithMessage("Unknown YGGridTrackType").

Verified, not assumed: verify-grid-vendor.sh builds yogacore with the
vendored directory and lays out

  display: grid; width: 600px; gap: 10px;
  grid-template-columns: 100px 1fr 2fr; grid-template-rows: 50px auto;

comparing every coordinate against the same CSS rendered by real Safari
(grid-vendor-verify.html, read via safaridriver). 25/25 values match
exactly, including fr distribution (160/320 of 480 remaining) and the
auto row resolving to its tallest item.

Upstream status: react#1894 is being re-split after review — react#1923 (data
structures) and react#1994 (auto-placement) are open, but the track-sizing
split has not been posted, which is why this vendors the original PR.
See algorithm/grid/README-VENDORED.md.

Co-authored-by: ide <379606+ide@users.noreply.github.com>
(cherry picked from commit 08d6986)
ide-agent pushed a commit to expo/react-native that referenced this pull request Oct 3, 2026
…pstream)

Grid lanes (css-grid-3) is defined on top of Grid's track sizing algorithm:
it imports <track-size>, minmax(), fr, repeat(), auto-fill/auto-fit and
line placement from css-grid-2 by name. That algorithm does not exist in
our tree — PR 1/9 of the upstream series landed the style types
(GridTrackSize, GridLine, gridTemplateColumns/Rows) but not the algorithm
behind them.

Rather than write a second one-axis track sizer, vendor the upstream
implementation verbatim:

  react/yoga#1894 "CSS Grid 2/9: Grid layout algorithm"
  by Nishan Bende (intergalacticspacehighway), open since 2026-02-25

  algorithm/grid/AutoPlacement.h   css-grid-1 §8.5 auto-placement
  algorithm/grid/GridLayout.{h,cpp} entry point, implicit tracks
  algorithm/grid/GridTrack.h        per-track layout state
  algorithm/grid/TrackSizing.h      css-grid-2 §12 track sizing

TrackSizing is parameterized by Dimension — it runs per axis — which is
exactly the shape grid lanes needs, since lanes sizes tracks in the grid
axis only and flows content in the other.

Not our code: nothing in algorithm/grid/ is modified, so that directory
can be deleted wholesale and replaced when the upstream series lands
instead of being merged. Only the integration points are ours, and only
because the PR could not supply them — our CalculateLayout.cpp has
diverged (block formatting contexts) and our Yoga is 197 commits behind:

  - CalculateLayout.cpp: the Display::Grid dispatch, next to Display::Block
  - yoga/CMakeLists.txt: an explicit algorithm/grid/*.cpp glob, since
    CMake's ** matches one level; Android builds through this same file
    and iOS globs recursively via the podspec

The PR's YGNodeStyle.cpp hunk is deliberately omitted: it adds a fallback
return to silence GCC -Wreturn-type, and our tree already handles those
switches better with fatalWithMessage("Unknown YGGridTrackType").

Verified, not assumed: verify-grid-vendor.sh builds yogacore with the
vendored directory and lays out

  display: grid; width: 600px; gap: 10px;
  grid-template-columns: 100px 1fr 2fr; grid-template-rows: 50px auto;

comparing every coordinate against the same CSS rendered by real Safari
(grid-vendor-verify.html, read via safaridriver). 25/25 values match
exactly, including fr distribution (160/320 of 480 remaining) and the
auto row resolving to its tallest item.

Upstream status: react#1894 is being re-split after review — react#1923 (data
structures) and react#1994 (auto-placement) are open, but the track-sizing
split has not been posted, which is why this vendors the original PR.
See algorithm/grid/README-VENDORED.md.

Co-authored-by: ide <379606+ide@users.noreply.github.com>
(cherry picked from commit 08d6986)
ide-agent pushed a commit to expo/react-native that referenced this pull request Oct 15, 2026
…pstream)

Grid lanes (css-grid-3) is defined on top of Grid's track sizing algorithm:
it imports <track-size>, minmax(), fr, repeat(), auto-fill/auto-fit and
line placement from css-grid-2 by name. That algorithm does not exist in
our tree — PR 1/9 of the upstream series landed the style types
(GridTrackSize, GridLine, gridTemplateColumns/Rows) but not the algorithm
behind them.

Rather than write a second one-axis track sizer, vendor the upstream
implementation verbatim:

  react/yoga#1894 "CSS Grid 2/9: Grid layout algorithm"
  by Nishan Bende (intergalacticspacehighway), open since 2026-02-25

  algorithm/grid/AutoPlacement.h   css-grid-1 §8.5 auto-placement
  algorithm/grid/GridLayout.{h,cpp} entry point, implicit tracks
  algorithm/grid/GridTrack.h        per-track layout state
  algorithm/grid/TrackSizing.h      css-grid-2 §12 track sizing

TrackSizing is parameterized by Dimension — it runs per axis — which is
exactly the shape grid lanes needs, since lanes sizes tracks in the grid
axis only and flows content in the other.

Not our code: nothing in algorithm/grid/ is modified, so that directory
can be deleted wholesale and replaced when the upstream series lands
instead of being merged. Only the integration points are ours, and only
because the PR could not supply them — our CalculateLayout.cpp has
diverged (block formatting contexts) and our Yoga is 197 commits behind:

  - CalculateLayout.cpp: the Display::Grid dispatch, next to Display::Block
  - yoga/CMakeLists.txt: an explicit algorithm/grid/*.cpp glob, since
    CMake's ** matches one level; Android builds through this same file
    and iOS globs recursively via the podspec

The PR's YGNodeStyle.cpp hunk is deliberately omitted: it adds a fallback
return to silence GCC -Wreturn-type, and our tree already handles those
switches better with fatalWithMessage("Unknown YGGridTrackType").

Verified, not assumed: verify-grid-vendor.sh builds yogacore with the
vendored directory and lays out

  display: grid; width: 600px; gap: 10px;
  grid-template-columns: 100px 1fr 2fr; grid-template-rows: 50px auto;

comparing every coordinate against the same CSS rendered by real Safari
(grid-vendor-verify.html, read via safaridriver). 25/25 values match
exactly, including fr distribution (160/320 of 480 remaining) and the
auto row resolving to its tallest item.

Upstream status: react#1894 is being re-split after review — react#1923 (data
structures) and react#1994 (auto-placement) are open, but the track-sizing
split has not been posted, which is why this vendors the original PR.
See algorithm/grid/README-VENDORED.md.

Co-authored-by: ide <379606+ide@users.noreply.github.com>
(cherry picked from commit 08d6986)
ide-agent pushed a commit to expo/react-native that referenced this pull request Oct 20, 2026
…pstream)

Grid lanes (css-grid-3) is defined on top of Grid's track sizing algorithm:
it imports <track-size>, minmax(), fr, repeat(), auto-fill/auto-fit and
line placement from css-grid-2 by name. That algorithm does not exist in
our tree — PR 1/9 of the upstream series landed the style types
(GridTrackSize, GridLine, gridTemplateColumns/Rows) but not the algorithm
behind them.

Rather than write a second one-axis track sizer, vendor the upstream
implementation verbatim:

  react/yoga#1894 "CSS Grid 2/9: Grid layout algorithm"
  by Nishan Bende (intergalacticspacehighway), open since 2026-02-25

  algorithm/grid/AutoPlacement.h   css-grid-1 §8.5 auto-placement
  algorithm/grid/GridLayout.{h,cpp} entry point, implicit tracks
  algorithm/grid/GridTrack.h        per-track layout state
  algorithm/grid/TrackSizing.h      css-grid-2 §12 track sizing

TrackSizing is parameterized by Dimension — it runs per axis — which is
exactly the shape grid lanes needs, since lanes sizes tracks in the grid
axis only and flows content in the other.

Not our code: nothing in algorithm/grid/ is modified, so that directory
can be deleted wholesale and replaced when the upstream series lands
instead of being merged. Only the integration points are ours, and only
because the PR could not supply them — our CalculateLayout.cpp has
diverged (block formatting contexts) and our Yoga is 197 commits behind:

  - CalculateLayout.cpp: the Display::Grid dispatch, next to Display::Block
  - yoga/CMakeLists.txt: an explicit algorithm/grid/*.cpp glob, since
    CMake's ** matches one level; Android builds through this same file
    and iOS globs recursively via the podspec

The PR's YGNodeStyle.cpp hunk is deliberately omitted: it adds a fallback
return to silence GCC -Wreturn-type, and our tree already handles those
switches better with fatalWithMessage("Unknown YGGridTrackType").

Verified, not assumed: verify-grid-vendor.sh builds yogacore with the
vendored directory and lays out

  display: grid; width: 600px; gap: 10px;
  grid-template-columns: 100px 1fr 2fr; grid-template-rows: 50px auto;

comparing every coordinate against the same CSS rendered by real Safari
(grid-vendor-verify.html, read via safaridriver). 25/25 values match
exactly, including fr distribution (160/320 of 480 remaining) and the
auto row resolving to its tallest item.

Upstream status: react#1894 is being re-split after review — react#1923 (data
structures) and react#1994 (auto-placement) are open, but the track-sizing
split has not been posted, which is why this vendors the original PR.
See algorithm/grid/README-VENDORED.md.

A third local fix, listed in README-VENDORED.md: the fit-content clamp in the inline axis was never applied, so a grid measured under a fit-content width reported its max-content width. It is now min(max-content, max(min-content, available)), its tracks sized again at the available width when the max-content exceeds it.

Co-authored-by: ide <379606+ide@users.noreply.github.com>
ide-agent pushed a commit to expo/react-native that referenced this pull request Oct 20, 2026
…pstream)

Grid lanes (css-grid-3) is defined on top of Grid's track sizing algorithm:
it imports <track-size>, minmax(), fr, repeat(), auto-fill/auto-fit and
line placement from css-grid-2 by name. That algorithm does not exist in
our tree — PR 1/9 of the upstream series landed the style types
(GridTrackSize, GridLine, gridTemplateColumns/Rows) but not the algorithm
behind them.

Rather than write a second one-axis track sizer, vendor the upstream
implementation verbatim:

  react/yoga#1894 "CSS Grid 2/9: Grid layout algorithm"
  by Nishan Bende (intergalacticspacehighway), open since 2026-02-25

  algorithm/grid/AutoPlacement.h   css-grid-1 §8.5 auto-placement
  algorithm/grid/GridLayout.{h,cpp} entry point, implicit tracks
  algorithm/grid/GridTrack.h        per-track layout state
  algorithm/grid/TrackSizing.h      css-grid-2 §12 track sizing

TrackSizing is parameterized by Dimension — it runs per axis — which is
exactly the shape grid lanes needs, since lanes sizes tracks in the grid
axis only and flows content in the other.

Not our code: nothing in algorithm/grid/ is modified, so that directory
can be deleted wholesale and replaced when the upstream series lands
instead of being merged. Only the integration points are ours, and only
because the PR could not supply them — our CalculateLayout.cpp has
diverged (block formatting contexts) and our Yoga is 197 commits behind:

  - CalculateLayout.cpp: the Display::Grid dispatch, next to Display::Block
  - yoga/CMakeLists.txt: an explicit algorithm/grid/*.cpp glob, since
    CMake's ** matches one level; Android builds through this same file
    and iOS globs recursively via the podspec

The PR's YGNodeStyle.cpp hunk is deliberately omitted: it adds a fallback
return to silence GCC -Wreturn-type, and our tree already handles those
switches better with fatalWithMessage("Unknown YGGridTrackType").

Verified, not assumed: verify-grid-vendor.sh builds yogacore with the
vendored directory and lays out

  display: grid; width: 600px; gap: 10px;
  grid-template-columns: 100px 1fr 2fr; grid-template-rows: 50px auto;

comparing every coordinate against the same CSS rendered by real Safari
(grid-vendor-verify.html, read via safaridriver). 25/25 values match
exactly, including fr distribution (160/320 of 480 remaining) and the
auto row resolving to its tallest item.

Upstream status: react#1894 is being re-split after review — react#1923 (data
structures) and react#1994 (auto-placement) are open, but the track-sizing
split has not been posted, which is why this vendors the original PR.
See algorithm/grid/README-VENDORED.md.

A third local fix, listed in README-VENDORED.md: the fit-content clamp in the inline axis was never applied, so a grid measured under a fit-content width reported its max-content width. It is now min(max-content, max(min-content, available)), its tracks sized again at the available width when the max-content exceeds it.

A fourth: three steps of the track sizing gave an `auto` minimum an item's limited min-content contribution whenever Yoga's sizing mode was `MaxContent`, which is also how Yoga lays out an `auto` block size; that size is indefinite free space, not a max-content constraint, so a `0fr` row over an item with `min-height: 0` (the accordion idiom) stood as tall as the item's content. Only the inline axis is measured under a real max-content constraint now. `GridZeroFrRow-itest.js` pins it.

Co-authored-by: ide <379606+ide@users.noreply.github.com>
ide-agent pushed a commit to expo/react-native that referenced this pull request Oct 20, 2026
…pstream)

Grid lanes (css-grid-3) is defined on top of Grid's track sizing algorithm:
it imports <track-size>, minmax(), fr, repeat(), auto-fill/auto-fit and
line placement from css-grid-2 by name. That algorithm does not exist in
our tree — PR 1/9 of the upstream series landed the style types
(GridTrackSize, GridLine, gridTemplateColumns/Rows) but not the algorithm
behind them.

Rather than write a second one-axis track sizer, vendor the upstream
implementation verbatim:

  react/yoga#1894 "CSS Grid 2/9: Grid layout algorithm"
  by Nishan Bende (intergalacticspacehighway), open since 2026-02-25

  algorithm/grid/AutoPlacement.h   css-grid-1 §8.5 auto-placement
  algorithm/grid/GridLayout.{h,cpp} entry point, implicit tracks
  algorithm/grid/GridTrack.h        per-track layout state
  algorithm/grid/TrackSizing.h      css-grid-2 §12 track sizing

TrackSizing is parameterized by Dimension — it runs per axis — which is
exactly the shape grid lanes needs, since lanes sizes tracks in the grid
axis only and flows content in the other.

Not our code: nothing in algorithm/grid/ is modified, so that directory
can be deleted wholesale and replaced when the upstream series lands
instead of being merged. Only the integration points are ours, and only
because the PR could not supply them — our CalculateLayout.cpp has
diverged (block formatting contexts) and our Yoga is 197 commits behind:

  - CalculateLayout.cpp: the Display::Grid dispatch, next to Display::Block
  - yoga/CMakeLists.txt: an explicit algorithm/grid/*.cpp glob, since
    CMake's ** matches one level; Android builds through this same file
    and iOS globs recursively via the podspec

The PR's YGNodeStyle.cpp hunk is deliberately omitted: it adds a fallback
return to silence GCC -Wreturn-type, and our tree already handles those
switches better with fatalWithMessage("Unknown YGGridTrackType").

Verified, not assumed: verify-grid-vendor.sh builds yogacore with the
vendored directory and lays out

  display: grid; width: 600px; gap: 10px;
  grid-template-columns: 100px 1fr 2fr; grid-template-rows: 50px auto;

comparing every coordinate against the same CSS rendered by real Safari
(grid-vendor-verify.html, read via safaridriver). 25/25 values match
exactly, including fr distribution (160/320 of 480 remaining) and the
auto row resolving to its tallest item.

Upstream status: react#1894 is being re-split after review — react#1923 (data
structures) and react#1994 (auto-placement) are open, but the track-sizing
split has not been posted, which is why this vendors the original PR.
See algorithm/grid/README-VENDORED.md.

A third local fix, listed in README-VENDORED.md: the fit-content clamp in the inline axis was never applied, so a grid measured under a fit-content width reported its max-content width. It is now min(max-content, max(min-content, available)), its tracks sized again at the available width when the max-content exceeds it.

A fourth: three steps of the track sizing gave an `auto` minimum an item's limited min-content contribution whenever Yoga's sizing mode was `MaxContent`, which is also how Yoga lays out an `auto` block size; that size is indefinite free space, not a max-content constraint, so a `0fr` row over an item with `min-height: 0` (the accordion idiom) stood as tall as the item's content. Only the inline axis is measured under a real max-content constraint now. `GridZeroFrRow-itest.js` pins it.

Co-authored-by: ide <379606+ide@users.noreply.github.com>
ide-agent pushed a commit to expo/react-native that referenced this pull request Oct 20, 2026
…pstream)

Grid lanes (css-grid-3) is defined on top of Grid's track sizing algorithm:
it imports <track-size>, minmax(), fr, repeat(), auto-fill/auto-fit and
line placement from css-grid-2 by name. That algorithm does not exist in
our tree — PR 1/9 of the upstream series landed the style types
(GridTrackSize, GridLine, gridTemplateColumns/Rows) but not the algorithm
behind them.

Rather than write a second one-axis track sizer, vendor the upstream
implementation verbatim:

  react/yoga#1894 "CSS Grid 2/9: Grid layout algorithm"
  by Nishan Bende (intergalacticspacehighway), open since 2026-02-25

  algorithm/grid/AutoPlacement.h   css-grid-1 §8.5 auto-placement
  algorithm/grid/GridLayout.{h,cpp} entry point, implicit tracks
  algorithm/grid/GridTrack.h        per-track layout state
  algorithm/grid/TrackSizing.h      css-grid-2 §12 track sizing

TrackSizing is parameterized by Dimension — it runs per axis — which is
exactly the shape grid lanes needs, since lanes sizes tracks in the grid
axis only and flows content in the other.

Not our code: nothing in algorithm/grid/ is modified, so that directory
can be deleted wholesale and replaced when the upstream series lands
instead of being merged. Only the integration points are ours, and only
because the PR could not supply them — our CalculateLayout.cpp has
diverged (block formatting contexts) and our Yoga is 197 commits behind:

  - CalculateLayout.cpp: the Display::Grid dispatch, next to Display::Block
  - yoga/CMakeLists.txt: an explicit algorithm/grid/*.cpp glob, since
    CMake's ** matches one level; Android builds through this same file
    and iOS globs recursively via the podspec

The PR's YGNodeStyle.cpp hunk is deliberately omitted: it adds a fallback
return to silence GCC -Wreturn-type, and our tree already handles those
switches better with fatalWithMessage("Unknown YGGridTrackType").

Verified, not assumed: verify-grid-vendor.sh builds yogacore with the
vendored directory and lays out

  display: grid; width: 600px; gap: 10px;
  grid-template-columns: 100px 1fr 2fr; grid-template-rows: 50px auto;

comparing every coordinate against the same CSS rendered by real Safari
(grid-vendor-verify.html, read via safaridriver). 25/25 values match
exactly, including fr distribution (160/320 of 480 remaining) and the
auto row resolving to its tallest item.

Upstream status: react#1894 is being re-split after review — react#1923 (data
structures) and react#1994 (auto-placement) are open, but the track-sizing
split has not been posted, which is why this vendors the original PR.
See algorithm/grid/README-VENDORED.md.

A third local fix, listed in README-VENDORED.md: the fit-content clamp in the inline axis was never applied, so a grid measured under a fit-content width reported its max-content width. It is now min(max-content, max(min-content, available)), its tracks sized again at the available width when the max-content exceeds it.

A fourth: three steps of the track sizing gave an `auto` minimum an item's limited min-content contribution whenever Yoga's sizing mode was `MaxContent`, which is also how Yoga lays out an `auto` block size; that size is indefinite free space, not a max-content constraint, so a `0fr` row over an item with `min-height: 0` (the accordion idiom) stood as tall as the item's content. Only the inline axis is measured under a real max-content constraint now. `GridZeroFrRow-itest.js` pins it.

Co-authored-by: ide <379606+ide@users.noreply.github.com>
ide-agent pushed a commit to expo/react-native that referenced this pull request Oct 20, 2026
…pstream)

Grid lanes (css-grid-3) is defined on top of Grid's track sizing algorithm:
it imports <track-size>, minmax(), fr, repeat(), auto-fill/auto-fit and
line placement from css-grid-2 by name. That algorithm does not exist in
our tree — PR 1/9 of the upstream series landed the style types
(GridTrackSize, GridLine, gridTemplateColumns/Rows) but not the algorithm
behind them.

Rather than write a second one-axis track sizer, vendor the upstream
implementation verbatim:

  react/yoga#1894 "CSS Grid 2/9: Grid layout algorithm"
  by Nishan Bende (intergalacticspacehighway), open since 2026-02-25

  algorithm/grid/AutoPlacement.h   css-grid-1 §8.5 auto-placement
  algorithm/grid/GridLayout.{h,cpp} entry point, implicit tracks
  algorithm/grid/GridTrack.h        per-track layout state
  algorithm/grid/TrackSizing.h      css-grid-2 §12 track sizing

TrackSizing is parameterized by Dimension — it runs per axis — which is
exactly the shape grid lanes needs, since lanes sizes tracks in the grid
axis only and flows content in the other.

Not our code: nothing in algorithm/grid/ is modified, so that directory
can be deleted wholesale and replaced when the upstream series lands
instead of being merged. Only the integration points are ours, and only
because the PR could not supply them — our CalculateLayout.cpp has
diverged (block formatting contexts) and our Yoga is 197 commits behind:

  - CalculateLayout.cpp: the Display::Grid dispatch, next to Display::Block
  - yoga/CMakeLists.txt: an explicit algorithm/grid/*.cpp glob, since
    CMake's ** matches one level; Android builds through this same file
    and iOS globs recursively via the podspec

The PR's YGNodeStyle.cpp hunk is deliberately omitted: it adds a fallback
return to silence GCC -Wreturn-type, and our tree already handles those
switches better with fatalWithMessage("Unknown YGGridTrackType").

Verified, not assumed: verify-grid-vendor.sh builds yogacore with the
vendored directory and lays out

  display: grid; width: 600px; gap: 10px;
  grid-template-columns: 100px 1fr 2fr; grid-template-rows: 50px auto;

comparing every coordinate against the same CSS rendered by real Safari
(grid-vendor-verify.html, read via safaridriver). 25/25 values match
exactly, including fr distribution (160/320 of 480 remaining) and the
auto row resolving to its tallest item.

Upstream status: react#1894 is being re-split after review — react#1923 (data
structures) and react#1994 (auto-placement) are open, but the track-sizing
split has not been posted, which is why this vendors the original PR.
See algorithm/grid/README-VENDORED.md.

A third local fix, listed in README-VENDORED.md: the fit-content clamp in the inline axis was never applied, so a grid measured under a fit-content width reported its max-content width. It is now min(max-content, max(min-content, available)), its tracks sized again at the available width when the max-content exceeds it.

A fourth: three steps of the track sizing gave an `auto` minimum an item's limited min-content contribution whenever Yoga's sizing mode was `MaxContent`, which is also how Yoga lays out an `auto` block size; that size is indefinite free space, not a max-content constraint, so a `0fr` row over an item with `min-height: 0` (the accordion idiom) stood as tall as the item's content. Only the inline axis is measured under a real max-content constraint now. `GridZeroFrRow-itest.js` pins it.

Co-authored-by: ide <379606+ide@users.noreply.github.com>
ide-agent pushed a commit to expo/react-native that referenced this pull request Oct 20, 2026
…pstream)

Grid lanes (css-grid-3) is defined on top of Grid's track sizing algorithm:
it imports <track-size>, minmax(), fr, repeat(), auto-fill/auto-fit and
line placement from css-grid-2 by name. That algorithm does not exist in
our tree — PR 1/9 of the upstream series landed the style types
(GridTrackSize, GridLine, gridTemplateColumns/Rows) but not the algorithm
behind them.

Rather than write a second one-axis track sizer, vendor the upstream
implementation verbatim:

  react/yoga#1894 "CSS Grid 2/9: Grid layout algorithm"
  by Nishan Bende (intergalacticspacehighway), open since 2026-02-25

  algorithm/grid/AutoPlacement.h   css-grid-1 §8.5 auto-placement
  algorithm/grid/GridLayout.{h,cpp} entry point, implicit tracks
  algorithm/grid/GridTrack.h        per-track layout state
  algorithm/grid/TrackSizing.h      css-grid-2 §12 track sizing

TrackSizing is parameterized by Dimension — it runs per axis — which is
exactly the shape grid lanes needs, since lanes sizes tracks in the grid
axis only and flows content in the other.

Not our code: nothing in algorithm/grid/ is modified, so that directory
can be deleted wholesale and replaced when the upstream series lands
instead of being merged. Only the integration points are ours, and only
because the PR could not supply them — our CalculateLayout.cpp has
diverged (block formatting contexts) and our Yoga is 197 commits behind:

  - CalculateLayout.cpp: the Display::Grid dispatch, next to Display::Block
  - yoga/CMakeLists.txt: an explicit algorithm/grid/*.cpp glob, since
    CMake's ** matches one level; Android builds through this same file
    and iOS globs recursively via the podspec

The PR's YGNodeStyle.cpp hunk is deliberately omitted: it adds a fallback
return to silence GCC -Wreturn-type, and our tree already handles those
switches better with fatalWithMessage("Unknown YGGridTrackType").

Verified, not assumed: verify-grid-vendor.sh builds yogacore with the
vendored directory and lays out

  display: grid; width: 600px; gap: 10px;
  grid-template-columns: 100px 1fr 2fr; grid-template-rows: 50px auto;

comparing every coordinate against the same CSS rendered by real Safari
(grid-vendor-verify.html, read via safaridriver). 25/25 values match
exactly, including fr distribution (160/320 of 480 remaining) and the
auto row resolving to its tallest item.

Upstream status: react#1894 is being re-split after review — react#1923 (data
structures) and react#1994 (auto-placement) are open, but the track-sizing
split has not been posted, which is why this vendors the original PR.
See algorithm/grid/README-VENDORED.md.

A third local fix, listed in README-VENDORED.md: the fit-content clamp in the inline axis was never applied, so a grid measured under a fit-content width reported its max-content width. It is now min(max-content, max(min-content, available)), its tracks sized again at the available width when the max-content exceeds it.

A fourth: three steps of the track sizing gave an `auto` minimum an item's limited min-content contribution whenever Yoga's sizing mode was `MaxContent`, which is also how Yoga lays out an `auto` block size; that size is indefinite free space, not a max-content constraint, so a `0fr` row over an item with `min-height: 0` (the accordion idiom) stood as tall as the item's content. Only the inline axis is measured under a real max-content constraint now. `GridZeroFrRow-itest.js` pins it.

Co-authored-by: ide <379606+ide@users.noreply.github.com>
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants