5 ms·
Interesting! It seems this is a rewrite of Yoga, by the same author, seen by another comment in this thread. So why start again using flex box as a layout engin
by jarjoura 7y ago
Interesting! It seems this is a rewrite of Yoga, by the same author, seen by another comment in this thread. So why start again using flex box as a layout engine? For example, there isn't really a good, equally as rich, grid layout engine yet. Also curious what the intended goal with conformance is, as the README states this project has a secondary intent to be more in line with the CSS spec? Personally for me any layout system that can avoid Apple's constraint based system is already a win. I guess, what kind of layout would this enable that Yoga doesn't already?
- emilsjolander 7y agoStretch 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).
- nicoburns 7y agoSuper-excited to hear that Grid layout will be coming soonish. Yoga has been fantastic in making Flexbox available "everywhere", but Grid is wonderful for UI layout in a way that Flexbox isn't.
- emilsjolander 7y agoJust to be clear, we are not working on it. However it is something I would like to start looking into sometime soon :) This is a huge area for contributions as I myself am not a grid expert (as apposed to having worked on flexbox engines past 3 years).
- nicoburns 7y ago> Just to be clear, we are not working on it. However it is something I would like to start looking into sometime soon :) I hear you, but this is very different to "we're never going to implement this". I might look into contributing, but I've never implemented any layout engine, so I'm not sure how much help I would be!
- emilsjolander 7y agoI would love to help talk through how to start and the process i used for the flexbox implementation :) start a PR / Issue and we can discuss :)
- kjsthree 7y agoAs someone else who knows nothing about how layout engines work, kudos to this response. I understand time and attention don’t scale well and I hope you don’t get overwhelmed but this kind of attitude in open source is the greatest.
- jahewson 7y agoWhat problems have you experienced with Apple’s auto layout?
- layoutIfNeeded 7y agoI’d be interested in GPs answer too. Especially considering that flexbox is a proper subset of what’s possible with AutoLayout... If you’re not comfortable with constraint systems yet, just use UIStackView and voilà, it’s a flexbox.
- atom_arranger 7y agoYou clearly know your layouts :). I agree, AutoLayout is the most powerful system I've worked with. I wish others would start their layout systems based on it (others like React Native, or native Android), then add simplified APIs like flexbox using it if needed/desired.
- emilsjolander 7y agoSomethings become very complicated in constraint based systems and they are often much slower in my experience than more special purpose layout systems. That said i'm not against constraint systems either, they just both have their place.
- travisgriggs 7y agoInteresting. Overall, I love iOS constraint engine and really really really miss it when I port things to Android. It's not a universal solution, there's always a point where you flip and do your own layoutSubviews on complex stuff. How does this compare?
- on_and_off 7y agoHave you tried ConstraintLayout ? It is based on Cassowary constraint resolution algorithm just as Apple's AutoLayout. Is it missing something compared to Apple's solution ?