[meteor 1.3.1] meteor packages only load when import?

meteor 1.3 support npm packages too,
so i don’t know Meteor packages is only run when imported like npm packages ?
or it will be loaded whenever ?

Outside of imports folder, it should still eagerly load similar to 1.2.1.

2 Likes

thanks mr @nolapete so i love imports folders :smiley:
if we just install package and without import, it still run when app run ?

Only outside of imports from what I understand from the meteor guide.

2 Likes

Yes, Meteor packages always execute when the app starts, regardless of whether they are imported at all.

1 Like

From meteor guide 1.3

1 Like

Is it just me or is that a poor choice for a directory name?

Without reading the documents, I would have assumed anything inside a folder called imports would be automatically imported…

What would you call it?

Yeah I am not sure, something that implies that the files are not imported? (I could be completely wrong on this, I haven’t come across this before and just my initial impression from seeing the documentation)

How about rather than relying on the directory structure couldn’t there be a settings.json flag which requests which method of compilation you want? I am guessing thats a bigger change…

To be honest, I don’t really fully understand the implications of what I am suggesting.
I am still running my apps with the old structure (root dir with client/server/lib/public dirs) and the imports folder just confused me. :slight_smile:

How about calling it “onlyimportedifyouimport” ?

3 Likes

For me it’s still unclear. If I’m in the imports dir, should I import atmosphere packages or not?
For example I’m editing the /imports/startup/routes.js file. Should I have a line that imports FlowRouter like this?
import { FlowRouter } from ‘meteor/kadira:flow-router’;

Or…?