68
Laurențiu Macovei DotNetWise [25th of October 2014] A better way to build apps.

Laurentiu macovei meteor. a better way of building apps

Embed Size (px)

DESCRIPTION

CodeCampIasi25Oct2014

Citation preview

Page 1: Laurentiu macovei   meteor. a better way of building apps

Laurențiu MacoveiDotNetWise

[25th of October 2014]

 

A better wayto build apps.

Page 2: Laurentiu macovei   meteor. a better way of building apps

Laurențiu MacoveiDotNetWise

[25th of October 2014]

 

A better wayto build apps.

Page 3: Laurentiu macovei   meteor. a better way of building apps
Page 4: Laurentiu macovei   meteor. a better way of building apps

AgendaWhere we are today

Principles of Meteor

Demo

Page 5: Laurentiu macovei   meteor. a better way of building apps

WorldwideMeteor Day

NOVEMBER 6, 2014

A welcome party in your own city, hosted by Meteor developers all around the world.

http://meteorday.com/

See you on 6 Nov 19:00meetup.com/Meteor-Iasi

Page 6: Laurentiu macovei   meteor. a better way of building apps

So what is Meteor anyways?

Page 7: Laurentiu macovei   meteor. a better way of building apps

Meteor = Code + Community

Meteor is an open sourcefull stack framework that makes reactive real time applications really easy to build

Page 8: Laurentiu macovei   meteor. a better way of building apps

Meteor = Code + Community

Community is organizing people to accomplish great things

