Modular Code best practices


#1

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?


#2

These might be interesting for you:



#3

See here: