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
Add 2.1 blog post #8932
Add 2.1 blog post #8932
Conversation
website/blog/2020-08-04-2.1.0.md
Outdated
#### Further improve method chain breaking heuristic ([#7889](https://github.com/prettier/prettier/pull/7889) by [@thorn0](https://github.com/thorn0)) | ||
|
||
A method chain now is always split onto multiple lines if: | ||
|
||
- it's an expression statement and all its arguments are literals or `UPPERCASE_CONSTANT`s (the "fluent configuration" pattern), | ||
- any call but the first one has more than two arguments, or | ||
- the chain starts with a constructor call. | ||
|
||
<!-- prettier-ignore --> | ||
```jsx | ||
// Input | ||
cy.get(".ready") | ||
.should("have.text", "FOO") | ||
.should("have.css", "color", "#aaa"); | ||
|
||
// Prettier stable | ||
cy.get(".ready").should("have.text", "FOO").should("have.css", "color", "#aaa"); | ||
|
||
// Prettier master | ||
cy.get(".ready") | ||
.should("have.text", "FOO") | ||
.should("have.css", "color", "#aaa"); | ||
``` |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just left some changes, suggestions, and questions so far.
I will try to review the rest of the post today.
In general, I wonder if we should state which parsers the new ES proposals are supported on.
website/blog/2020-08-04-2.1.0.md
Outdated
|
||
### JavaScript | ||
|
||
#### Support the F# and Smart pipeline operator proposals ([#6319](https://github.com/prettier/prettier/pull/6319) by [@sosukesuzuki](https://github.com/sosukesuzuki), [@thorn0](https://github.com/thorn0), [#7979](https://github.com/prettier/prettier/pull/7979) by [@sosukesuzuki](https://github.com/sosukesuzuki)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we tell which parsers this would be supported by?
I think they would be babel
, babel-flow
, and babel-ts
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the feature works on only babel
website/blog/2020-08-04-2.1.0.md
Outdated
} | ||
``` | ||
|
||
#### Support Private Fields in `in` ([#8431](https://github.com/prettier/prettier/pull/8431) by [@sosukesuzuki](https://github.com/sosukesuzuki)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only on Babel parsers, right?
(I did just raise PR #8942 to run the test on all Babel parsers.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, works on only babel
Co-authored-by: Chris Brody <chris.brody+brodybits@gmail.com>
Co-authored-by: Chris Brody <chris.brody+brodybits@gmail.com>
Co-authored-by: Chris Brody <chris.brody+brodybits@gmail.com>
Co-authored-by: Chris Brody <chris.brody+brodybits@gmail.com>
Co-authored-by: Chris Brody <chris.brody+brodybits@gmail.com>
website/blog/2020-08-21-2.1.0.md
Outdated
``` | ||
|
||
#### Support `Labeled Tuple Elements` ([#8885](https://github.com/prettier/prettier/pull/8885) by [@fisker](https://github.com/fisker), [#8982](https://github.com/prettier/prettier/pull/8982) by [@sosukesuzuki](https://github.com/sosukesuzuki)) | ||
#### Short-Circuiting Assignment Operators ([#8982](https://github.com/prettier/prettier/pull/8982) by [@sosukesuzuki](https://github.com/sosukesuzuki)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added about Short-Circuiting Assignment Operators
here #8982 (comment)
Co-authored-by: ExE Boss <3889017+ExE-Boss@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do it ⭐
Do you guys have npm publish permission? |
@vjeux friendly ping |
@evilebottnawi what do you need from me? |
@vjeux Can you give me a npm publish permission for Prettier? https://www.npmjs.com/~sosukesuzuki |
@sosukesuzuki I added you. |
I don't know, but according to #8882, merge after release. |
So the script you wrote to replace prettier version won't work? You can replace it manually, let's improve it later. |
Yes, I was worried about that too. In this release I'll replace it manually. |
Maybe I'm blind, but whats the difference under "Fix unstable comments in binary expressions"? // Prettier 2.0 (first output)
Math.min(
/* foo */
document.body.scrollHeight -
(window.scrollY + window.innerHeight) -
devsite_footer_height,
0
);
// Prettier 2.0 (second output)
Math.min(
/* foo */
document.body.scrollHeight -
(window.scrollY + window.innerHeight) -
devsite_footer_height,
0
); looks identical to me. |
@AlCalzone Thank you, I've fixed it 2fe0415 Math.min(
/* foo */
document.body.scrollHeight -
- (window.scrollY + window.innerHeight) -
+ (window.scrollY + window.innerHeight) -
devsite_footer_height,
0
); |
Congratz everyone on the release! |
There's still todo for 2.1 milestone, but I create PR for a quick review and release. This PR is still draft but reviews welcome! I'm not good at English, so it would be helpful if you could review English.
TODO
If Avoid line-breaking inside a method chain before breaking the chain itself #8063 is completed, I'll add it toHighlights
pr-xxxx.md
from/changelog_unreleased
// Prettier stable
=>// Prettier 2.0
,// Prettier master
->// Prettier 2.1
Prettier stable
/Prettier master
with the actual versions #8984)https://deploy-preview-8932--prettier.netlify.app/blog/2020/08/24/2.1.0.html