question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

nx affected:test/lint list all apps if the change is only made in lazy loaded lib

See original GitHub issue

Current Behavior

In my angular repo, there is one app with several libs. All the libs are lazy loaded by the app by using loadChildren. All the libs have reference/imports from the app, but there is no reference/import from app to lib(except the loadChildren). When I run “nx dep-graph” the dependency graph looks like: image Does the dashed line indicate the relationship of the lazy load?

When I made a change on one of libs, the nx affected:test would run all tests in all the libs and the app. The nx affected:lint would do the same thing as nx affected:test.

Expected Behavior

What I expected is that only the changed lib should be affected when I run either affected:test or affected:lint.

Steps to Reproduce

It works as expected before we upgrade the angular version from 8.x to 9.x. The nx workspace version was upgraded to 9.2.4 from 7.x during the angular 9 upgrade. It seems like the the newer version of nx changed the behaviours how it generates the dependency graph.

Failure Logs

Environment

@nrwl/angular : 8.12.0 @nrwl/cli : 9.2.4 @nrwl/cypress : 9.2.4 @nrwl/eslint-plugin-nx : Not Found @nrwl/express : Not Found @nrwl/jest : 8.12.0 @nrwl/linter : Not Found @nrwl/nest : Not Found @nrwl/next : Not Found @nrwl/node : Not Found @nrwl/react : Not Found @nrwl/schematics : Not Found @nrwl/tao : 9.2.4 @nrwl/web : Not Found @nrwl/workspace : 9.2.4 typescript : 3.8.3

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
dwycommented, Nov 4, 2020

My understanding of the issue is that, if project A is changed, why do all projects that depend on A need to be linted?

If project B depends on project A and only A changed, I don’t see why B would need to be linted as well.

0reactions
kievsashcommented, Nov 25, 2021

My understanding of the issue is that, if project A is changed, why do all projects that depend on A need to be linted?

If project B depends on project A and only A changed, I don’t see why B would need to be linted as well.

same for unit tests

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using single component from library causes lazy-loaded ...
Basing this answer off of Edit 2, and not the Old Question. Why are all these components bundled together into a single bundle?...
Read more >
Lazy Load Angular Library (Micro-Applications) | by Matt Vaughn
We import the module that is located in the @lazy/security-app library project (as if it were a package courtesy of Nx --npm-scope @lazy)....
Read more >
Enable Lazy Loading in Angular Apps | by Victor Savkin
Victor Savkin is a co-founder of nrwl.io. ... Lazy loading speeds up the application load time by splitting it into multiple bundles, ...
Read more >
Lazy-loading feature modules - Angular
This is one of the files you need for setting up lazy loading for your feature module. Navigate into the project by issuing...
Read more >
Writing an Angular Schematic to add a Lazy Loaded Feature ...
Make life easier with Angular Schematics… Obligatory picture of code… What is an... Tagged with angularschematics, nx, typescript, angular.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found