Nest: DISCUSSION: rename modules to imports

Created on 9 Dec 2017  路  6Comments  路  Source: nestjs/nest

I'm submitting a...


[ ] Regression 
[ ] Bug report
[X] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior


Right now, in modules, to import another module, you use the module key in the decorator. This can quickly become circular and can easily get confused with Angular. My suggestion would be to add rename this to imports in the next v4 minor version, while keeping modules around for old codebases (with a warning), and then removing the modules key from the metadata in v6.

What is the motivation / use case for changing the behavior?


The reason for this is, like I said, to better match Angular. If the whole idea of Nest is to create simple parallels between Angular and server development, it is most logical to follow Angular's patterns. I'd be happy to PR these changes after several weeks of discussion.

I want to get an idea from the Nest community on how you feel about this change. Please thumbs up/down this comment depending on how you feel about this proposal. Add comments to further discuss this proposal with requested changes or reasons for rejection.

type todo 馃挌

Most helpful comment

Hi @wbhob,
Honestly, I still regret this choice. The imports keyword would be much better. Feel free to create a pull request if you want to 馃檪 (would be great to have one to the docs too 馃槄 )

All 6 comments

Hi @wbhob,
Honestly, I still regret this choice. The imports keyword would be much better. Feel free to create a pull request if you want to 馃檪 (would be great to have one to the docs too 馃槄 )

Awesome! What will be the deprecation path for this (obviously, we want to keep modules around for v4 codebases.

@wbhob so what think is that we may just create an alias. Take a look here https://github.com/nestjs/nest/commit/864fac9ceadbf25852c79cabd5fca0068ff4f04a
What do you think? 馃檪

LGTM, just need to add a deprecation flag in v5 and removal in v6! @kamilmysliwiec thanks!

Will do that 馃檪 docs are updated already

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

FranciZ picture FranciZ  路  3Comments

hackboy picture hackboy  路  3Comments

mishelashala picture mishelashala  路  3Comments

cojack picture cojack  路  3Comments

anyx picture anyx  路  3Comments