meteor-space / base

Foundation for Modular Application Architecture in Meteor.
MIT License
75 stars 5 forks source link

fixes bugs in module config and reset #40

Closed DominikGuzei closed 8 years ago

DominikGuzei commented 8 years ago

This PR fixes a severe bug in the app / module configuration logic. The code is backward-compatible and much simpler now because i reduced "the config" to a single this.app.configuration object in which all modules merge in their own configs in the right order. In the end this application config object is mapped and also assigned as this.configuration on all modules.

This also fixes a smaller issue with Module::reset – this could get called multiple times if a module is required by multiple other modules. I introduced a time-based (Meteor.defer) guard, even though this is not the most elegant solution, it does the job.