Nest: Discussion: feature modules

Created on 22 Oct 2017  路  18Comments  路  Source: nestjs/nest

I'm interested in developing some feature modules to build into the nest ecosystem, like the following:

  • HTTP (like Angular, using fetch() or XHR, or some other HTTP adapter)
  • Mongo and Mongoose, to build DB functionality right into a provider
  • Nest-maintained middlewares (plug and play classes for common express MWs)

This is all based on a project I was working on: https://github.com/orbital-js/orbital, but I am interested in merging it with Nest because Nest is more maintained and publicly available, and does the same thing.

What would the process for these new features look like?

discussion 馃敟

Most helpful comment

I just published a simple Pretty ErrorHandler and Stack Viewer Called Nest-Flub

Dark Theme

dark

Light Theme

light

check it out : https://github.com/shekohex/nestjs-flub

All 18 comments

Hi @wbhob,
It'd be great to have as much 3rd party modules as possible, but I don't see the point why we should make them a part of the main nest repository. Everyone can create its own modules and publish them, so the community would have a good tooling background. Then if an author agrees and the module would look solid & has great use-cases I'd be very happy to move it under ofc nest organization 馃檪

After a day of reflection, I'm thinking about putting few important modules, such as HttpModule directly to the common package. I would be happy to see any PR with interesting, useful modules 馃嵃

I created this a couple days ago. There's probably a bit more that I can do to improve the design (and I should document it), but I think that this is a good candidate and I'd like to know what you think.

https://github.com/jhanschoo/nestjs-standard-middleware

I had something else in mind for middlewares, I'll share it here in a few days.

I've released my middleware package, at https://github.com/wbhob/nest-middlewares . Check it out!

I forgot with is a thing... I guess I'll have to refactor!

I just published a simple Pretty ErrorHandler and Stack Viewer Called Nest-Flub

Dark Theme

dark

Light Theme

light

check it out : https://github.com/shekohex/nestjs-flub

@shekohex I like it a lot 馃檪 maybe do you want to create a PR to the docs? Recipe

@kamilmysliwiec
I should , but I think there is an Un handled Error form Nest Core in request mapping , when I use this filter as Global useGlobalFilter
and I don't know what is going on !
And There is something else , Nest Has it's own Error Handler , that _I_ _think_ it override the Flub Error Handler , I should look at it tomorrow :grinning:

@shekohex looking forward 馃檪

I don't know if third-party packages should go into the docs. Feel free to promote them, but from a purity perspective, this package should either be merged into the core nest framework (not recommended, since it is additional functionality), or kept out of the docs.

@wbhob I'm talking about the recipes section. There we're working only with the 3rd-party libs

Ah, I guess that makes a little sense. Maybe put those docs in a completely different section? That could eventually get really large and overwhelm some users. I can PR that if you want.

@wbhob
We could sort them in Categories

  1. Database Plugins
  2. Security
  3. Middlewares
  4. Filters
    ...

Yes, but they should have their own navigation. @kamilmysliwiec , how would you feel about merging the entire docs into nestjs.com/docs?

in my opinion , if we are gonna to make the ability to build 3rd party module , then we should make access to NestContainer easily , so we can get, add or update the whole application from the 3rd party modules , middlewares, etc..
you could check this issue #282 for more info. and this PR #283

@shekohex since 4.5.0 a ModulesContainer can be injected and easily accessed everywhere 馃挭

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

marshall007 picture marshall007  路  3Comments

mishelashala picture mishelashala  路  3Comments

breitsmiley picture breitsmiley  路  3Comments

cojack picture cojack  路  3Comments

yanshuf0 picture yanshuf0  路  3Comments