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

Update eslint-plugin-import #350

Merged
merged 1 commit into from Dec 5, 2022
Merged

Update eslint-plugin-import #350

merged 1 commit into from Dec 5, 2022

Conversation

marvinhagemeister
Copy link
Contributor

@marvinhagemeister marvinhagemeister commented Dec 5, 2022

Description

This addresses a performance issue caused by an issue in the underlying resolve dependency that is used under the hood (see browserify/resolve@1382486). The issue is that the overhead of capturing stack traces is very significant in our setup. It's probably a symptom of something else going on, but just updating this dependency leads to an immediate win in performance.

Times when linting:

Description Time
Before 2:26 min
After (this PR) 1:51 min

This addresses a performance issue caused by an issue in the underlying
`resolve` dependency that is used under the hood. See:
browserify/resolve@1382486
Copy link
Member

@simontaisne simontaisne left a comment

Choose a reason for hiding this comment

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

🥇

@marvinhagemeister marvinhagemeister merged commit 7853129 into main Dec 5, 2022
@marvinhagemeister marvinhagemeister deleted the eslint-plugin-perf branch December 5, 2022 13:40
@notjosh
Copy link

notjosh commented Dec 6, 2022

@marvinhagemeister Heya! Small followup, because we bumped into it on Shop also: yarn.lock (here, and likely your project) still has references to resolve < 1.22.1 (and resolve <= 2.0.0-next.4, used only by eslint-plugin-react), so you can likely get a similar boost in some other tooling - we found Jest performance increased noticeably (via jest-resolve to resolve) when we bumped the version.

Two things you'll need to do on your project:

  1. (for resolve@1.x) run npx yarn-deduplicate --packages resolve, which should bump your yarn.lock to force the 1.x references to the newer one. Easy.
  2. (for resolve@2.x) we'll temporarily use resolutions to bump the subdependency (afaik there's still no better way to do this (ref)
    1. add "eslint-plugin-react/resolve": "2.0.0-next.4" to package.json resolutions
    2. run yarn --check-files to install the new version
    3. remove the custom resolution from package.json, we don't need it now that yarn.lock is updated
    4. run npx yarn-deduplicate --packages resolve to remove any yarn.lock references to 2.0.0-next.3
    5. verify: at this point, only yarn.lock should have a diff

You can verify it's set up correctly by running yarn why resolve, and only the newer versions should be installed.

Note: We can do that here on this repo too (there's no reason not to!), but that won't force the updated version in other projects.

Hope that's helpful!

@marvinhagemeister
Copy link
Contributor Author

@notjosh Good call on using resolutions for that 👍

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.

None yet

5 participants