Platform: Example: Clean up barrel imports

Created on 1 Apr 2019  路  15Comments  路  Source: ngrx/platform

In multiple places we have individual imports for components, containers, effects.

  • Create an index.ts file in each grouping folder, for example (components/index.ts)
  • Export modules from files in the grouping in the index.ts file, for example (export * from './login-page.component')
  • Update imports in the application to use the barrel imports
Accepting PRs Good First Issue Example App community watch

Most helpful comment

giphy

All 15 comments

i can pick this up?

Sure

@King-i are you still picking this up?

Can we revisit barrel imports? What value do they add in the example app?

Some kind of connected to this issue:

What is your opinion on generating an index.ts file with schematics that exports a fromFeature namespace? This would lead to a better IDE experience in components, directives, services, modules that need to import reducers, actions, selectors, state.

I can provide an example repo if you like this idea.

The auth module has been refactored in #1808, you can use this a reference to refactor the books module.

giphy

Is there anyone currently assigned this task? If not, I'd love the opportunity to jump in and help

You can go ahead and take this one @jasonhodges, or are you currently working on this @King-i ?

You can go ahead and take this one @jasonhodges, or are you currently working on this @King-i ?

Thanks @timdeschryver
Anything that needs to be done to mark this as claimed?

No, we already have the community watch as label so we're all good. Maybe just wait 2-3 days before working on this, giving @King-i the opportunity to answer.

No, we already have the community watch as label so we're all good. Maybe just wait 2-3 days before working on this, giving @King-i the opportunity to answer.

No reply. I should be able to get started on this tomorrow.

@brandonroberts @timdeschryver are there still other sections I can clean up barrel imports for? Thanks

@jasonhodges I think the only one left is the core folder

@jasonhodges I think the only one left is the core folder

Ok, I鈥檒l take it 馃憤馃徑

Was this page helpful?
0 / 5 - 0 ratings

Related issues

smorandi picture smorandi  路  3Comments

oxiumio picture oxiumio  路  3Comments

brandonroberts picture brandonroberts  路  3Comments

ghost picture ghost  路  3Comments

brandonroberts picture brandonroberts  路  3Comments