SlideShare a Scribd company logo
Structure and modules on
Meteor.js
Vyacheslav
Voronchuk
CEO of Starbuildr LLC
• /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
• 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
• lib/module1/*
• lib/module2/*
• client/module1/*
• client/module2/*
• server/module1/*
• server/module2/*
Modules by execution type
• module1/lib/*
• module1/client/*
• module1/server/*
• module2/lib/*
• module2/client/*
• module2/server/*
Modules by folders
• packages/module1/package.js
• packages/module1/*
• packages/module2/package.js
• packages/module2/*
Packages
var ACCESS_CLIENT = 'client';
var ACCESS_SERVER = 'server';
var ACCESS_BOTH = [ACCESS_CLIENT, ACCESS_SERVER];
var DEP_CONFIG = [
{ name: 'coffeescript', access: ACCESS_BOTH },
{ name: 'jquery', access: ACCESS_CLIENT },
{ name: 'underscore', access: ACCESS_BOTH },
{ name: 'meteor-platform', access: ACCESS_BOTH },
{ name: 'accounts-ui', access: ACCESS_BOTH },
];
var NPM_DEP_CONFIG = {
'redis': '0.12.1'
};
Module dependencies
Package.on_use(function(api) {
var depConfig, accessType, accessPaths, _i, _len;
for (_i = 0, _len = DEP_CONFIG.length; _i < _len; _i++)
{
depConfig = DEP_CONFIG[_i];
api.use(depConfig.name, depConfig.access);
}
Npm.depends(NPM_DEP_CONFIG);
});
Package bootstrap
var FILE_CONFIG = {};
FILE_CONFIG['ACCESS_BOTH'] = {
'coffee/': [
'bootstrap.coffee'
],
'coffee/route/': [
'config.coffee',
'IndexController.coffee'
]
};
FILE_CONFIG['ACCESS_CLIENT'] = {
'client/view/': [
'index.html',
'indexLayout.html'
],
'client/style/': [
'fix-icon.css',
'main.css'
],
};
File loading order
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
var EXPORT = [‘Module1’, ‘Model1’];
Package.on_use(function(api) {
return api.export(EXPORT);
});
Public module namespace
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
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
• 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)
• 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
Thank you!
voronchuk@starbuildr.com
Skype: voronhukvk
https://www.linkedin.com/in/voronchuk

More Related Content

What's hot

SFScon 2020 - Nikola Milisavljevic - BASE - Python REST API framework
SFScon 2020 - Nikola Milisavljevic - BASE - Python REST API frameworkSFScon 2020 - Nikola Milisavljevic - BASE - Python REST API framework
SFScon 2020 - Nikola Milisavljevic - BASE - Python REST API framework
South Tyrol Free Software Conference
 
JBoss AS7 web services
JBoss AS7 web servicesJBoss AS7 web services
JBoss AS7 web services
alepalin
 
M property
M propertyM property
M property
Vasanthii Chowdary
 
Using properties in mule
Using properties in muleUsing properties in mule
Using properties in mule
Son Nguyen
 
MuleSoft ESB Scripting Example
MuleSoft ESB Scripting ExampleMuleSoft ESB Scripting Example
MuleSoft ESB Scripting Example
akashdprajapati
 
Firefox vs. chrome
Firefox vs. chromeFirefox vs. chrome
Firefox vs. chrome
Prabhath Suminda
 
Wordpress architecture
Wordpress architectureWordpress architecture
Wordpress architecture
David Rajah Selvaraj
 
Architecture of Drupal - Drupal Camp
Architecture of Drupal - Drupal CampArchitecture of Drupal - Drupal Camp
Architecture of Drupal - Drupal Camp
Dipen Chaudhary
 
Web browser
Web browserWeb browser
Web browser
Ashwini Kumar
 

What's hot (9)

SFScon 2020 - Nikola Milisavljevic - BASE - Python REST API framework
SFScon 2020 - Nikola Milisavljevic - BASE - Python REST API frameworkSFScon 2020 - Nikola Milisavljevic - BASE - Python REST API framework
SFScon 2020 - Nikola Milisavljevic - BASE - Python REST API framework
 
JBoss AS7 web services
JBoss AS7 web servicesJBoss AS7 web services
JBoss AS7 web services
 
M property
M propertyM property
M property
 
Using properties in mule
Using properties in muleUsing properties in mule
Using properties in mule
 
MuleSoft ESB Scripting Example
MuleSoft ESB Scripting ExampleMuleSoft ESB Scripting Example
MuleSoft ESB Scripting Example
 
Firefox vs. chrome
Firefox vs. chromeFirefox vs. chrome
Firefox vs. chrome
 
Wordpress architecture
Wordpress architectureWordpress architecture
Wordpress architecture
 
Architecture of Drupal - Drupal Camp
Architecture of Drupal - Drupal CampArchitecture of Drupal - Drupal Camp
Architecture of Drupal - Drupal Camp
 
Web browser
Web browserWeb browser
Web browser
 

Viewers also liked

Эндогенное дыхание - книга
Эндогенное дыхание - книгаЭндогенное дыхание - книга
Эндогенное дыхание - книга
Пётр Буянов
 
FRP and Bacon.js
FRP and Bacon.jsFRP and Bacon.js
FRP and Bacon.js
Starbuildr
 
Информация и правила работы с ней.
Информация и правила работы с ней.Информация и правила работы с ней.
Информация и правила работы с ней.
Роман Савчук
 
презентация ДО ПриCутствия
презентация ДО ПриCутствия презентация ДО ПриCутствия
презентация ДО ПриCутствия
Пётр Буянов
 
Laboring - защити свои права!
Laboring - защити свои права!Laboring - защити свои права!
Laboring - защити свои права!
Роман Савчук
 
Inter capital en
Inter capital enInter capital en
Inter capital en
Andrey Avatarskiy
 
Coffeescript a z
Coffeescript a zCoffeescript a z
Coffeescript a z
Starbuildr
 
Как стать профессиональным дайвером в море информации
Как стать профессиональным дайвером в море информацииКак стать профессиональным дайвером в море информации
Как стать профессиональным дайвером в море информации
Роман Савчук
 
Явление Иерархии
Явление ИерархииЯвление Иерархии
Явление Иерархии
Пётр Буянов
 
Odoo 2016 - Retrospective
Odoo 2016 - RetrospectiveOdoo 2016 - Retrospective
Odoo 2016 - Retrospective
Odoo
 

Viewers also liked (12)

Эндогенное дыхание - книга
Эндогенное дыхание - книгаЭндогенное дыхание - книга
Эндогенное дыхание - книга
 
FRP and Bacon.js
FRP and Bacon.jsFRP and Bacon.js
FRP and Bacon.js
 
Информация и правила работы с ней.
Информация и правила работы с ней.Информация и правила работы с ней.
Информация и правила работы с ней.
 
презентация ДО ПриCутствия
презентация ДО ПриCутствия презентация ДО ПриCутствия
презентация ДО ПриCутствия
 
Laboring - защити свои права!
Laboring - защити свои права!Laboring - защити свои права!
Laboring - защити свои права!
 
Inter capital en
Inter capital enInter capital en
Inter capital en
 
Coffeescript a z
Coffeescript a zCoffeescript a z
Coffeescript a z
 
Как стать профессиональным дайвером в море информации
Как стать профессиональным дайвером в море информацииКак стать профессиональным дайвером в море информации
Как стать профессиональным дайвером в море информации
 
Явление Иерархии
Явление ИерархииЯвление Иерархии
Явление Иерархии
 
Prez f
Prez fPrez f
Prez f
 
жителям мд
жителям мджителям мд
жителям мд
 
Odoo 2016 - Retrospective
Odoo 2016 - RetrospectiveOdoo 2016 - Retrospective
Odoo 2016 - Retrospective
 

Similar to Meteor modules

Build Automation of PHP Applications
Build Automation of PHP ApplicationsBuild Automation of PHP Applications
Build Automation of PHP Applications
Pavan Kumar N
 
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
Lucidworks
 
CodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkCodeIgniter PHP MVC Framework
CodeIgniter PHP MVC Framework
Bo-Yi Wu
 
Introduction to Monsoon PHP framework
Introduction to Monsoon PHP frameworkIntroduction to Monsoon PHP framework
Introduction to Monsoon PHP framework
Krishna Srikanth Manda
 
Social Connections VI — IBM Connections Extensions and Themes Demystified
Social Connections VI — IBM Connections Extensions and Themes DemystifiedSocial Connections VI — IBM Connections Extensions and Themes Demystified
Social Connections VI — IBM Connections Extensions and Themes Demystified
Claudio Procida
 
Decoupled Libraries for PHP
Decoupled Libraries for PHPDecoupled Libraries for PHP
Decoupled Libraries for PHP
Paul Jones
 
CICON2010: Adam Griffiths - CodeIgniter 2
CICON2010: Adam Griffiths - CodeIgniter 2CICON2010: Adam Griffiths - CodeIgniter 2
CICON2010: Adam Griffiths - CodeIgniter 2
CodeIgniter Conference
 
Drupal 8 configuration development flow
Drupal 8 configuration development flowDrupal 8 configuration development flow
Drupal 8 configuration development flow
Andrii Podanenko
 
Intro to WordPress Plugin Development
Intro to WordPress Plugin DevelopmentIntro to WordPress Plugin Development
Intro to WordPress Plugin Development
Brad Williams
 
Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3
Drupalcon Paris
 
Where Flux and InfluxDB Are Headed | Paul Dix | InfluxData
Where Flux and InfluxDB Are Headed | Paul Dix | InfluxData Where Flux and InfluxDB Are Headed | Paul Dix | InfluxData
Where Flux and InfluxDB Are Headed | Paul Dix | InfluxData
InfluxData
 
Requiring your own files.pptx
Requiring your own files.pptxRequiring your own files.pptx
Requiring your own files.pptx
Lovely Professional University
 
Custom module and theme development in Drupal7
Custom module and theme development in Drupal7Custom module and theme development in Drupal7
Custom module and theme development in Drupal7
marif4pk
 
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and BeyondDrupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
DrupalDay
 
Creating Custom Templates for Joomla! 2.5
Creating Custom Templates for Joomla! 2.5Creating Custom Templates for Joomla! 2.5
Creating Custom Templates for Joomla! 2.5
Don Cranford
 
OroCRM Partner Technical Training: September 2015
OroCRM Partner Technical Training: September 2015OroCRM Partner Technical Training: September 2015
OroCRM Partner Technical Training: September 2015
Oro Inc.
 
Customising the CloudStack UI - CloudStack European User Group Virtual, May 2...
Customising the CloudStack UI - CloudStack European User Group Virtual, May 2...Customising the CloudStack UI - CloudStack European User Group Virtual, May 2...
Customising the CloudStack UI - CloudStack European User Group Virtual, May 2...
ShapeBlue
 
Webinar - Managing Files with Puppet
Webinar - Managing Files with PuppetWebinar - Managing Files with Puppet
Webinar - Managing Files with Puppet
OlinData
 
CodeIgniter & MVC
CodeIgniter & MVCCodeIgniter & MVC
CodeIgniter & MVC
Jamshid Hashimi
 
Codeigniter : Two Step View - Concept Implementation
Codeigniter : Two Step View - Concept ImplementationCodeigniter : Two Step View - Concept Implementation
Codeigniter : Two Step View - Concept Implementation
Abdul Malik Ikhsan
 

Similar to Meteor modules (20)

Build Automation of PHP Applications
Build Automation of PHP ApplicationsBuild Automation of PHP Applications
Build Automation of PHP Applications
 
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
Challenges of Simple Documents: When Basic isn't so Basic - Cassandra Targett...
 
CodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkCodeIgniter PHP MVC Framework
CodeIgniter PHP MVC Framework
 
Introduction to Monsoon PHP framework
Introduction to Monsoon PHP frameworkIntroduction to Monsoon PHP framework
Introduction to Monsoon PHP framework
 
Social Connections VI — IBM Connections Extensions and Themes Demystified
Social Connections VI — IBM Connections Extensions and Themes DemystifiedSocial Connections VI — IBM Connections Extensions and Themes Demystified
Social Connections VI — IBM Connections Extensions and Themes Demystified
 
Decoupled Libraries for PHP
Decoupled Libraries for PHPDecoupled Libraries for PHP
Decoupled Libraries for PHP
 
CICON2010: Adam Griffiths - CodeIgniter 2
CICON2010: Adam Griffiths - CodeIgniter 2CICON2010: Adam Griffiths - CodeIgniter 2
CICON2010: Adam Griffiths - CodeIgniter 2
 
Drupal 8 configuration development flow
Drupal 8 configuration development flowDrupal 8 configuration development flow
Drupal 8 configuration development flow
 
Intro to WordPress Plugin Development
Intro to WordPress Plugin DevelopmentIntro to WordPress Plugin Development
Intro to WordPress Plugin Development
 
Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3
 
Where Flux and InfluxDB Are Headed | Paul Dix | InfluxData
Where Flux and InfluxDB Are Headed | Paul Dix | InfluxData Where Flux and InfluxDB Are Headed | Paul Dix | InfluxData
Where Flux and InfluxDB Are Headed | Paul Dix | InfluxData
 
Requiring your own files.pptx
Requiring your own files.pptxRequiring your own files.pptx
Requiring your own files.pptx
 
Custom module and theme development in Drupal7
Custom module and theme development in Drupal7Custom module and theme development in Drupal7
Custom module and theme development in Drupal7
 
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and BeyondDrupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
Drupal Day 2012 - Automating Drupal Development: Make!les, Features and Beyond
 
Creating Custom Templates for Joomla! 2.5
Creating Custom Templates for Joomla! 2.5Creating Custom Templates for Joomla! 2.5
Creating Custom Templates for Joomla! 2.5
 
OroCRM Partner Technical Training: September 2015
OroCRM Partner Technical Training: September 2015OroCRM Partner Technical Training: September 2015
OroCRM Partner Technical Training: September 2015
 
Customising the CloudStack UI - CloudStack European User Group Virtual, May 2...
Customising the CloudStack UI - CloudStack European User Group Virtual, May 2...Customising the CloudStack UI - CloudStack European User Group Virtual, May 2...
Customising the CloudStack UI - CloudStack European User Group Virtual, May 2...
 
Webinar - Managing Files with Puppet
Webinar - Managing Files with PuppetWebinar - Managing Files with Puppet
Webinar - Managing Files with Puppet
 
CodeIgniter & MVC
CodeIgniter & MVCCodeIgniter & MVC
CodeIgniter & MVC
 
Codeigniter : Two Step View - Concept Implementation
Codeigniter : Two Step View - Concept ImplementationCodeigniter : Two Step View - Concept Implementation
Codeigniter : Two Step View - Concept Implementation
 

Recently uploaded

怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
rtunex8r
 
cyber crime.pptx..........................
cyber crime.pptx..........................cyber crime.pptx..........................
cyber crime.pptx..........................
GNAMBIKARAO
 
Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...
Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...
Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...
APNIC
 
Securing BGP: Operational Strategies and Best Practices for Network Defenders...
Securing BGP: Operational Strategies and Best Practices for Network Defenders...Securing BGP: Operational Strategies and Best Practices for Network Defenders...
Securing BGP: Operational Strategies and Best Practices for Network Defenders...
APNIC
 
一比一原版(uc毕业证书)加拿大卡尔加里大学毕业证如何办理
一比一原版(uc毕业证书)加拿大卡尔加里大学毕业证如何办理一比一原版(uc毕业证书)加拿大卡尔加里大学毕业证如何办理
一比一原版(uc毕业证书)加拿大卡尔加里大学毕业证如何办理
dtagbe
 
HijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process HollowingHijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process Hollowing
Donato Onofri
 
KubeCon & CloudNative Con 2024 Artificial Intelligent
KubeCon & CloudNative Con 2024 Artificial IntelligentKubeCon & CloudNative Con 2024 Artificial Intelligent
KubeCon & CloudNative Con 2024 Artificial Intelligent
Emre Gündoğdu
 
How to make a complaint to the police for Social Media Fraud.pdf
How to make a complaint to the police for Social Media Fraud.pdfHow to make a complaint to the police for Social Media Fraud.pdf
How to make a complaint to the police for Social Media Fraud.pdf
Infosec train
 
Bengaluru Dreamin' 24 - Personal Branding
Bengaluru Dreamin' 24 - Personal BrandingBengaluru Dreamin' 24 - Personal Branding
Bengaluru Dreamin' 24 - Personal Branding
Tarandeep Singh
 
一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理
一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理
一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理
thezot
 
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
3a0sd7z3
 
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
3a0sd7z3
 

Recently uploaded (12)

怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
 
cyber crime.pptx..........................
cyber crime.pptx..........................cyber crime.pptx..........................
cyber crime.pptx..........................
 
Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...
Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...
Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...
 
Securing BGP: Operational Strategies and Best Practices for Network Defenders...
Securing BGP: Operational Strategies and Best Practices for Network Defenders...Securing BGP: Operational Strategies and Best Practices for Network Defenders...
Securing BGP: Operational Strategies and Best Practices for Network Defenders...
 
一比一原版(uc毕业证书)加拿大卡尔加里大学毕业证如何办理
一比一原版(uc毕业证书)加拿大卡尔加里大学毕业证如何办理一比一原版(uc毕业证书)加拿大卡尔加里大学毕业证如何办理
一比一原版(uc毕业证书)加拿大卡尔加里大学毕业证如何办理
 
HijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process HollowingHijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process Hollowing
 
KubeCon & CloudNative Con 2024 Artificial Intelligent
KubeCon & CloudNative Con 2024 Artificial IntelligentKubeCon & CloudNative Con 2024 Artificial Intelligent
KubeCon & CloudNative Con 2024 Artificial Intelligent
 
How to make a complaint to the police for Social Media Fraud.pdf
How to make a complaint to the police for Social Media Fraud.pdfHow to make a complaint to the police for Social Media Fraud.pdf
How to make a complaint to the police for Social Media Fraud.pdf
 
Bengaluru Dreamin' 24 - Personal Branding
Bengaluru Dreamin' 24 - Personal BrandingBengaluru Dreamin' 24 - Personal Branding
Bengaluru Dreamin' 24 - Personal Branding
 
一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理
一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理
一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理
 
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
 
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
 

Meteor modules

  • 1. Structure and modules on Meteor.js Vyacheslav Voronchuk CEO of Starbuildr LLC
  • 2.
  • 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
  • 6. • module1/lib/* • module1/client/* • module1/server/* • module2/lib/* • module2/client/* • module2/server/* Modules by folders
  • 7. • packages/module1/package.js • packages/module1/* • packages/module2/package.js • packages/module2/* Packages
  • 8. var ACCESS_CLIENT = 'client'; var ACCESS_SERVER = 'server'; var ACCESS_BOTH = [ACCESS_CLIENT, ACCESS_SERVER]; var DEP_CONFIG = [ { name: 'coffeescript', access: ACCESS_BOTH }, { name: 'jquery', access: ACCESS_CLIENT }, { name: 'underscore', access: ACCESS_BOTH }, { name: 'meteor-platform', access: ACCESS_BOTH }, { name: 'accounts-ui', access: ACCESS_BOTH }, ]; var NPM_DEP_CONFIG = { 'redis': '0.12.1' }; Module dependencies
  • 9. Package.on_use(function(api) { var depConfig, accessType, accessPaths, _i, _len; for (_i = 0, _len = DEP_CONFIG.length; _i < _len; _i++) { depConfig = DEP_CONFIG[_i]; api.use(depConfig.name, depConfig.access); } Npm.depends(NPM_DEP_CONFIG); }); Package bootstrap
  • 10. var FILE_CONFIG = {}; FILE_CONFIG['ACCESS_BOTH'] = { 'coffee/': [ 'bootstrap.coffee' ], 'coffee/route/': [ 'config.coffee', 'IndexController.coffee' ] }; FILE_CONFIG['ACCESS_CLIENT'] = { 'client/view/': [ 'index.html', 'indexLayout.html' ], 'client/style/': [ 'fix-icon.css', 'main.css' ], }; File loading order
  • 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