Monthly Meteor Devshop is held in San Francisco and London (http://goo.gl/mWhWZC)

Page 9: Laurentiu macovei   meteor. a better way of building apps

Today?

Where are we?

Page 10: Laurentiu macovei   meteor. a better way of building apps

6 nov 2011 the

first commit of

Meteor

11340 commits

eversince

Page 11: Laurentiu macovei   meteor. a better way of building apps

Knockout JS

Durandal JS

Derby

http://code.tutsplus.com/tutorials/important-considerations-when-building-single-page-web-apps--net-29356

Page 12: Laurentiu macovei   meteor. a better way of building apps

Knockout JS

Durandal JS

Derby

XML / REST / SOAP / POX / JSON / JSV / ...

Page 13: Laurentiu macovei   meteor. a better way of building apps

Knockout JS

Durandal JS

Derby

XML / REST / SOAP / POX / JSON / JSV / ... Reactive

Page 14: Laurentiu macovei   meteor. a better way of building apps

Rective programming

A programming paradigm oriented around data flows and the propagation of change.

Page 15: Laurentiu macovei   meteor. a better way of building apps
Page 16: Laurentiu macovei   meteor. a better way of building apps

Meteor Roadmap: 0.9.4 today

1.0 will be released on 6th Nov

Under consideration for 1.1+Native Windows support Until then you can use vagrant https://github.com/shoebappa/vagrant-meteor-windows

Other databases support than MongoDBroadmap.meteor.com

Page 17: Laurentiu macovei   meteor. a better way of building apps

D:\Work\Codecamp\2014\CoffeesScript.png

Stargazers (as of 14 oct 2014)

Reactive

Reactive

Page 18: Laurentiu macovei   meteor. a better way of building apps

000 Funding

...not only has a team of dedicated and capable engineers with a vision for changing the world (nearly every team has that),

but it also has a lovely bank account: $11.2 million in funding (hardly any team has that)

http://goo.gl/Gnfcww

Page 19: Laurentiu macovei   meteor. a better way of building apps

Nine principles of Meteor1. One language2. Simplicity ===

Productivity

3. Data on the Wire4. Database Everywhere5. Latency Compensation6. Hot Code Pushes

7. Embrace the Ecosystem

8. Interoperability9. Smart packages

10. Full Stack Reactivity

Page 20: Laurentiu macovei   meteor. a better way of building apps

Nine principles of Meteor1. One language2. Simplicity ===

Productivity

3. Data on the Wire4. Database Everywhere5. Latency Compensation6. Hot Code Pushes

7. Embrace the Ecosystem

8. Interoperability9. Smart packages

10. Full Stack Reactivity

Page 21: Laurentiu macovei   meteor. a better way of building apps

001 Pure Javascript

Write your entire app in pure JavaScript.

Page 22: Laurentiu macovei   meteor. a better way of building apps

JAVASCRIPT

JAVASCRIPT EVERYWHERE

Page 23: Laurentiu macovei   meteor. a better way of building apps

001 Pure Javascript

All the same APIs are available on the client and the server — including database APIs!

Page 24: Laurentiu macovei   meteor. a better way of building apps

001 Pure Javascript

All the same APIs are available on the client and the server — including database APIs!

Page 25: Laurentiu macovei   meteor. a better way of building apps

001 Pure Javascript

All the same APIs are available on the client and the server — including database APIs!

Page 26: Laurentiu macovei   meteor. a better way of building apps

001 Traditional Stack vs Pure Javascript

ClientHTML, CSS, Javascript

ServerProgramming Language, Database Access, Marshalling Language

Page 27: Laurentiu macovei   meteor. a better way of building apps

001 Traditional Stack vs Pure Javascript

ClientHTML, CSS, Javascript

ServerProgramming Language, Database Access, Marshalling Language

SQL rows -> Entities -> JSON

Page 28: Laurentiu macovei   meteor. a better way of building apps

001 Meteor Stack embraces Pure Javascript

ClientHTML, CSS, Javascript, MiniMongo

ServerJavascript, Mongo

Page 29: Laurentiu macovei   meteor. a better way of building apps

001 Pure Javascript

https://meteorhacks.com/introduction-to-ddp.html

Page 30: Laurentiu macovei   meteor. a better way of building apps

001 Pure Javascript

Even MongoDB stores JSON documents and uses Javascript syntax to query, insert, update and delete data

Page 31: Laurentiu macovei   meteor. a better way of building apps

002 Simplicity === Productivity

One command to create an app meteor create awesome

Page 32: Laurentiu macovei   meteor. a better way of building apps

002 Simplicity === Productivity

One command to locally run your app

meteor

Page 33: Laurentiu macovei   meteor. a better way of building apps

002 Simplicity === Productivity

One command to compile your entire application into a fully self-contained bundle

meteor build

Page 34: Laurentiu macovei   meteor. a better way of building apps

002 Simplicity === Productivity

One command to deploy your app into the cloud

meteor deploy awesome

-> http://awesome.meteor.com

Page 35: Laurentiu macovei   meteor. a better way of building apps

002 Simplicity === Productivity

One command to run on premises: Unpack it anywhere there's node.js

forever start bundle/main.js

Page 36: Laurentiu macovei   meteor. a better way of building apps

003 Data on the Wire.Live page updates.

„Apps need Templates, Templates need DATA”

Page 37: Laurentiu macovei   meteor. a better way of building apps

003 Live page updates„Apps need Templates, Templates need

DATA”

Just write your templates.

Page 38: Laurentiu macovei   meteor. a better way of building apps

003 Data on the wire.They automatically update when data in the database changes

Page 39: Laurentiu macovei   meteor. a better way of building apps

003 Data on the wire.

Supports any templating language. (But as of 0.9.4 only ships with Blaze)

Page 40: Laurentiu macovei   meteor. a better way of building apps

003 Data on the wire.

Supports any templating language. (But as of 0.9.4 only ships with Blaze)

Jade, Knockout and Famo.us are community supported.

Page 41: Laurentiu macovei   meteor. a better way of building apps

003 Data on the wire. Live page updates – KO example

Page 42: Laurentiu macovei   meteor. a better way of building apps

004 Database Everywhere. Clean, powerful data synchronization.

Write your client code as if it were running on the server and had direct access to the database. 

Page 43: Laurentiu macovei   meteor. a better way of building apps

004 Database Everywhere.Write your client code as if it were running on the server and had direct access to the database. 

Page 44: Laurentiu macovei   meteor. a better way of building apps

004 Database Everywhere.

Publish / Subscribe mechanism

Page 45: Laurentiu macovei   meteor. a better way of building apps

004 Database Everywhere.

Publish / Subscribe mechanism

Page 46: Laurentiu macovei   meteor. a better way of building apps

004 Database Everywhere.

Publish / Subscribe mechanism

Page 47: Laurentiu macovei   meteor. a better way of building apps

004 Database Everywhere.Publish / Subscribe mechanism

Page 48: Laurentiu macovei   meteor. a better way of building apps

004 Database Everywhere.

The code itself is your API.

No more loading your data from REST endpoints.

Page 49: Laurentiu macovei   meteor. a better way of building apps

005 Latency compensation.

When a user makes a change, their screen updates immediately — no waiting for the server. 

Page 50: Laurentiu macovei   meteor. a better way of building apps

005 Latency compensation.In a traditional app, the client does an action and waits for the server to respond. Wait time increases gradually with the server load.

Traditional

Page 51: Laurentiu macovei   meteor. a better way of building apps

005 Latency compensation.When a user makes a change, their screen updates immediately — no waiting for the server. 

With latency compensationTraditional

Page 52: Laurentiu macovei   meteor. a better way of building apps

005 Latency compensation.

If the server rejects their request –or– executes it differentlyThe client is patched up with what actually happened.

Page 53: Laurentiu macovei   meteor. a better way of building apps

006 Hot Code Pushes.

Update your app while users are connected without disturbing them. 

Page 54: Laurentiu macovei   meteor. a better way of building apps

006 Hot Code Pushes.

When you push a new version, the new code is seamlessly injected into each browser frame in which the app is open.

Page 55: Laurentiu macovei   meteor. a better way of building apps

006 Hot Code Pushes.

Supports mobile platforms too with Cordova / Phonegap:

meteor add platform androidmeteor add platform ios

Page 56: Laurentiu macovei   meteor. a better way of building apps

006 Hot Code Pushes.

Yes! Apple allows hot code pushes in IOS & AppStore.

Although, LocalStorage is limited to 5MB!

Page 57: Laurentiu macovei   meteor. a better way of building apps

007 Embrace the Ecosystem.

Meteor is open source and integrates, rather than replaces, existing open source tools and frameworks.

Page 58: Laurentiu macovei   meteor. a better way of building apps

007 Embrace the Ecosystem.Meteor integrates with: open source popular examples:

Angular https://medium.com/@zfxuan/the-wonderful-duo-using-meteor-and-angularjs-together-4d603a4651bf

Famo.us https://www.youtube.com/watch?v=bmd-cXSGQAA

Polymer https://github.com/ecwyne/meteor-polymer

officially: Velocity – Unit Testing for Meteor using

jasmine mocha selenium

Page 59: Laurentiu macovei   meteor. a better way of building apps

008 Interoperability.

You can connect anything to Meteor, from native mobile apps to legacy databases to Arduinos.

Just implement the simple DDP (Distributed Data Protocol).http://www.meteorpedia.com/read/DDP_Clients

Page 60: Laurentiu macovei   meteor. a better way of building apps

009 Smart Packages.Meteor's Smart Packages are actually little programs that can inject code into the client or the server, or even hook into the bundler to preprocess your source.

https://atmospherejs.com

meteor add iron:router

Some examples:iron:router accounts-uiless spiderable – enable SEO to your site

Page 61: Laurentiu macovei   meteor. a better way of building apps
Page 63: Laurentiu macovei   meteor. a better way of building apps

Is it a better way to build apps?

1. Your applications are real-time by default.

2. You can develop with just one language.

3. The community is extremely supportive.

Page 64: Laurentiu macovei   meteor. a better way of building apps

Is it a better way to build apps?

4. You can save a lot of time with smart packages.

5. It’s optimized for developer happiness.

6. It’s friendly to beginner developers.

7. It’s ahead of the tech curve.

Page 65: Laurentiu macovei   meteor. a better way of building apps

Q & AThe End of Dinosaurs

happened because of [a] Meteor

See you @Meteor Devshop on 6th Nov

meetup.com/Meteor-Iasi

Page 66: Laurentiu macovei   meteor. a better way of building apps
Page 67: Laurentiu macovei   meteor. a better way of building apps

kadira.io