Meteor 1.3 server folder


#1

I’m confused about the new Meteor 1.3 app folder structure described here:

It seems that all the server code is now in the imports folder instead of the server folder. The server folder only contains imports for the server.

In previous versions of Meteor, the server folder contained the publications as well as configuration code for certain packages, such as the accounts-ui package.

Am I missing something or does Meteor 1.3 completely change the way the app is meant to be structured?


#2

Yes and no. There’s no reason you have to use the imports folder from what I can tell. The main advantage of it is I can control the load order rather than playing around with creating 0 directories just to get the load order right for some of my client side modules.

For the most part even my server code does not use imports except for the collections.js


#3

Also, the imports folder is not just supposed to contain server code.
The idea is - if you want to use explicit imports/exports for load order, as described by @trajano - to have all your code inside the imports directory, and then inside of that you’d sub-divide further into client and server where appropriate (e.g. one client and one server folder per feature folder).

But as mentioned, you don’t yet (!) have to do this. The old implicit (and eager) loading still works in 1.3.