-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Upgrade wp-prettier to 2.8.5 #49258
Upgrade wp-prettier to 2.8.5 #49258
Conversation
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.
LGTM 👍
Size Change: +77 B (0%) Total Size: 1.34 MB
ℹ️ View Unchanged
|
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.
Thanks, @jsnajdr! Great work 💯
This version looks great and is obviously an improvement (especially the removed extra space).
I had a question, but it's non-blocking one, feel free to 🚢
🚀
const showStopEditingAsBlocks = isEditingAsBlocks && ! isContentLocked; | ||
const showStartEditingAsBlocks = | ||
! isEditingAsBlocks && isContentLocked && props.isSelected; |
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'm curious why those were needed as separate variables. Is the new version breaking these expressions somehow?
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.
Not breaking them, the formatting was just not pretty. The conditional JSX:
<>
{ isEditing && isLocked && isSelected && (
<BlockSettings />
) }
</>
was already over 80 columns, but the old Prettier didn't break it. The new Prettier breaks it like:
<>
{ isEditing &&
isLocked &&
isSelected && (
<BlockSettings />
) }
</>
which looks bad and also adds a new level of indentation for the inner markup. I decided to make it look good again by extracting the condition.
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.
Agreed, thank you for clarifying 👍
@@ -43,7 +43,7 @@ const colors = [ | |||
|
|||
const Template: ComponentStory< typeof BorderBoxControl > = ( props ) => { | |||
const { onChange, ...otherProps } = props; | |||
const [ borders, setBorders ] = useState< typeof props[ 'value' ] >(); | |||
const [ borders, setBorders ] = useState< ( typeof props )[ 'value' ] >(); |
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.
This does make sense IMO 👍
@@ -294,7 +294,7 @@ export const showBlockTypes = | |||
( type ) => | |||
! ( | |||
Array.isArray( blockNames ) ? blockNames : [ blockNames ] | |||
).includes( type ) | |||
).includes( type ) |
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.
Oh, I love this. I hated how it added that extra space!
Flaky tests detected in f147365. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4490429220
|
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.
Excellent, so great to see it upgraded 👍
Updates the
wp-prettier
package to version 2.8.5 and reformats the codebase.Notable changes:
typeof props[ 'value' ]
now get parens for clarity:( typeof props )[ 'value' ]
satisfies
,in
andout
variance specifiers, ...