Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.

Status #41

Open
grabbou opened this issue Oct 28, 2014 · 1 comment
Open

Status #41

grabbou opened this issue Oct 28, 2014 · 1 comment

Comments

@grabbou
Copy link

grabbou commented Oct 28, 2014

Hi,
I've gone through lots of different approaches when it comes down to organising large NodeJS apps and this one is by far the best one I've ever seen (probably just because I think exactly the same way about DI). The only thing I am worried about is the date of the last commit & the number of awaiting PR's to be reviewed / merged. Is the repo still production-ready & up to date or it's been deprecated? Thanks!

Another question (I will try to sort that out tomorrow) is - whether it's possible to include custom plugin-only dependencies in my package.json? Let's say I have 10 modules (each module declares passport strategy & rest links) and I don't want to pollute my root package.json with social media specific libraries like graph-fb or instagram-node.

And - the very last question - is 'register' callback capable of being invoked as async callback? Let's say I have database module and I want to register it only after successful connection with the database. So it means that other modules that consume it will have to wait till the connection is being established.

@jakecraige
Copy link

I can't vouch for if this will be maintained going forward, but from a quick look, it looks like you can call register asyncronously.

  1. code - An array of plugins is created in the proper order
  2. code - It loops through each plugin recursively passing in a next function that when called, starts the next plugin
  3. code your plugin is called. In a different part it sets the setup method to what you exported from your plugin file. Notice it passes in the register function that you call within your plugin
  4. code - The last line of that register function tells it to continue and load the next plugin

Hopefully that makes sense, but you can load them async. Which is pretty sweet.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants