Modular Code best practices

Hi I’ve been using Meteor for about a month now. Very in love with some of the features. Coming from an Ember background losing es6 modules is not my favorite thing ever. I’ve starting trying to make smart packages and I’m trying to make things as modular as possible.

I have gone back to some older ways of making things modular.

if(Meteor.isClient){
  if(typeof(Meteor.JChess) === 'undefined'){
    Meteor.JChess = {};
  }
  else{
    console.warn('global namespace conflict. JChess namespace was not initialized as another object already exists by this name');
  }
}

This allows me to append other smaller modules to this namespace and breakup my files, but as it scales this is starting to feel like a verbose approach. Are there any opinions/suggestions on creating modular smartpackages in meteor?

These might be interesting for you:


See here:

1 Like