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

akita/cli barrel circular dependency #32

Closed
filipjnc opened this issue Jul 30, 2018 · 4 comments
Closed

akita/cli barrel circular dependency #32

filipjnc opened this issue Jul 30, 2018 · 4 comments

Comments

@filipjnc
Copy link

filipjnc commented Jul 30, 2018

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report 
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[x] Support request
[ ] Other... Please describe:

Current behavior

Because of the barrel index files, I always get circular dependency warnings at compile time. Example:

  1. movies/state/index.ts imports movies/state/movies.service.ts
  2. The latter imports actors/state/actor.model.ts via barrel actors/state/index.ts
  3. actors/state/index.ts imports actors/state/actors.query.ts
  4. The latter imports movies/state/movies.query.ts via barrel movies/state/index.ts
  5. Three circular dependency warnings 😞

Such cases are unfortunately very common and the barrel files create more unconviniences than they help. Have you encountered such cases and how do you go around with it? Do you just remove the barrel? Thanks!

PS. Are the missing line breaks around providedIn: 'root' in the CLI for Store intentional?
PPS. Is there a slack/gitter room for asking such small questions?

@NetanelBasal
Copy link
Collaborator

We consider removing the barrel file. We are going to release Angular schematics support and will not include it.

Are the missing line breaks

Not sure what you mean.

Is there a slack/gitter room

We'll open soon, meantime you can ask here.

@filipjnc
Copy link
Author

filipjnc commented Jul 31, 2018

Are the missing line breaks

Not sure what you mean.

In entity-store.tpl: @Injectable({ providedIn: 'root' })
whereas in other services and also in the Angular docs:

@Injectable({
    providedIn: 'root'
})

We consider removing the barrel file. We are going to release Angular schematics support and will not include it.

Alright then I start dropping the barrel files in the anticipation to the future change. Thanks!

@NetanelBasal
Copy link
Collaborator

One line makes the code shorter.

@filipjnc
Copy link
Author

filipjnc commented Jul 31, 2018

Agree. Then it would make sense to have it also in one line in the Query and Service templates.

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

2 participants