Skip to content

Remove bin/yarn to avoid running "yarn install" unnecessarily#5453

Merged
mitchellhenke merged 1 commit intomainfrom
mitchellhenke/remove-bin-yarn
Sep 28, 2021
Merged

Remove bin/yarn to avoid running "yarn install" unnecessarily#5453
mitchellhenke merged 1 commit intomainfrom
mitchellhenke/remove-bin-yarn

Conversation

@mitchellhenke
Copy link
Contributor

When attempting to yarn install in offline mode (#5419), I noticed we were still running yarn installs when compiling assets. This webpacker issue suggests deleting bin/yarn, which was generated and added as part of the Rails 6.1 upgrade.

Removing this file doesn't appear to break any of our setup scripts, tests, or build processes.

@mitchellhenke mitchellhenke requested a review from aduth September 28, 2021 19:44
Copy link
Contributor

@zachmargolis zachmargolis left a comment

Choose a reason for hiding this comment

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

LGTM

@mitchellhenke mitchellhenke merged commit f816ba1 into main Sep 28, 2021
@mitchellhenke mitchellhenke deleted the mitchellhenke/remove-bin-yarn branch September 28, 2021 20:01
Copy link
Contributor

@aduth aduth left a comment

Choose a reason for hiding this comment

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

Interesting, looks like it's coming from Sprockets:

https://github.com/rails/rails/blob/6-1-stable/railties/lib/rails/tasks/yarn.rake#L27-L30

Alternatively, we could remove the yarn install from deploy/build and enhance bin/yarn to handle offline? Not much difference anyways.

I notice Rails also passes --no-progress. Makes me recall how NPM's progress bar had a noticeable performance impact a long while ago (npm/npm#11283), though I dunno if it actually applies here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants