News for hackers. Stuff that matters.
Re:Show HN: Stretch – A high-performance cross-platform layo... by jarjoura on Monday April 29, 2019 @03:52PM (#19781978)
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?
Re:Show HN: Stretch – A high-performance cross-platform layo... by emilsjolander on Monday April 29, 2019 @04:10PM (#19782139)
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).

Re:Show HN: Stretch – A high-performance cross-platform layo... by nicoburns on Monday April 29, 2019 @04:37PM (#19782372)
Super-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.
Re:Show HN: Stretch – A high-performance cross-platform layo... by emilsjolander on Monday April 29, 2019 @04:43PM (#19782428)
Just 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).
Re:Show HN: Stretch – A high-performance cross-platform layo... by nicoburns on Monday April 29, 2019 @05:37PM (#19782831)
> 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!

Re:Show HN: Stretch – A high-performance cross-platform layo... by emilsjolander on Monday April 29, 2019 @06:10PM (#19783066)
I 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 :)
Re:Show HN: Stretch – A high-performance cross-platform layo... by kjsthree on Monday April 29, 2019 @11:25PM (#19784890)
As 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.
Re:Show HN: Stretch – A high-performance cross-platform layo... by jahewson on Monday April 29, 2019 @04:10PM (#19782141)
What problems have you experienced with Apple’s auto layout?
Re:Show HN: Stretch – A high-performance cross-platform layo... by layoutIfNeeded on Monday April 29, 2019 @05:52PM (#19782933)
I’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.

Re:Show HN: Stretch – A high-performance cross-platform layo... by emilsjolander on Monday April 29, 2019 @06:31PM (#19783220)
Somethings 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.
Re:Show HN: Stretch – A high-performance cross-platform layo... by atom_arranger on Monday April 29, 2019 @06:18PM (#19783123)
You 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.

Re:Show HN: Stretch – A high-performance cross-platform layo... by travisgriggs on Monday April 29, 2019 @08:24PM (#19783951)
Interesting. 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?
Re:Show HN: Stretch – A high-performance cross-platform layo... by on_and_off on Monday April 29, 2019 @09:33PM (#19784346)
Have 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 ?