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

Current status of dep-graph patcher? #258

Open
leggomuhgreggo opened this issue Jun 16, 2022 · 2 comments
Open

Current status of dep-graph patcher? #258

leggomuhgreggo opened this issue Jun 16, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@leggomuhgreggo
Copy link

Description

We've been running into some latency issues on some peoples machines with the postinstall script, and I was curious about the status of this workaround.

I went to check on the issue referenced in the docs and the issue appears to have been closed, with a note announcing support for depgraph extension API.

This feature landed a while back, in Nx 12.X. With support for the dep-graph extension documented, implemented, and released I'm going to close out this issue.

Here's a link to the docs: https://nx.dev/extending-nx/project-graph-plugins

If there is part of the extension api that needs further changes, feel free to open a new feature request detailing what is missing in the current implementation.

Motivation

Would be sweet to avoid the added install latency and utilize the Nx project graph extension API

Suggested Implementation

Thanks!

@leggomuhgreggo leggomuhgreggo added the enhancement New feature or request label Jun 16, 2022
@jordan-boyer
Copy link

I've setup a monorepo at work without nx-plus, and after some test nx seems to work without any change on .vue files

So maybe they can drop the patch entirely

@leggomuhgreggo
Copy link
Author

leggomuhgreggo commented Mar 8, 2023

@jordan-boyer thanks for the intel.

Your comment inspired me to investigate a little more.

Looking at the patch code, it seems like the nx logic it's modifying is still around.

Seem like that Nx code is used to register "explicit" workspace dependencies.

So I think the gap would be if you import a workspace lib from a .vue file the dep graph won't necessarily know about it -- but if you're not running into that issue, maybe those dependencies are being registered via other Nx logic?

If you're feeling curious you could test by identifying a .vue file that's importing from some project in libs/ then find that file and see what dependencies are listed.

yarn nx affected:graph --file=output.json
Example

Here's an example of how I think that logic registers in the graph

graph.nodes > $project > $project.files > $file.dependencies > e.g. my-cool-workspace-lib

image

Even if it doesn't register via the file it might be registering through other means, eg implicitDependencies cache inputs or something.

We're getting around this issue with implicitDependencies for our vue projects -- which works okay since our vue footprint is minimal -- but it's not very scalable. Hopefully as the Nx project graph plugin API matures we will be able to use it to support vue files a little more easily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants