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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃彈馃殌 Significantly speed up gulp prettify
#25140
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.
Was curious so I checked gulp-prettier
. Looks like we will have version mismatches if we use this.
https://github.com/bhargavrpatel/gulp-prettier/blob/master/package.json#L31
Do we need to use this gulp plugin? Can we use prettier directly?
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.
Worthwhile question to ask, but this isn't a problem. With node's semantic versioning, the plugin will continue to use our version until the major version of prettier
changes. At that point, the renovate upgrade PR for prettier
will catch any resulting errors.
amphtml
: 1.18.2
gulp-prettier
: ^1.5.3
This means the plugin will use the latest available version that doesn't change the major version 1
.
Sanity check 1: yarn.lock
confirms that only version 1.18
is installed to node_modules
.
Sanity check 2: The quoteProps
option (that we rely on) was only added in version 1.17
. If gulp-prettier
were using version 1.5
, it wouldn't be able to parse .prettierrc
.
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.
TIL. Thanks for the detailed explanation!
PR Highlights:
node_modules/.bin/prettier
once per filegulp-prettier
package to stream all filesTime to check / fix ~300 files: