Skip to content
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

Merged
merged 25 commits into from Aug 24, 2020
Merged

Add 2.1 blog post #8932

merged 25 commits into from Aug 24, 2020

Conversation

sosukesuzuki
Copy link
Member

@sosukesuzuki sosukesuzuki commented Aug 7, 2020

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

https://deploy-preview-8932--prettier.netlify.app/blog/2020/08/24/2.1.0.html

@sosukesuzuki sosukesuzuki added this to the 2.1 milestone Aug 7, 2020
Comment on lines 122 to 144
#### 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.

@sosukesuzuki sosukesuzuki mentioned this pull request Aug 7, 2020
10 tasks
cspell.json Outdated Show resolved Hide resolved
@fisker
Copy link
Sponsor Member

fisker commented Aug 9, 2020

#8410 codeblock not right
#7592 #7844 codeblock not highlighted

#7844 Should move to scss/

Copy link
Contributor

@brodybits brodybits left a 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 Show resolved Hide resolved
website/blog/2020-08-04-2.1.0.md Outdated Show resolved Hide resolved

### 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))
Copy link
Contributor

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.

Copy link
Member Author

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 Show resolved Hide resolved
website/blog/2020-08-04-2.1.0.md Outdated Show resolved Hide resolved
}
```

#### Support Private Fields in `in` ([#8431](https://github.com/prettier/prettier/pull/8431) by [@sosukesuzuki](https://github.com/sosukesuzuki))
Copy link
Contributor

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.)

Copy link
Member Author

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

sosukesuzuki and others added 8 commits August 15, 2020 17:30
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>
cspell.json Outdated Show resolved Hide resolved
```

#### 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))
Copy link
Member Author

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)

@fisker
Copy link
Sponsor Member

fisker commented Aug 21, 2020

@sosukesuzuki #8932 (comment)

@sosukesuzuki sosukesuzuki marked this pull request as ready for review August 21, 2020 11:18
Co-authored-by: ExE Boss <3889017+ExE-Boss@users.noreply.github.com>
Copy link
Member

@alexander-akait alexander-akait left a 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 ⭐

@fisker
Copy link
Sponsor Member

fisker commented Aug 22, 2020

Do you guys have npm publish permission?

@alexander-akait
Copy link
Member

@vjeux friendly ping

@vjeux
Copy link
Contributor

vjeux commented Aug 22, 2020

@evilebottnawi what do you need from me?

@sosukesuzuki
Copy link
Member Author

@vjeux Can you give me a npm publish permission for Prettier? https://www.npmjs.com/~sosukesuzuki

@vjeux
Copy link
Contributor

vjeux commented Aug 23, 2020

I have issues connecting to my account right now. @j-f1, @duailibe, @suchipi could one of you help? Thanks!

@thorn0
Copy link
Member

thorn0 commented Aug 23, 2020

@sosukesuzuki I added you.

@sosukesuzuki
Copy link
Member Author

@thorn0 @fisker Should we merge this before running release script?

@fisker
Copy link
Sponsor Member

fisker commented Aug 24, 2020

I don't know, but according to #8882, merge after release.

@fisker
Copy link
Sponsor Member

fisker commented Aug 24, 2020

So the script you wrote to replace prettier version won't work? You can replace it manually, let's improve it later.

@sosukesuzuki
Copy link
Member Author

Yes, I was worried about that too. In this release I'll replace it manually.

@sosukesuzuki sosukesuzuki merged commit 18b4cab into prettier:master Aug 24, 2020
@sosukesuzuki sosukesuzuki deleted the 2.1-blog-post branch August 24, 2020 11:36
@AlCalzone
Copy link

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.

@fisker
Copy link
Sponsor Member

fisker commented Aug 24, 2020

@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
);

@vjeux
Copy link
Contributor

vjeux commented Aug 24, 2020

Congratz everyone on the release!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants