Newbie question.
Having read 'Migrating to Meteor 1.3’
and now Meteor 1.3 === import statements everywhere?
I’m still confused about what to do.
In Imprting Meteor 1.3 APIs into code @sashko says [quote=“sashko, post:2, topic:20395”]…you’ll always be able to have some file called globals.js that just says global.Meteor = require(‘meteor/meteor’);[/quote]
So I created a globals.js
file in the TLD:
import { Meteor } from 'meteor/meteor'; import { Session } from 'meteor/session'; import { Template } from 'meteor/blaze-html-templates';
…and meteor seems happy.
But then it occurred to me that some modules are client-side-only and some are server-side-only. So should I have a globals.js
file in /client/
and one in /server/
?
If so, given that some modules may do clever stuff on the other side that I’m not aware of, how will I know to put them in a globals.js
file in the TLD?
And, will I always know which modules I’m using? For example, if I create a template in an html file, but I don’t have any helpers or events, I’m still using Blaze templates and so I should still do the blaze-html-templates import. Maybe I’ll use some other feature that isn’t in core and I’ll forget to import the module. Meteor won’t necessarily complain so I won’t know that my code isn’t correct.
Or am I just over-complicating the issue?