3. • /server - scripts are executed only on
server
• /client - scripts are executed only on
client
• /public - images and other static assets
• all other scripts are executed both on
server and client
Execution scope
4. • HTML template are loaded first
• After HTML templates scripts from /lib
folder are loaded
• main.* is loaded the last
• Files which are nested deeper in file
structure have priority in execution order
• All other files are executed in alphabetic
order
Loading order
5. • lib/module1/*
• lib/module2/*
• client/module1/*
• client/module2/*
• server/module1/*
• server/module2/*
Modules by execution type
11. Package.on_use(function(api) {
var file, filesToLoad, path, accessType, accessPaths, _i, _len;
for (accessType in FILE_CONFIG) {
accessPaths = FILE_CONFIG[accessType];
for (path in accessPaths) {
filesToLoad = accessPaths[path];
for (_i = 0, _len = filesToLoad.length; _i < _len; _i++) {
file = filesToLoad[_i];
api.add_files(path + file, eval(accessType));
}
}
}
});
More package bootstrapping
12. var EXPORT = [‘Module1’, ‘Model1’];
Package.on_use(function(api) {
return api.export(EXPORT);
});
Public module namespace
13. Module1 = {}
Module1.ROUTE_NAME = 'index'
Module1.TEMPLATE_NAME = 'index'
Meteor.startup(function() {
if (Meteor.isServer) {
bootstrapServer();
}
if (Meteor.isClient) {
bootstrapClient();
}
});
var bootstrapClient = function() {};
var bootstrapServer = function() {
Model1.setInstance(Model1.factory());
};
Module loader
14. class Model1
@COLLECTION_NAME = ‘model1'
@collection = null
@getCollection: -> @collection
@setCollection: (collection) -> @collection = collection
constructor: (data) -> _.extend @, data
getCollection: -> Model1.getCollection()
customMethod: ->
Model1.setCollection new Mongo.Collection
Model1.COLLECTION_NAME,
transform: (data) -> new Model1 data
Model
15. • Production-ready hosting for meteor deploy
• Kubernetes.io (Docker container
management system)
• Official support for React.js and Angular
• Official support for ECMAScript 2015 (ES6)
• Better build tools
Next release (Galaxy, Meteor
1.2)
16. • Support of SQL
• REST and micro-services
• Testing with Velocity
• Better tools for mobile development and
testing
• Integration of routing in a core
After Meteor 1.2