Easy way to migrate to Meteor 1.3


#1

Hey everyone,

I have a big project on Meteor 1.2 and I need to update it to 1.3 using modules, i.e. use require (Coffeescript) on each file

How did you move your project to a new version? Because to write import and export for each file is not quick way


#2

First ask yourself if you really need to update your entire app to use ES2015 modules right away. I’m sure you’ll want to eventually, but your app should keep running properly using Meteor 1.3 without modules. You can start to slowly update small parts of your app over time (while possibly adding in tests as you go if you don’t already have them, leveraging the new testing support built into 1.3).

That being said, diving in and adding import/export changes to each file is not necessarily a quick way to refactor, but I’ve found that by doing so I’ve been able to clean up a lot of code along the way. While adding in module support I’ve been able to re-think how a lot of application components communicate and depend on each other, and been able to better structure (decouple) a lot of those components. Not to mention getting rid of all of the load order (directory nesting, file name, packages for everything, etc.) hacks I encounter is awesome.

Yes tackling the module changes file by file can be time consuming, but that time investment is really worth it. In the end you’ll have a cleaner codebase that will be much easier to understand, debug, maintain and extend.