New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New primitive to fill a line with as many doc parts as possible #1120
Merged
Commits on May 7, 2017
-
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.
Configuration menu - View commit details
-
Copy full SHA for 5595d7a - Browse repository at this point
Copy the full SHA 5595d7aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8f12bbd - Browse repository at this point
Copy the full SHA 8f12bbdView commit details -
Configuration menu - View commit details
-
Copy full SHA for db0a639 - Browse repository at this point
Copy the full SHA db0a639View commit details -
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!).
Configuration menu - View commit details
-
Copy full SHA for fe54811 - Browse repository at this point
Copy the full SHA fe54811View commit details -
Configuration menu - View commit details
-
Copy full SHA for 12e1716 - Browse repository at this point
Copy the full SHA 12e1716View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for dba1a72 - Browse repository at this point
Copy the full SHA dba1a72View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5496bde - Browse repository at this point
Copy the full SHA 5496bdeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4fd4444 - Browse repository at this point
Copy the full SHA 4fd4444View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1858d5e - Browse repository at this point
Copy the full SHA 1858d5eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9884b3a - Browse repository at this point
Copy the full SHA 9884b3aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 50908f6 - Browse repository at this point
Copy the full SHA 50908f6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4b4e365 - Browse repository at this point
Copy the full SHA 4b4e365View commit details -
Configuration menu - View commit details
-
Copy full SHA for 83397ec - Browse repository at this point
Copy the full SHA 83397ecView commit details -
Configuration menu - View commit details
-
Copy full SHA for b84438e - Browse repository at this point
Copy the full SHA b84438eView commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.