Skip to content

Add 2.5 blog#11823

Merged
sosukesuzuki merged 42 commits intoprettier:mainfrom
sosukesuzuki:add-2.5-blog
Nov 25, 2021
Merged

Add 2.5 blog#11823
sosukesuzuki merged 42 commits intoprettier:mainfrom
sosukesuzuki:add-2.5-blog

Conversation

@sosukesuzuki
Copy link
Copy Markdown
Contributor

@sosukesuzuki sosukesuzuki commented Nov 17, 2021

@sosukesuzuki sosukesuzuki mentioned this pull request Nov 17, 2021
12 tasks
Comment thread website/blog/2021-11-17-2.5.0.md Outdated

<!-- Prettier 2.5 -->
```tsx
const test = <T>(value: T) => {};
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the output in 2.4?

Comment thread changelog_unreleased/BLOG_POST_INTRO_TEMPLATE.md Outdated
Comment thread website/blog/2021-11-18-2.5.0.md Outdated
Comment thread website/blog/2021-11-18-2.5.0.md Outdated
@kachkaev
Copy link
Copy Markdown
Member

kachkaev commented Nov 18, 2021

Comment thread website/blog/2021-11-18-2.5.0.md
@sosukesuzuki sosukesuzuki force-pushed the add-2.5-blog branch 2 times, most recently from 5a31ea7 to b2ae0f4 Compare November 21, 2021 06:55
@sosukesuzuki sosukesuzuki marked this pull request as ready for review November 21, 2021 16:59
Copy link
Copy Markdown
Member

@j-f1 j-f1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made a bunch of suggestions. I’m not particularly attached to them, so feel free to reject any you don’t agree with :)

#### [HIGHLIGHT]Avoid extra offset in arrow function body when using long types (#11515 by @kachkaev and @thorn0)

Starting with Prettier 2.3.0, type declarations in arrow functions could affect function body offset. Changing the length of the type annotation could produce large diffs and thus increased the chance of git conflicts. To prevent this, function body offset was stabilized.
However, this change can make a big difference from 2.4.1. Please be careful.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use of the term “offset” here wasn’t clear to me — maybe change it to “indentation?” Additionally, I would reword the last sentence like so:

Suggested change
However, this change can make a big difference from 2.4.1. Please be careful.
**Note**: This change may affect a large number of lines in your codebase.

(or something similar?)

Comment thread changelog_unreleased/typescript/11721.md Outdated
Comment thread changelog_unreleased/typescript/11721.md
Comment thread changelog_unreleased/typescript/11721.md
Comment thread changelog_unreleased/mdx/11563.md Outdated
Comment thread website/blog/2021-11-21-2.5.0.md Outdated
Comment thread website/blog/2021-11-21-2.5.0.md
Comment thread website/blog/2021-11-21-2.5.0.md Outdated
Comment thread changelog_unreleased/html/11827.md Outdated
Comment thread website/blog/2021-11-21-2.5.0.md Outdated
Comment thread changelog_unreleased/BLOG_POST_INTRO_TEMPLATE.md Outdated
Comment thread changelog_unreleased/blog-post-intro.md Outdated
Comment thread changelog_unreleased/typescript/11721.md Outdated
Copy link
Copy Markdown
Member

@j-f1 j-f1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one small formatting suggestion:

Comment thread changelog_unreleased/typescript/11515.md
Comment thread website/blog/2021-11-24-2.5.0.md Outdated
@j-f1
Copy link
Copy Markdown
Member

j-f1 commented Nov 24, 2021

I just noticed that #11823 (comment) was marked as resolved but my first sentence about the use of “offset” was not addressed.

@sosukesuzuki
Copy link
Copy Markdown
Contributor Author

@j-f1 @kachkaev Thank you for your reviewing! I've fixed.

Comment thread website/blog/2021-11-24-2.5.0.md Outdated
// Input
@use 'library' with (
$black: #222,
$border-radius: 0.1rem $font-family: 'Helvetica, sans-serif'
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this supposed to be invalid Sass? If not, there's a missing comma. (below as well + newline)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is valid scss

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with SCSS, but at least there is a below code on the scss docs.

@use 'library' with (
  $black: #222,
  $border-radius: 0.1rem
);

https://sass-lang.com/documentation/at-rules/use#configuration

Copy link
Copy Markdown

@glen-84 glen-84 Nov 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

There are two variables on the same line, with no comma between them.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woops sorry I didn't notice that. I'll fix later, thank you!

@sosukesuzuki sosukesuzuki merged commit 04aa850 into prettier:main Nov 25, 2021
@kachkaev
Copy link
Copy Markdown
Member

Great work @sosukesuzuki 👏👏👏

@sosukesuzuki sosukesuzuki deleted the add-2.5-blog branch November 25, 2021 14:16
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Nov 26, 2022
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.

7 participants