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

0.9.1 migration removes "lazyLoad" #343

Closed
ph55 opened this issue Mar 20, 2018 · 7 comments
Closed

0.9.1 migration removes "lazyLoad" #343

ph55 opened this issue Mar 20, 2018 · 7 comments

Comments

@ph55
Copy link

ph55 commented Mar 20, 2018

When updating from 0.8.0 to 0.9.1 - "lazyLoad" block removed from "nx-enforce-module-boundaries".
I assume it's related to new feature - support for tagged libs

image

@skydever
Copy link
Contributor

I found out that there is an autodetection for that now.

I got it like that: the rule checks lib dependencies, also if a lib is loaded via loadChildren into another lib/app. if so, imports from that lazy loaded lib into the lib/app that is lazy loading via loadChildren are not allowed. no need to keep track of it manually anymore, and it allows you to do both (lazy and not lazy) including the lazy only check if the lib is supposed to be lazy loaded, awesome!

e.g. my-app is using loadChildren to load my-lib. imports within my-app from @myworkspace/my-lib produce a lint error in that case: imports of lazy-loaded libraries are forbidden. my-app-two can import @myworkspace/my-lib (it does not use loadChildren for my-lib), even if my-app is using loadChildren.

@skydever
Copy link
Contributor

...but this is still required at the corresponding tsconfig.app.json I suppose (e.g. in my-app when using loadChildren):

"include": [
    "**/*.ts"
    /* add all lazy-loaded libraries here: "../../../libs/my-lib/index.ts" */,
    "../../../libs/my-lib/index.ts"
  ]

... maybe a nice additional feature, to show a lint error at the line of loadChildren if the typescript setup is missing that in it's include, to get the error when you type it ...

@ph55
Copy link
Author

ph55 commented Mar 21, 2018

I found out that there is an autodetection for that now

I don't think so.

This is with module added to "lazyLoad" (correct validation)

image
image




This is without module in "lazyLoad" (no validation)

image
image

@skydever
Copy link
Contributor

skydever commented Mar 21, 2018

you are sure that you are on 0.9.1, maybe a lint cache problem in your ide? see 56788ba

... or you only upgraded @nrwl/nx? the lint rule is part of @nrwl/schematics (You must use the same version of the two packages) ...

@ph55
Copy link
Author

ph55 commented Mar 22, 2018

I see. Both @nrwl/nx and @nrwl/schematics are 0.9.1
Did reinstall node_modues

rm -rf node_modules package-lock.json
npm install

Now I see circular dependencies warnings (tslint) which tells it's updated.
But, lazy load warnings stopped to work at all.

image

image

@ph55
Copy link
Author

ph55 commented Mar 22, 2018

Closing in favor of #352

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants