Skip to content

Hidden node_modules dependencies in Module Graph #5363

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

Closed
4 tasks done
yjrhgvbn opened this issue Mar 9, 2024 · 6 comments · Fixed by #7217
Closed
4 tasks done

Hidden node_modules dependencies in Module Graph #5363

yjrhgvbn opened this issue Mar 9, 2024 · 6 comments · Fixed by #7217
Assignees
Labels
feat: ui Vitest UI p2-nice-to-have Not breaking anything but nice to have (priority)

Comments

@yjrhgvbn
Copy link

yjrhgvbn commented Mar 9, 2024

Clear and concise description of the problem

I found some dependencies(math.js etc.) will display in Module Graph, and it was regarded as inline modules。

image image

Suggested solution

Hidden those dependencies in Module Graph

Alternative

No response

Additional context

No response

Validations

@sheremet-va
Copy link
Member

sheremet-va commented Mar 9, 2024

All inlined dependencies are represented in a module graph. Why shouldn't these be displayed? How would you know they are inlined?

@yjrhgvbn
Copy link
Author

yjrhgvbn commented Mar 9, 2024

I've debugged it, and it appears that the color for "external" should be yellow, not green.

I tested the dependencies of math.js and found that it has at least 500 dependencies. If all of them were shown, the browser would become very laggy. However, usually we don't need to know about these dependencies.

@sheremet-va
Copy link
Member

It is not "external", it is inlined. This module was processed with vite-node, and not imported with a dynamic import. If you click on it, you will see what was actually running.

@yjrhgvbn
Copy link
Author

yjrhgvbn commented Mar 9, 2024

What I mean by "inline" and "external" refers to the options in this UI section.

image

I understand that some dependencies require running in inline mode, but it may prefer not to see them in the graph. For these dependencies, it is possible to either hide them or add an option to control their visibility.

@hi-ogawa hi-ogawa added the feat: ui Vitest UI label Mar 14, 2024
@hi-ogawa
Copy link
Contributor

Graph view being laggy was reported in #4762.

I just tested with react-testing-lib example https://github.com/vitest-dev/vitest/tree/main/examples and it doesn't look really usable when there are many files from node_modules are inlined.

Show screenshot

image

So maybe it makes sense to have yet another toggle for "inline modules" inside and outside of node_modules?

@sheremet-va
Copy link
Member

I think we can have a "Hide node_modules" toggle to address the issue with performance.

@sheremet-va sheremet-va added p2-nice-to-have Not breaking anything but nice to have (priority) and removed enhancement: pending triage labels Oct 2, 2024
@userquin userquin self-assigned this Jan 12, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Jan 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feat: ui Vitest UI p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants