Karl O'Keeffe
5cda955efc
New primitive to fill a line with as many doc parts as possible ( #1120 )
...
* Add new fill primitive and use it to wrap text in JSX
This adds a new `fill` primitive that can be used to fill lines with as much code as possible before moving to a new line with the same indentation.
It is used here layout JSX children. This gives us nicer wrapping for JSX elements containings lots of text interspersed with tags.
* Quick fix for jsx whitespace regressions
* Fix a couple more bugs
* Tidy up the `fill` algorithm
Attempt to make the algorithm a little more regular, and improve the naming of variables to make it a little easier to understand (I hope!).
* Small tidy up of JSX whitespace declarations
* Remove unnecessary code
It turns out that `children` is only used in the case when the element is printed on a single line, in which case all the types of JSX whitespaces behave the same, so we don't need to special case leading/trailing/solitary whitespace.
* A little more tidy up based on PR feedback
* Fix up tests after rebasing
* Make it explicit that we keep multiple consecutive spaces
* Add an explanatory comment
* Fix broken snapshot in master
* Ignore existing commands when deciding whether content will fit when using fill
* Fix a bug where children would get incorrectly filled onto a line
* Tidy up JSX whitespace names
2017-05-10 16:13:21 -07:00
..
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-18 13:28:33 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-05-01 14:42:52 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-05-01 19:12:53 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-05-01 19:12:53 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-13 18:32:03 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-05-10 16:13:21 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-27 14:59:18 -07:00
2017-05-01 14:42:52 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-22 18:09:53 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-05-01 14:39:15 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-27 14:59:18 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-05-01 14:42:52 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-05-01 14:39:15 -07:00
2017-05-01 14:39:15 -07:00
2017-04-12 13:41:51 -07:00
2017-05-01 14:39:15 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00
2017-04-12 13:41:51 -07:00