I’m refactoring a lot of code to match the 1.3 guide layout (note: my old code worked flawlessly after the upgrade - Thanks MDG!). One of the patterns I’ve found that I was using was to have collection helpers that really would only ever be called from the server during scheduled jobs (usually via synced-cron or triggered on some other import), to do ‘expensive’ updates to certain kinds of records.
It seems like these maybe shouldn’t be collection helpers, as they are only run on the server and ideally shouldn’t be run (or seen) by the client. It seems like they shouldn’t be methods, because they are never called by the client.
I could wrap the helpers in a Meteor.isServer block, but the code itself would still be delivered to the client. Not a big deal, but one of the reasons I’m refactoring is to reduce the size of the code being sent to the client. I could put those helpers in another file and only load them on the server, but the guide and the todos app don’t really address this scenario, and I’d like to stick to a firm pattern.
In a 1.3 guide-style application structure, where’s the best place to put code like this that only runs on the server but is part of the ‘api’ structure overall?