SynchroLabs / SynchroServer

The Synchro Server platform
https://synchro.io
1 stars 2 forks source link

Module reload needs to be reflected in other modules that included them via "require" #35

Closed BobDickinson closed 9 years ago

BobDickinson commented 9 years ago

Currently, a Synchro app module can include another Synchro app module via "require". This is handy for shared/utility code used by more than one route module. The problem is that if the included module is updated/deployed, the requiring module will not get a new reference to the required module. This is in contrast to the situation when a module that corresponds to a route is updated, where the command router gets the new instance, and routes any future commands to it (allowing it to "dynamically" update modules on the fly). But any modules included by reference ("require") will not be updated, even if the referring module is also updated (at least currently).

BobDickinson commented 9 years ago

This has been reworked so that if any module in a Synchro app changes, all modules for that app will be unloaded, then the routes for the app will be reloaded (which will then reload any support modules from the app that they use).