-
-
Notifications
You must be signed in to change notification settings - Fork 237
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
ESLint checking from the 1st compilation blocks 2nd webpack compilation (tapAfterCompileToAddDependencies) #612
Comments
I really love this extension, works pretty much flawlessly at 6.2.6 except for this one thing. Thank you for your work |
Thanks for reporting that, maybe #613 will solve it 🤔 Maybe getDependencies is traversing node_modules so that PR should improve time in that case |
Could you check if this problem still exists with 6.2.7? |
@piotr-oles Unfortunately still happens in 6.2.7 :( Seems like it shaved 20s off the 120s total. |
I'll be debugging for a bit right now to find what takes the most time, because atm ESLint's getDependencies seems to take <1s |
Removing |
You're right - the eslint code is synchronous so it's blocking the thread... I think we could move dependency computation to the main process or a separate process, but it's non-trivial change :/ |
I came here to just confirm I am having the same issue - I think it was due to recent version upgrade to one of eslint-related packages. Basically it always hangs for me on Any robust fixes for this one planned and on the roadmap? |
I think I will try to move dependencies resolution to the main thread :) I'm not sure when I find time for this. Feel free to open PR ;) |
Same problem here, and I just realized that this problem was introduced in the @6.0.4 version because the @6.0.3 version has the asynchronous process working just perfectly... Also want to thank you guys for this lib it's really awesome! |
More specifically the problem is with this line #68 watch(
files: Iterable<string>,
dirs: Iterable<string>,
missing: Iterable<string>,
startTime?: number,
options?: Partial<WatchFileSystemOptions>,
callback?: Function,
callbackUndelayed?: Function
): Watcher {
clearFilesChange(this.compiler);
const isIgnored = createIsIgnored(options?.ignored);
// use standard watch file system for files and missing
const standardWatcher = this.watchFileSystem.watch(
files,
dirs, // <-- this line is the problem
missing,
startTime,
options,
callback,
callbackUndelayed
); It's watching to many files and directory, and I believe that the filesystem starts to watch all files under the dir when added this also happens with files I believe that we shouldn't be watching files or dir of node_modules. watch(
files: Iterable<string>,
dirs: Iterable<string>,
missing: Iterable<string>,
startTime?: number,
options?: Partial<WatchFileSystemOptions>,
callback?: Function,
callbackUndelayed?: Function
): Watcher {
clearFilesChange(this.compiler);
const isIgnored = createIsIgnored(options?.ignored);
const isProjectPath = (path: string) => {
return !path.includes('node_modules');
};
// use standard watch file system for files and missing
const standardWatcher = this.watchFileSystem.watch(
[...files].filter(isProjectPath),
[...dirs].filter(isProjectPath),
[...missing].filter(isProjectPath),
startTime,
options,
callback,
callbackUndelayed
);
it's a compilation difference between 20 segs and 2 mins |
@caiquelsousa |
yeah, that's not the problem I just checked again and it seems that when I use so when I remove the |
In my setup there is no |
@rkriauciukas-freesat I think it's not related to this issue - @caiquelsousa could you open a new issue regarding |
@caiquelsousa I'll chime in to say that using 6.0.3 still results in the same problem I have. |
We are dealing with the same issue, we have a large repository and '94% after seal' in subsequent builds takes sometimes more than 5 minutes. Tried 7.0.0-alpha.3 with no luck. Not sure if it's connected to using workspaces or large or wrongly configure file dependencies. |
@amertak I am too still having the same issue - hoped that v6.2.12 of the package would fix the issue, but no luck. I am on Windows10 + WSL1, so given WSL1 issues with file locking mechanism etc, maybe Webstorm JS sub-processes lock some files and obstruct something or maybe there is another reason for this. Would love to see this fixed. Maybe we can add separate config flag for those who want to use it? |
@rkriauciukas-freesat , @amertak do you use eslint feature? Or only type-checking? |
@piotr-oles I do not have eslint enabled in this plugin. Using webstorm plugin. |
@piotr-oles Yes, I am relying heavily on ESLint, but not calling it from Webpack (it is disabled by default in Webpack). I've tried disabling those in Webstorm, but do not seem to make any difference.
Below is
The main `./tsconfig.json':
|
That's good because the next version of the plugin should fix this issue but we are also dropping support for eslint :) |
In order to not block next iteration on getDependencies call, we use separate worker for dependencies calculations (so getIssues from previous compilation will not block next getDependencies call) ✅ Closes: #612
🎉 This issue has been resolved in version 6.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version 7.0.0-alpha.15 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Current behavior
getDependencies
.dependenciesPromise
tapAfterCompileToAddDependencies
hook.dependenciesPromise
to resolve which means I can't use the app for the next 2 minutes while plugin is doing all the checks.Illustration of the issue at hand, hope it's not too messy (I added a couple of logs to show how much time
tapAfterCompileToAddDependencies
takes).Note: I can disable ESLint and this doesn't happen.
getDependencies
takes so long for ESLint specifically.Expected behavior
Not sure how this should be fixed, but maybe this can work?
getDependencies
resolves and only after that tap some hook and add resolved dependencies into next webpack compilation?I couldn't really make this work locally for me, but if you can point me to the right solution, I can make a PR.
Steps to reproduce the issue
lazyCompilation
is enabled.Issue reproduction repository
I can try to create one if description above isn't enough.
Environment
The text was updated successfully, but these errors were encountered: