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

Lazy load node_modules to speed up Flow when in dependency hell #1461

Closed
kumar303 opened this issue Feb 26, 2016 · 4 comments
Closed

Lazy load node_modules to speed up Flow when in dependency hell #1461

kumar303 opened this issue Feb 26, 2016 · 4 comments

Comments

@kumar303
Copy link

With recent versions of npm, node_module dependencies are flattened, which creates a massive amount of top-level directories that Flow descends into at startup. Could this be done lazily, right as the app under test tries to import something that Flow needs to analyze? I think this would also address #719

As an example of how npm flattening affects Flow, my package.json defines 38 dependencies but my node_modules folder has 700 top-level modules 🔥 . When I auto-generated ignore rules for these folders (#719 (comment)), the Flow server would start up twice as fast.

@Macil
Copy link
Contributor

Macil commented Feb 26, 2016

Related suggestion: #869.

@samwgoldman
Copy link
Member

@kumar303 Are you running 0.22? As of that version, we no longer parse non-@flow files, so large node_modules directories should have a much better experience.

@kumar303
Copy link
Author

oh wow, it is a big improvement in 0.22, thanks! Feel free to close this issue. Funny enough, my startup time is faster now without my auto-generated ignore rules (probably because it's not doing so much regex).

@calebmer
Copy link
Contributor

Closing, but we will continue thinking about not typechecking files in node_modules 👍

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

No branches or pull requests

4 participants