[Feature] Support CSS Grid #867

Open
opened 2019-03-04 19:15:21 -08:00 by polarathene · 37 comments
polarathene commented 2019-03-04 19:15:21 -08:00 (Migrated from github.com)

Report

It's been advised to open a new issue (from this closed issue from 2015). Related react-native issue

It's been 4 years since the issue was closed. This issue is to request evaluating if supporting display: grid is worth reconsidering now.

It is the 11th 8th top request(1st in regards to layout, 8th 3rd trending) at 229(Mar 2019) 359(Feb 2020) votes on React-Native feature requests, the feature request was created in December 2017 with steady response of support from users since then.

# Report - [x] I have searched [existing issues](https://github.com/facebook/yoga/issues) and this is not a duplicate It's been advised to open a new issue (from [this closed issue](https://github.com/facebook/yoga/issues/47) from 2015). [Related react-native issue](https://github.com/react-native-community/discussions-and-proposals/issues/90) It's been 4 years since the issue was closed. This issue is to request evaluating if supporting `display: grid` is worth reconsidering now. It is the ~~11th~~ 8th top request(1st in regards to layout, ~~8th~~ 3rd trending) at ~~229(Mar 2019)~~ 359(Feb 2020) votes on [React-Native feature requests](https://react-native.canny.io/feature-requests/p/css-grid-layout-supporting), the feature request was created in December 2017 with steady response of support from users since then.
TomMarius commented 2019-04-27 14:39:11 -07:00 (Migrated from github.com)

I'd like to voice my support.

I'd like to voice my support.
polarathene commented 2019-04-27 16:17:31 -07:00 (Migrated from github.com)

I'd like to voice my support.

Great! Just give it a positive reaction like many others have done :)

(That goes for anyone else that has an itch to make a +1 comment)

> I'd like to voice my support. Great! Just give it a positive reaction like many others have done :) (That goes for anyone else that has an itch to make a **+1** comment)
bnjm commented 2019-04-28 03:48:19 -07:00 (Migrated from github.com)

Is anyone aware of other efforts to make a cross-platform implementation of CSS Grid? I would love to support this. It's worth remembering that CSS Grid has a larger API surface area than Flexbox, so adding it here would be quite an undertaking and a big change to Yoga. Maybe a way forward would be a separate project which could serve as a reference or proof of concept.

Is anyone aware of other efforts to make a cross-platform implementation of CSS Grid? I would love to support this. It's worth remembering that CSS Grid has a larger API surface area than Flexbox, so adding it here would be quite an undertaking and a big change to Yoga. Maybe a way forward would be a separate project which could serve as a reference or proof of concept.
FremyCompany commented 2019-04-28 14:45:36 -07:00 (Migrated from github.com)

@bnjm The css grid polyfill is completely web-independent, and supports most grid features already.
https://github.com/facebook/yoga/issues/47

@bnjm The css grid polyfill is completely web-independent, and supports most grid features already. https://github.com/facebook/yoga/issues/47
rolme commented 2019-05-21 05:38:39 -07:00 (Migrated from github.com)

+1 to get CSS Grid as part of Yoga (and potentially part of React-Native)

+1 to get CSS Grid as part of Yoga (and potentially part of React-Native)
henrique25teles commented 2019-09-27 21:15:12 -07:00 (Migrated from github.com)

I would like that

I would like that
dlangston commented 2020-01-28 10:10:42 -08:00 (Migrated from github.com)

Any update on this?
It would be nice to have Grids as part of Yoga otherwise it seems very incomplete.

Any update on this? It would be nice to have Grids as part of Yoga otherwise it seems very incomplete.
RodRitter commented 2020-02-10 01:55:05 -08:00 (Migrated from github.com)

Please, this would be huge. Since most browsers support this in some way, we're starting to use CSS grid as a standard in our React dev. Would be great to be in sync with RN dev.

Please, this would be huge. Since most browsers support this in some way, we're starting to use CSS grid as a standard in our React dev. Would be great to be in sync with RN dev.
damianobarbati commented 2020-02-10 18:46:45 -08:00 (Migrated from github.com)

@RodRitter same problem for me.

@RodRitter same problem for me.
polarathene commented 2020-02-11 03:05:39 -08:00 (Migrated from github.com)

Some of you might be interested to know about a year ago an alternative was announced called Stretch:

I led the Yoga team at Facebook solving exactly this problem. My team built the underlying cross-platform layout engine powering React Native as well as a handful of other internal and open source frameworks. Naturally when we started work on Visly we decided to base it on Yoga, a proven cross-platform layout engine. So why create stretch?

We wanted to move faster than was possible when building on top of Yoga. Due to Yoga powering most of Facebook’s mobile surfaces it is incredibly difficult to make any changes to the algorithm.

And 9 months ago, HackerNews thread, author replies:

Stretch doesn't really enable any new kind of layouts that yoga doesn't but it fixes some fundamental problems in Yoga where Yoga was not compatible with the web implementations.

Long term goal of Stretch is to support multiple layout systems including Grid layout I just started with Flexbox because I know that so well :) Look forward to tackling grid layout soonish (contributions / help very welcome).

Website: https://vislyhq.github.io/stretch/


While it's probably of no use to the majority here that probably want CSS Grid to land in yoga for usage in React-Native, anyone that would be open towards stretch as an alternative, I've raised a related tracking issue for CSS Grid support over on the stretch repo.

Almost a year in since creating this issue, it would be fantastic to hear back from a dev of this project, if there is any hope for seeing Grid support arrive in future.

Some of you might be interested to know about a year ago an alternative [was announced called Stretch](https://medium.com/visly/stretch-a-flexbox-implementation-in-rust-60762b5a3331): > I led the Yoga team at Facebook solving exactly this problem. My team built the underlying cross-platform layout engine powering React Native as well as a handful of other internal and open source frameworks. Naturally when we started work on Visly we decided to base it on Yoga, a proven cross-platform layout engine. So why create stretch? > We wanted to move faster than was possible when building on top of Yoga. Due to Yoga powering most of Facebook’s mobile surfaces it is incredibly difficult to make any changes to the algorithm. And [9 months ago, HackerNews thread](https://news.ycombinator.com/item?id=19780790), author replies: > Stretch doesn't really enable any new kind of layouts that yoga doesn't but it fixes some fundamental problems in Yoga where Yoga was not compatible with the web implementations. > Long term goal of Stretch is to support multiple layout systems including Grid layout I just started with Flexbox because I know that so well :) Look forward to tackling grid layout soonish (contributions / help very welcome). Website: https://vislyhq.github.io/stretch/ --- While it's probably of no use to the majority here that probably want CSS Grid to land in yoga for usage in React-Native, anyone that would be open towards `stretch` as an alternative, [I've raised a related tracking issue for CSS Grid support over on the stretch repo](https://github.com/vislyhq/stretch/issues/63). Almost a year in since creating this issue, it would be fantastic to hear back from a dev of this project, if there is any hope for seeing Grid support arrive in future.
calumjames commented 2020-02-11 03:49:10 -08:00 (Migrated from github.com)

Agreed!

It’s much harder to share components between web and native if we can’t use grid for component layout in one, when it’s such a lovely feature of making components on the web now.

Sent from my iPhone

On 10 Feb 2020, at 09:55, Rod Ritter notifications@github.com wrote:


Please, this would be huge. Since most browsers support this in some way, we're starting to use CSS grid as a standard in our web dev. Would be great to be in sync with RN dev.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Agreed! It’s much harder to share components between web and native if we can’t use grid for component layout in one, when it’s such a lovely feature of making components on the web now. Sent from my iPhone > On 10 Feb 2020, at 09:55, Rod Ritter <notifications@github.com> wrote: > >  > Please, this would be huge. Since most browsers support this in some way, we're starting to use CSS grid as a standard in our web dev. Would be great to be in sync with RN dev. > > — > You are receiving this because you are subscribed to this thread. > Reply to this email directly, view it on GitHub, or unsubscribe.
damianobarbati commented 2020-04-23 02:33:21 -07:00 (Migrated from github.com)

Any news on this? 🙏🏼

Any news on this? 🙏🏼
polarathene commented 2020-04-23 10:16:46 -07:00 (Migrated from github.com)

The mentioned stretch project recently started discussing how to start implementing Grid support.

Doesn't seem like there's any interest from devs on yoga. Perhaps at a later date it may be possible to substitute yoga for stretch?

Just subscribe to the issue if you haven't already and you'll be informed of any news. No need to notify everyone with a new message asking, we see the same issue thread content as you 👀

Let's try avoid requests for updates, cheers 👍

The mentioned stretch project recently started discussing how to start implementing Grid support. Doesn't seem like there's any interest from devs on yoga. Perhaps at a later date it may be possible to substitute yoga for stretch? Just subscribe to the issue if you haven't already and you'll be informed of any news. No need to notify everyone with a new message asking, we see the same issue thread content as you :eyes: Let's try avoid requests for updates, cheers :+1:
ghost commented 2020-07-16 12:26:20 -07:00 (Migrated from github.com)

I'm fairly used to use CSS Grid instead of Flexbox in web development. Lack of support for CSS Grid is a deal-breaker to me.

I'm fairly used to use CSS Grid instead of Flexbox in web development. Lack of support for CSS Grid is a deal-breaker to me.
nativeforest commented 2020-10-08 10:47:27 -07:00 (Migrated from github.com)

i hope stretch substitute for yoga.

i hope stretch substitute for yoga.
mmdevcodes commented 2020-11-29 04:37:30 -08:00 (Migrated from github.com)

Would be a great addition

Would be a great addition
ebouJ commented 2020-12-24 21:43:52 -08:00 (Migrated from github.com)

Update in 2020? Ooops it's almost 2021

Update in 2020? Ooops it's almost 2021
ghost commented 2021-04-28 20:21:53 -07:00 (Migrated from github.com)

Update in 2021 ? 2022 will be come

Update in 2021 ? 2022 will be come
polarathene commented 2021-05-06 17:09:17 -07:00 (Migrated from github.com)

Commenting here for the sole purpose of asking for updates or expressing interest doesn't serve any purpose or provide any value than all those that have done the same before you.

Please refrain from this behaviour.

It just annoys all those who are subscribed for notifications and actually hoping to see an update with positive news.


Before adding a comment and notifying everyone here, please consider the following:

  • If you want to express interest and support for the feature, awesome! Please use the emoji reaction features on the original issue message up top. Additionally vote it up on the linked RN feature request page 👍
  • If you feel compelled to +1, ask for updates, or anything like this. Please consider doing so through another channel.
    • To be heard any differently than what we've tried here, you must reach out to someone who can actually do something about it. It doesn't appear they will notice anything via this issue alone.
  • No maintainer / collaborator has expressed interest in this issue to have the feature developed.
    • Nor has one chimed in with a reason against the feature to close the issue.
    • I will keep the issue open until one of these outcomes decides otherwise.
  • The alternative (Stretch) seems to have become stagnant with no activity on the grid feature. If that changes and sharing an update here would be beneficial to notify all subscribers, let us know 👍

Someone has to want the feature enough to devote the time into making it happen and that likely won't happen without decent financial backing / incentive.

The best we can do is show demand for it as users (as described above)..... and be patient. Alternatively setup a bounty and pool funds into that.

Commenting here for the sole purpose of asking for updates or expressing interest doesn't serve any purpose or provide any value than all those that have done the same before you. ### Please refrain from this behaviour. It just annoys all those who are subscribed for notifications and actually hoping to see an update with positive news. --- Before adding a comment and notifying everyone here, please consider the following: - **If you want to express interest and support for the feature**, awesome! Please use the emoji reaction features on the original issue message up top. Additionally vote it up on the linked RN feature request page :+1: - **If you feel compelled to +1, ask for updates, or anything like this.** Please consider doing so through another channel. - To be heard any differently than what we've tried here, you must reach out to someone who can actually do something about it. It doesn't appear they will notice anything via this issue alone. - **No maintainer / collaborator has expressed interest** in this issue to have the feature developed. - Nor has one chimed in with a reason against the feature to close the issue. - I will keep the issue open until one of these outcomes decides otherwise. - **The alternative (`Stretch`)** seems to have become stagnant with no activity on the grid feature. If that changes and sharing an update here would be beneficial to notify all subscribers, let us know :+1: Someone has to want the feature enough to devote the time into making it happen and that likely won't happen without decent financial backing / incentive. The best we can do is show demand for it as users (as described above)..... and be patient. Alternatively setup a bounty and pool funds into that.
damianobarbati commented 2021-08-06 05:59:15 -07:00 (Migrated from github.com)

@TheEhsanSarshar I would not say there's no traction on this, we have 600+ emoji on the top post.
What's the "emoji threshold" to consider the issue not-worthy from the users point of view?

For any team who built its web-application on css-grid feature, having react-native not supporting it is a deal breaker (and btw I seriously don't see any reason to create layouts with flex in 2021, beyond supporting IE11).

But if the yoga team is not considering this feature, a clean statement like "we are not working on this in the foreseeable future" would be much appreciated when closing this issue! 🙃

@TheEhsanSarshar I would not say there's no traction on this, we have 600+ emoji on the top post. What's the "emoji threshold" to consider the issue not-worthy from the users point of view? For any team who built its web-application on css-grid feature, having react-native not supporting it is a deal breaker (and btw I seriously don't see any reason to create layouts with flex in 2021, beyond supporting IE11). But if the yoga team is not considering this feature, a clean statement like "we are not working on this in the foreseeable future" would be much appreciated when closing this issue! 🙃
nicoburns commented 2023-01-11 07:41:09 -08:00 (Migrated from github.com)

A bit of an update for everyone on this issue:

The alternative (Stretch) seems to have become stagnant with no activity on the grid feature. If that changes and sharing an update here would be beneficial to notify all subscribers, let us know

Stretch was forked as Taffy in May 2022 under the auspices of the bevy and dioxus projects, and is now seeing regular maintenance, as well as new feature development work.

It should be noted that unlike Stretch, Taffy does not currently have bindings to languages other than Rust. However, we are open to adding them, and would welcome contributors interested in developing and maintaining such bindings (and we'd be able to provide mentorship on the Rust side of things).

Is anyone aware of other efforts to make a cross-platform implementation of CSS Grid?

Also relevant to this issue: we have an in-progress implementation of CSS Grid! The CSS Grid implementation is mostly feature complete at this point, but there are still a few bits of functionality (like baseline alignment) and a lot of testing that needs to happen before we are ready to put out a stable release. For those of you who are interested in using a CSS Grid implementation as a library in their own (non react-native) projects, we have put out an alpha release that you could play with today. And you can track the progress of the CSS Grid implementation in tracking issue (https://github.com/DioxusLabs/taffy/issues/204)


Those who are looking CSS Grid support in React Native specifically may be interested in RFC: Vision for Layout Conformance/Parity, which sets out React Native's vision for layout going forwards. As you can see, they have considered Taffy, but are not planning to adopt it in React Native. I also had some further discussion with @NickGerleman (who has recently taken over maintenance of Yoga, and has already been implementing some welcome and long overdue improvements to things like the build system) where it was explained that the primary reason for this is a strong commitment to bug-for-bug backwards compatibility in React Native's layout engine (on the basis that bugs caused by changes in layout will likely be silent and hard to detect) and a belief that it will be hard to maintain that if switching to a new layout engine (a belief I am inclined to agree with FWIW).

Thus, in terms of getting CSS Grid support into React Native, it seems like the best path forwards may be porting Taffy's implementation into Yoga. This is by no means a small task, and would involve refactoring the existing Flexbox implementation to interoperate with another layout algorithm (while maintaining bug-for-bug compatibility with the existing implementation - possibly behind a flag), as well as implementing the grid algorithm itself. But I think it is achievable with enough effort, and it would be aided by the fact that Taffy is a derivative of Yoga and that the structure of the two projects is still largely similar.

A bit of an update for everyone on this issue: > The alternative (Stretch) seems to have become stagnant with no activity on the grid feature. If that changes and sharing an update here would be beneficial to notify all subscribers, let us know [Stretch](https://github.com/vislyhq/stretch) was forked as [Taffy](https://github.com/DioxusLabs/taffy) in May 2022 under the auspices of the [bevy](https://bevyengine.org/) and [dioxus](https://dioxuslabs.com/) projects, and is now seeing regular maintenance, as well as new feature development work. It should be noted that unlike Stretch, Taffy does not currently have bindings to languages other than Rust. However, we are open to adding them, and would welcome contributors interested in developing and maintaining such bindings (and we'd be able to provide mentorship on the Rust side of things). > Is anyone aware of other efforts to make a cross-platform implementation of CSS Grid? Also relevant to this issue: we have an in-progress implementation of CSS Grid! The CSS Grid implementation is mostly feature complete at this point, but there are still a few bits of functionality (like baseline alignment) and a lot of testing that needs to happen before we are ready to put out a stable release. For those of you who are interested in using a CSS Grid implementation as a library in their own (non react-native) projects, we have put out an alpha release that you could play with today. And you can track the progress of the CSS Grid implementation in tracking issue (https://github.com/DioxusLabs/taffy/issues/204) --- Those who are looking CSS Grid support in React Native specifically may be interested in [RFC: Vision for Layout Conformance/Parity](https://github.com/react-native-community/discussions-and-proposals/pull/540/files#diff-ab24e431152412e4f4fd2c0e033c8fc4cb2e594ec7c17eda2000256b3cd741ba), which sets out React Native's vision for layout going forwards. As you can see, they have considered Taffy, but are not planning to adopt it in React Native. I also had some [further discussion](https://github.com/react-native-community/discussions-and-proposals/pull/540/files#r1053389551) with @NickGerleman (who has recently taken over maintenance of Yoga, and has already been implementing some welcome and long overdue improvements to things like the build system) where it was explained that the primary reason for this is a strong commitment to bug-for-bug backwards compatibility in React Native's layout engine (on the basis that bugs caused by changes in layout will likely be silent and hard to detect) and a belief that it will be hard to maintain that if switching to a new layout engine (a belief I am inclined to agree with FWIW). Thus, in terms of getting CSS Grid support into React Native, it seems like the best path forwards may be porting Taffy's implementation into Yoga. This is by no means a small task, and would involve refactoring the existing Flexbox implementation to interoperate with another layout algorithm (while maintaining bug-for-bug compatibility with the existing implementation - possibly behind a flag), as well as implementing the grid algorithm itself. But I think it is achievable with enough effort, and it would be aided by the fact that Taffy is a derivative of Yoga and that the structure of the two projects is still largely similar.
NickGerleman commented 2023-01-12 02:16:09 -08:00 (Migrated from github.com)

It would be amazing to see this materialize. CSS Grid is something the React Native ecosystem has wanted for a long time, and this thread has many other users of Yoga who would benefit from it as well. I have also suspected CSS Grid would be a valuable enough addition to React Native that we could use it as a tool to start driving users to migrate their apps to conformant behavior.

As I'm sure you can tell by the other thread "how can we do this safely" is very top-of-mind. These sorts of shifts have to be done piecemeal, but I do think we have concrete ways to do them. E.g. WPT fixtures for validating the conformance of new changes, or perf testing for any sort of major algorithm change (I don't have confidence the current tests would catch many real-world issues here).

refactoring the existing Flexbox implementation to interoperate with another layout algorithm (while maintaining bug-for-bug compatibility with the existing implementation - possibly behind a flag)

My ideal would be for Yoga to be conformant by default. The fear of behavior changes has been a stall on Yoga's development that we need to move past, but we need to be smart about it.

The model I have been exploring for that is that we:

  1. Add the change, behind a YGExperimentalFeature
  2. Add a branch in code, to set a flag on the Node layout result if the old path was used and would result in a layout change under the new path
  3. Expose the result under an API YGNodeLayoutAffectedByQuirk
    1. Call this within app code, and fire an event if ever true
  4. Measure % sessions in some real apps where we would see a shift
  5. Add the fix, with a legacy flag if there is carnage (some threshold we will need to define 😉)
  6. (In React Native) If there was enough carnage for a flag, lock it behind StrictLayout

Have some work drafted to start doing this for 7e96b65790, adding YGQuirkAbsolutePercentageAgainstWrongEdge and YGQuirkTrailingColumnMarginIncorrect.

There are also some apps and frameworks inside of Meta which depend on the latest Yoga, but are no longer being actively developed. They won't see any benefit from the new things happening, and are one of the larger risk-areas to our own usage since they are more eyes-off, so I have been working to see if I can freeze them on an older version of Yoga to give a little bit more breathing room to make changes.

It would be amazing to see this materialize. CSS Grid is something the React Native ecosystem has wanted for a long time, and this thread has many other users of Yoga who would benefit from it as well. I have also suspected CSS Grid would be a valuable enough addition to React Native that we could use it as a tool to start driving users to migrate their apps to conformant behavior. As I'm sure you can tell by the other thread "how can we do this safely" is very top-of-mind. These sorts of shifts have to be done piecemeal, but I do think we have concrete ways to do them. E.g. WPT fixtures for validating the conformance of new changes, or perf testing for any sort of major algorithm change (I don't have confidence the current tests would catch many real-world issues here). > refactoring the existing Flexbox implementation to interoperate with another layout algorithm (while maintaining bug-for-bug compatibility with the existing implementation - possibly behind a flag) My ideal would be for Yoga to be conformant by default. The fear of behavior changes has been a stall on Yoga's development that we need to move past, but we need to be smart about it. The model I have been exploring for that is that we: 1. Add the change, behind a YGExperimentalFeature 2. Add a branch in code, to set a flag on the Node layout result if the old path was used and would result in a layout change under the new path 3. Expose the result under an API `YGNodeLayoutAffectedByQuirk` 1. Call this within app code, and fire an event if ever true 4. Measure % sessions in some real apps where we would see a shift 5. Add the fix, with a legacy flag if there is carnage (some threshold we will need to define 😉) 6. (In React Native) If there was enough carnage for a flag, lock it behind StrictLayout Have some work drafted to start doing this for 7e96b65790c53359583e480776278159556b7def, adding `YGQuirkAbsolutePercentageAgainstWrongEdge` and `YGQuirkTrailingColumnMarginIncorrect`. There are also some apps and frameworks inside of Meta which depend on the latest Yoga, but are no longer being actively developed. They won't see any benefit from the new things happening, and are one of the larger risk-areas to our own usage since they are more eyes-off, so I have been working to see if I can freeze them on an older version of Yoga to give a little bit more breathing room to make changes.
nicoburns commented 2023-02-13 04:02:01 -08:00 (Migrated from github.com)

The stable 0.3 release of Taffy with CSS Grid was released yesterday. So it's now ready both for production usage, and for porting should anyone wish to take that on.


@NickGerleman

They won't see any benefit from the new things happening, and are one of the larger risk-areas to our own usage since they are more eyes-off, so I have been working to see if I can freeze them on an older version of Yoga to give a little bit more breathing room to make changes.

It has occured to me that the first step towards supporting CSS Grid in Yoga would be refactoring the flexbox implementation such that when it needs to measure children it is able to call into another algorithm rather than always calling recursively into itself. And if we're making this change anyway, I'm wondering if it would make sense to duplicate the flexbox algorithm into "legacy flexbox" (frozen in the current state) and "modern flexbox" (where we could go to town on the breaking changes - perhaps with an effort to get it quite close to standards compliant for the first release so that the breaking changes are mostly a one-off rather than an ongoing thing). This might be simpler than trying to feature flag everything on a fine-grained level...

Taffy uses this trait for this purpose, and in C++ you'd presumably want to use an interface. Making the algorithm logic generic over an interface provides two other benefits:

  • It decouples the algorithm code from the node storage code, meaning that if Yoga users already have their own tree they can lazily convert styles from that tree into Yoga's format rather than needing the eagerly duplicate everything into a yoga-specific tree.
  • It allows users of Yoga to take control flow back between each node in the tree and inject their own logic at this point. This could be logic like switching between strict/legacy modes, it could be calling into entirely different layout logic (e.g. FlexLayout, Taffy, or non-css layout modes like AutoLayout, but also things like text layout). It therefore also subsumes the need for MeasureFuncs as it basically is a more powerful variant of MeasureFuncs.

Taffy offers both a low-level API where the user of the library implements the above trait and handles things like caching and tree iteration logic themselves and a high-level API akin the one Yoga currently offers.

The stable 0.3 release of Taffy with CSS Grid was [released yesterday](https://github.com/DioxusLabs/taffy/releases/tag/v0.3.0). So it's now ready both for production usage, and for porting should anyone wish to take that on. --- @NickGerleman > They won't see any benefit from the new things happening, and are one of the larger risk-areas to our own usage since they are more eyes-off, so I have been working to see if I can freeze them on an older version of Yoga to give a little bit more breathing room to make changes. It has occured to me that the first step towards supporting CSS Grid in Yoga would be refactoring the flexbox implementation such that when it needs to measure children it is able to call into another algorithm rather than always calling recursively into itself. And if we're making this change anyway, I'm wondering if it would make sense to duplicate the flexbox algorithm into "legacy flexbox" (frozen in the current state) and "modern flexbox" (where we could go to town on the breaking changes - perhaps with an effort to get it quite close to standards compliant for the first release so that the breaking changes are mostly a one-off rather than an ongoing thing). This might be simpler than trying to feature flag everything on a fine-grained level... Taffy uses [this trait](https://github.com/DioxusLabs/taffy/blob/bb3bb235d665cb899c47d1dceff4105e78fd72b0/src/tree.rs) for this purpose, and in C++ you'd presumably want to use an interface. Making the algorithm logic generic over an interface provides two other benefits: - It decouples the algorithm code from the node storage code, meaning that if Yoga users already have their own tree they can lazily convert styles from that tree into Yoga's format rather than needing the eagerly duplicate everything into a yoga-specific tree. - It allows users of Yoga to take control flow back between each node in the tree and inject their own logic at this point. This could be logic like switching between strict/legacy modes, it could be calling into entirely different layout logic (e.g. FlexLayout, Taffy, or non-css layout modes like AutoLayout, but also things like text layout). It therefore also subsumes the need for MeasureFuncs as it basically is a more powerful variant of MeasureFuncs. Taffy offers both a low-level API where the user of the library implements the above trait and handles things like caching and tree iteration logic themselves and a high-level API akin the one Yoga currently offers.
damianobarbati commented 2024-11-18 02:13:57 -08:00 (Migrated from github.com)

@nicoburns how can someone use taffy in react-native? It's not completely clear to me.

@nicoburns how can someone use taffy in react-native? It's not completely clear to me.
ScottHaval commented 2025-06-18 07:33:10 -07:00 (Migrated from github.com)

This is a joke.

Introduce CSS Grid for React Native. It's been 5 years.

Flex is cringe.

This is a joke. Introduce CSS Grid for React Native. It's been 5 years. Flex is cringe.
ScottHaval commented 2025-06-18 15:12:03 -07:00 (Migrated from github.com)

@rmacqueen @MoOx

I have no idea why you are both downvoting me.

It is absolutely ridiculous that this request has existed since 2015 and YET to be implemented.

With the previous issue on this, the representative from the Yoga team said he had "no interest" in working on it purely due to personal bias despite it being a highly requested feature.

CSS Grid smoothly creates responsiveness across all devices with pure CSS rather than trying to access the Client's window dimensions or use that garbage Flex which everyone doesn't like.

There's a time and place for overt positivity but this is beyond ridiculous.

With CSS Grid supported on React Native, I could enable complete responsiveness for my universal app across web, mobile browsers, tablets, mobile devices and desktop apps for mapped lists of data.

Instead, I have to use the garbage that is Flex.

So kindly don't downvote me if you have nothing to contribute to a TEN year old request which has thousands of people supporting its implementation.

@rmacqueen @MoOx I have no idea why you are both downvoting me. It is absolutely ridiculous that this request has existed since 2015 and YET to be implemented. With the previous issue on this, the representative from the Yoga team said he had "no interest" in working on it purely due to personal bias despite it being a highly requested feature. CSS Grid smoothly creates responsiveness across all devices with pure CSS rather than trying to access the Client's window dimensions or use that garbage Flex which everyone doesn't like. There's a time and place for overt positivity but this is beyond ridiculous. With CSS Grid supported on React Native, I could enable complete responsiveness for my universal app across web, mobile browsers, tablets, mobile devices and desktop apps for mapped lists of data. Instead, I have to use the garbage that is Flex. So kindly don't downvote me if you have nothing to contribute to a TEN year old request which has thousands of people supporting its implementation.
mordechaim commented 2025-06-18 15:20:36 -07:00 (Migrated from github.com)

You forgot to renew your react native subscription.

Upgrade to the pro license and they might prioritize this feature

You forgot to renew your react native subscription. Upgrade to the pro license and they might prioritize this feature
ScottHaval commented 2025-06-18 15:28:50 -07:00 (Migrated from github.com)

You forgot to renew your react native subscription.
Upgrade to the pro license and they might prioritize this feature

I already paid Zuckerberg with 20 years in free personal data collection.

> You forgot to renew your react native subscription. > Upgrade to the pro license and they might prioritize this feature I already paid Zuckerberg with 20 years in free personal data collection.
hlspablo commented 2025-06-18 15:30:07 -07:00 (Migrated from github.com)

@scotthavalosman why don't you fork the Yoga and bring it to the community instead of complain about an open source project.

@scotthavalosman why don't you fork the Yoga and bring it to the community instead of complain about an open source project.
MoOx commented 2025-06-18 15:32:00 -07:00 (Migrated from github.com)

Hey @scotthavalosman, I get that this issue might be frustrating, but complaining without bringing anything to the table helps no one.
You’re showing up here acting like a child — that’s not how open source works.

People contribute when it makes sense for their project, company, or simply when they have time. Acting like this will never motivate anyone to help you.

If this is critical for you, step up: open a PR, propose actionable ideas, or make a solid case to inspire others to prioritize it. That’s how you lead — by creating motivation and engagement around what you want to see happen.

And let’s be real: your opinion isn’t the truth. Personally, I think CSS grid is one of the worst APIs out there — but you don’t see me yelling about it. I use flexbox, and if I need something else, I try to make it happen. I open discussions, stay open-minded, and work to convince people why something’s worth tackling. That’s the way forward.

Otherwise, please stop posting just to vent. We’re here to collaborate — not to babysit frustration.

Hey @scotthavalosman, I get that this issue might be frustrating, but complaining without bringing anything to the table helps no one. You’re showing up here acting like a child — that’s not how open source works. People contribute when it makes sense for their project, company, or simply when they have time. Acting like this will never motivate anyone to help you. If this is critical for you, step up: open a PR, propose actionable ideas, or make a solid case to inspire others to prioritize it. That’s how you lead — by creating motivation and engagement around what you want to see happen. And let’s be real: your opinion isn’t the truth. Personally, I think CSS grid is one of the worst APIs out there — but you don’t see me yelling about it. I use flexbox, and if I need something else, I try to make it happen. I open discussions, stay open-minded, and work to convince people why something’s worth tackling. That’s the way forward. Otherwise, please stop posting just to vent. We’re here to collaborate — not to babysit frustration.
ScottHaval commented 2025-06-18 15:32:42 -07:00 (Migrated from github.com)

@hlspablo I don't think I'm adept enough at doing that – But if you point me in the right direction or provide an action plan, I'll give it a shot because I desperately need CSS Grid support in RN.

@hlspablo I don't think I'm adept enough at doing that – But if you point me in the right direction or provide an action plan, I'll give it a shot because I desperately need CSS Grid support in RN.
hlspablo commented 2025-06-18 15:43:26 -07:00 (Migrated from github.com)

@scotthavalosman try to start creating a css lib that offer the css grid surface api, but that uses flebox under the hood. I think in Yoga issues you gonna find in depth discussions about css grid implementation. The effort is massive and would introduce breaking chances all over the code. Maybe the solution would be a new rendeding system, based on Yoga, optionally offered with some flag.

@scotthavalosman try to start creating a css lib that offer the css grid surface api, but that uses flebox under the hood. I think in Yoga issues you gonna find in depth discussions about css grid implementation. The effort is massive and would introduce breaking chances all over the code. Maybe the solution would be a new rendeding system, based on Yoga, optionally offered with some flag.
ScottHaval commented 2025-06-18 15:44:15 -07:00 (Migrated from github.com)

@MoOx

What is your justification in believing CSS Grid is inferior to using flexbox?

CSS Grid provides immediate responsiveness, streamlined code, no window dimensions from the client, is flexible with minmax, and can easily be used Server-Side – pure CSS.

We are moving towards a future where people will build Universal applications. Write once, Render everywhere.

The device you are using will become largely irrelevant in the face of these new frameworks.

All that will matter is your screen-size and immediate responsiveness.

SSR + Universal App + Deploy Once, Render Everywhere is the future.

Supporting using Flexbox over CSS Grid is like a boomer supporting Cheques over Bitcoin.

BUT who knows – maybe I am wrong. Thanks for pointing me in the right direction. I will look into trying to solve it myself.

@MoOx What is your justification in believing CSS Grid is inferior to using flexbox? CSS Grid provides immediate responsiveness, streamlined code, no window dimensions from the client, is flexible with minmax, and can easily be used Server-Side – pure CSS. We are moving towards a future where people will build Universal applications. Write once, Render everywhere. The device you are using will become largely irrelevant in the face of these new frameworks. All that will matter is your screen-size and immediate responsiveness. SSR + Universal App + Deploy Once, Render Everywhere is the future. Supporting using Flexbox over CSS Grid is like a boomer supporting Cheques over Bitcoin. BUT who knows – maybe I am wrong. Thanks for pointing me in the right direction. I will look into trying to solve it myself.
ScottHaval commented 2025-07-12 08:51:18 -07:00 (Migrated from github.com)

@FremyCompany

Hi Fremy,

I hope you are doing well. I see you are active on GitHub this year.

It is time to revisit this decade-old problem regarding CSS-Grid support.

Are you ready?

How much money do you need to implement it?

Name your price. Everyone has a price.

What's yours?

@FremyCompany Hi Fremy, I hope you are doing well. I see you are active on GitHub this year. It is time to revisit this decade-old problem regarding CSS-Grid support. Are you ready? How much money do you need to implement it? Name your price. Everyone has a price. What's yours?
polarathene commented 2025-07-12 17:15:11 -07:00 (Migrated from github.com)

Reminder (from 2021, please read it), this issue is a feature request.

It is not a place for chatting and complaining.

Please refrain from commenting noise as it will bury earlier comments that have more useful information for someone who may be interested in contributing a way forward. I'm referring to valuable commentary like this one and the few comments after it which discussed taffy (an alternative to yoga which does have CSS Grid support) and how yoga could approach resolving this FR.


Please don't ping devs that were last active in these discussions in 2019 (and 2015 from the original issue).

If you want to pay someone to implement the feature, great! Go seek a developer that will do it (but please don't do that here), once the feature is working they can contribute a PR that might one day get accepted/merged, in the meantime you could use that fork.

Beyond that, I wouldn't expect your activity here is going to motivate anyone from the RN team to chime in with good news. It'll either happen eventually or it won't, I opened this issue over 6 years ago so I don't expect much movement.


If it's truly a deal breaker for you, fund the fork or if it's more affordable/convenient move to an RN alternative like Dioxus, Tauri, or whatever else is out there that appeals 🤷‍♂️

Those suggestions btw are not an invitation to further discuss pros/cons or preferences. I'm not interested in doing that here (nor is the bulk of users subscribed to this FR), I'm only directing you to more realistic alternatives where you can use CSS Grid today.

Please respect OSS etiquette, avoid whining and stirring up drama here, thanks!

[Reminder](https://github.com/facebook/yoga/issues/867#issuecomment-833960273) (_from 2021, please read it_), this issue is a **feature request**. It is not a place for chatting and complaining. Please refrain from commenting noise as it will bury earlier comments that have more useful information for someone who may be interested in contributing a way forward. I'm referring to valuable commentary like [this one](https://github.com/facebook/yoga/issues/867#issuecomment-1378979952) and the few comments after it which discussed [taffy](https://github.com/DioxusLabs/taffy#benchmarks-vs-yoga) (_an alternative to yoga which does have CSS Grid support_) and how yoga could approach resolving this FR. --- Please don't ping devs that were last active in these discussions in 2019 (and 2015 from the original issue). If you want to pay someone to implement the feature, great! Go seek a developer that will do it (_but please don't do that here_), once the feature is working they can contribute a PR that might one day get accepted/merged, in the meantime you could use that fork. Beyond that, I wouldn't expect your activity here is going to motivate anyone from the RN team to chime in with good news. It'll either happen eventually or it won't, I opened this issue over 6 years ago so I don't expect much movement. --- If it's truly a deal breaker for you, fund the fork or if it's more affordable/convenient move to an RN alternative like [Dioxus](https://dioxuslabs.com/), [Tauri](https://github.com/tauri-apps/tauri#introduction), or whatever else is out there that appeals 🤷‍♂️ Those suggestions btw are not an invitation to further discuss pros/cons or preferences. I'm not interested in doing that here (_nor is the bulk of users subscribed to this FR_), I'm only directing you to more realistic alternatives where you can use CSS Grid today. Please respect OSS etiquette, avoid whining and stirring up drama here, thanks!
ScottHaval commented 2025-07-13 22:30:08 -07:00 (Migrated from github.com)

@polarathene

Your post is entirely pathetic.

  1. Commenting does not produce "noise" nor does it "bury" earlier comments. A complete lie. That's not how the user interface works for issues and there were no comments for over 6 months prior to my first comment.
  2. Telling me not to offer to pay people to implement something within an issue is purely biased and is some weird attempt at controlling discussion. What's the difference between offering it publicly vs dming someone privately? Don't you think offering it in public is more transparent and ethical?

Tired of people like you on every GitHub Issue I read creating an artificial barrier to solutions.

Hey buddy, YOU opened this issue in 2019, what have YOU done to resolve the issue?

That's right. NOTHING. You clearly weren't looking for an actual solution and you clearly didn't want to fork out the cash to resolve it. You wanted to make it LOOK like something was being done which is typical of users like you who want people to respect "OSS etiquette".

What about the etiquette regarding the thousands of peoples' TIME you wasted, getting them to vote on this?

Don't police my language again. Thanks!

@polarathene Your post is entirely pathetic. 1. Commenting does not produce "noise" nor does it "bury" earlier comments. A complete lie. That's not how the user interface works for issues and there were no comments for over 6 months prior to my first comment. 2. Telling me not to offer to pay people to implement something within an issue is purely biased and is some weird attempt at controlling discussion. What's the difference between offering it publicly vs dming someone privately? Don't you think offering it in public is more transparent and ethical? Tired of people like you on every GitHub Issue I read creating an artificial barrier to solutions. Hey buddy, YOU opened this issue in 2019, what have YOU done to resolve the issue? That's right. NOTHING. You clearly weren't looking for an actual solution and you clearly didn't want to fork out the cash to resolve it. You wanted to make it LOOK like something was being done which is typical of users like you who want people to respect "OSS etiquette". What about the etiquette regarding the thousands of peoples' TIME you wasted, getting them to vote on this? Don't police my language again. Thanks!
polarathene commented 2025-07-14 04:23:00 -07:00 (Migrated from github.com)

1. Commenting does not produce "noise" nor does it "bury" earlier comments. A complete lie.

You're must be new here? (hard to tell as you've made your profile private).

Once there is sufficient comments in an issue the UI will collapse the middle of the comment history, which can require one or more interactions with a "Load more" button.

This is what it looks like for reference (already happened in this very issue itself):

Image

Once comments are collapsed like that, they are "buried". So congratulations, your involvement here has actually led to what I was concerned about occurring.

The viewer would need to further interact to find the comments contributing more value, while the noise is our back and forth going on atm which isn't actively helping a contributor towards resolving this feature request.


2. What's the difference between offering it publicly vs dming someone privately? Don't you think offering it in public is more transparent and ethical?

Use your head please. If someone wants to offer their services here to do the work but requires payment, do you imagine they're silently subscribed here?

If they've interacted in the issue itself but not expressed an interest in paid work, and especially if their last interaction within the issue was 6 years ago, perhaps you shouldn't be pinging that user for unsolicited work?

Rather you should be using more appropriate platforms to find a developer that would like to do a task you're willing to fund. There's a variety of platforms out there for finding such developers, or you can try your luck with bounties which other users can also contribute funds towards.

I could be wrong, perhaps you'll get a response that is positive and you arrange payment and it's all roses from there on, otherwise, no you're not doing anything helpful, in which case these comments are unhelpful noise (most likely outcome).

Please engage via the proper channels, rather than triggering notifications for everyone subscribed here for updates ok? This issue is not intended to be used as a casual forum / chat, it's meant to be focused on the feature request. I appreciate that you're intentions are to help progress this request forward, but please understand that you're going about it the wrong way alright?


Tired of people like you on every GitHub Issue I read creating an artificial barrier to solutions.

What, people that are experienced with proper etiquette for feature requests?

Many of us are subscribed to various issues, we all want updates on those that are worthwhile, not annoying notifications that are noise we have to sift through. Could you please learn to respect that?

Hey buddy, YOU opened this issue in 2019, what have YOU done to resolve the issue?

Mate... read my issue description, it clearly states I was asked to open a new issue and so I did with additional context. It's accumulated enough reactions to show the interest in the feature is there far better than the other sources, the links to an external public feature tracker Meta once had is no longer valid but the demand is still apparent.

I've shared some information since then and tried to keep the issue focused, you're the first user in a while to not respect that for some reason 🤷‍♂️

Personally I don't use React Native anymore, but I am contributing to various projects quite a fair bit and my contribution history is public, so take a look if you don't think I do enough to give back to the community 🙄


You wanted to make it LOOK like something was being done which is typical of users like you who want people to respect "OSS etiquette".

Honestly...? This project is run by Meta, organizations like that aren't quite the same as typical OSS projects I contribute to and I'm quite familiar with how feature requests can pan out.

I recently contributed to another Meta project actually, but my PR was closed as they manage the actual source on another platform where someone else merged my contribution.

Generally though, I don't expect much action from large organizations when issues are open for as long as they are like this one with minimal public engagement. There was some activity earlier, and in my previous reply to you I did provide that information with links, something you clearly don't seem to appreciate despite that it's relevant towards what you want 😕


What about the etiquette regarding the thousands of peoples' TIME you wasted, getting them to vote on this?

Uhh?

I opened the issue back in 2019 yeah? How am I meant to know at the time how it will pan out? The majority would have quickly understood that this is an issue you subscribe to and wait until a notification shows up that it's closed, or you follow along for updates.

Some of those users checking the updates are trying to let you know with their reactions that they'd rather this redundant commentary halt. They do not engage themselves in this discussion because they do not want to contribute to the problem that you've instigated here... notifying all those users that you're accusing me of wasting time 🤦‍♂️


Don't police my language again. Thanks!

I merely asked you nicely to be respectful of how feature requests on the platform work here, something you're not familiar with and seem to believe will play out differently if you act the way you are presently. I even tried to be helpful to you in my response, even though it wasn't to your liking.

A more likely outcome from the current activity here is that the issue will get locked and closed, preventing all subscribed users from receiving the more preferable option of someone chiming in with an update about an actual contribution of the feature.

As per my prior comment, I'd rather avoid notification spam to subscribers from derailing this feature request and the risk of causing it to be locked, so I'm bowing out after this comment and I hope you have the decency to do the same.

> 1\. Commenting does not produce "noise" nor does it "bury" earlier comments. A complete lie. You're must be new here? (_hard to tell as you've made your profile private_). Once there is sufficient comments in an issue the UI will collapse the middle of the comment history, which can require one or more interactions with a "Load more" button. This is what it looks like for reference (_already happened in this very issue itself_): > <img width="970" height="857" alt="Image" src="https://github.com/user-attachments/assets/9b763864-8a96-43c0-8b69-fafcd5a386e2" /> Once comments are collapsed like that, they are "buried". So congratulations, your involvement here has actually led to what I was concerned about occurring. The viewer would need to further interact to find the comments contributing more value, while the noise is our back and forth going on atm which isn't actively helping a contributor towards resolving this feature request. --- > 2\. What's the difference between offering it publicly vs dming someone privately? Don't you think offering it in public is more transparent and ethical? Use your head please. If someone wants to offer their services here to do the work but requires payment, do you imagine they're silently subscribed here? If they've interacted in the issue itself but not expressed an interest in paid work, and especially if their last interaction within the issue was 6 years ago, perhaps you shouldn't be pinging that user for unsolicited work? Rather you should be using more appropriate platforms to find a developer that would like to do a task you're willing to fund. There's a variety of platforms out there for finding such developers, or you can try your luck with bounties which other users can also contribute funds towards. I could be wrong, perhaps you'll get a response that is positive and you arrange payment and it's all roses from there on, otherwise, no you're not doing anything helpful, in which case these comments are unhelpful noise (_most likely outcome_). Please engage via the proper channels, rather than triggering notifications for everyone subscribed here for updates ok? This issue is not intended to be used as a casual forum / chat, it's meant to be focused on the feature request. I appreciate that you're intentions are to help progress this request forward, but please understand that you're going about it the wrong way alright? --- > Tired of people like you on every GitHub Issue I read creating an artificial barrier to solutions. What, people that are experienced with proper etiquette for feature requests? Many of us are subscribed to various issues, we all want updates on those that are worthwhile, not annoying notifications that are noise we have to sift through. Could you please learn to respect that? > Hey buddy, YOU opened this issue in 2019, what have YOU done to resolve the issue? Mate... read my issue description, it clearly states I was asked to open a new issue and so I did with additional context. It's accumulated enough reactions to show the interest in the feature is there far better than the other sources, the links to an external public feature tracker Meta once had is no longer valid but the demand is still apparent. I've shared some information since then and tried to keep the issue focused, you're the first user in a while to not respect that for some reason 🤷‍♂️ Personally I don't use React Native anymore, but I am contributing to various projects quite a fair bit and my contribution history is public, so take a look if you don't think I do enough to give back to the community 🙄 --- > You wanted to make it LOOK like something was being done which is typical of users like you who want people to respect "OSS etiquette". Honestly...? This project is run by Meta, organizations like that aren't quite the same as typical OSS projects I contribute to and I'm quite familiar with how feature requests can pan out. I recently contributed to another Meta project actually, but my PR was closed as they manage the actual source on another platform where someone else merged my contribution. Generally though, I don't expect much action from large organizations when issues are open for as long as they are like this one with minimal public engagement. There was some activity earlier, and in my previous reply to you I did provide that information with links, something you clearly don't seem to appreciate despite that it's relevant towards what you want 😕 --- > What about the etiquette regarding the thousands of peoples' TIME you wasted, getting them to vote on this? Uhh? I opened the issue back in 2019 yeah? How am I meant to know at the time how it will pan out? The majority would have quickly understood that this is an issue you subscribe to and wait until a notification shows up that it's closed, or you follow along for updates. Some of those users checking the updates are trying to let you know with their reactions that they'd rather this redundant commentary halt. They do not engage themselves in this discussion because they do not want to contribute to the problem that you've instigated here... notifying all those users that you're accusing me of wasting time 🤦‍♂️ --- > Don't police my language again. Thanks! I merely asked you nicely to be respectful of how feature requests on the platform work here, something you're not familiar with and seem to believe will play out differently if you act the way you are presently. I even tried to be helpful to you in my response, even though it wasn't to your liking. A more likely outcome from the current activity here is that the issue will get locked and closed, preventing all subscribed users from receiving the more preferable option of someone chiming in with an update about an actual contribution of the feature. As per my prior comment, I'd rather avoid notification spam to subscribers from derailing this feature request and the risk of causing it to be locked, so I'm bowing out after this comment and I hope you have the decency to do the same.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DaddyFrosty/yoga#867
No description provided.