19
JavaScript MV* Framework - Making the Right Choice by @sheiko

JavaScript MV* Framework - Making the Right Choice

Embed Size (px)

DESCRIPTION

Choosing a MV*-framework that doesn't destroy JavaScript, but brings consistency into app design

Citation preview

Page 1: JavaScript MV* Framework - Making the Right Choice

JavaScript MV* Framework -

Making the Right Choice

by @sheiko

Page 2: JavaScript MV* Framework - Making the Right Choice

Who’s the dude?

I’m Dmitry Sheiko, a web-developer, blogger,

open source contributor.

http://dsheiko.com

@sheiko

https://github.com/dsheiko

Page 3: JavaScript MV* Framework - Making the Right Choice

What do I need a framework for?

• Abstractions (separation of concerns)

• Implicit conventions

• Code reusability

• Data Binding

• Widgets Library

Page 4: JavaScript MV* Framework - Making the Right Choice

What framework do I need?

MVC

Backbone

MVP

MVVM

AngularJS

Ember.js

Dojo

YUI

Agility.js

KnockoutJS

CanJS

Maria

Polymer

React

cujoJS Montage

Sammy.js

Stapes

Epitome

DUEL

Kendo UI PureMVC

Olives

PlastronJS

Dijon

rAppid.js

DeftJS + ExtJS

SAPUI5

Exoskeleton

Atma.js

Ractive.js

ComponentJS

Vue.js

Page 5: JavaScript MV* Framework - Making the Right Choice

Big Three

AngularJS

Backbone

Ember.js

Page 6: JavaScript MV* Framework - Making the Right Choice

How they implement MV*

bit.ly/1p24xgq

Collection

Model

Template

Router

Controller

Scope View

AngularJS

Backbone

Ember.js

Page 7: JavaScript MV* Framework - Making the Right Choice

How active developers community

Backbone Stars: 18 264

Forks: 4 066

Open issues: 26

Closed issues: 3 151

Ember.js Stars: 10 442

Forks: 2 249

Open issues: 220

Closed issues: 4 788

AngularJS Stars: 24 958

Forks: 8 635

Open issues: 1 117

Closed issues: 6 704

via Github

13.06.2014

Page 8: JavaScript MV* Framework - Making the Right Choice

How good FAQ support

Backbone Questions: 15 191

Answered: 9 193

60%

Avg answers per question: 2.24

Ember.js Questions: 18 243

Answered: 11 120

61%

Avg answers per question: 2.40

AngularJS Questions: 40 312

Answered: 22 382

55%

Avg answers per question: 2.30

via StackExchange

13.06.2014

Page 9: JavaScript MV* Framework - Making the Right Choice

The hidden part of the iceberg

AngularJS Logical LOC: 6 748

Mean parameter count: 1.5

Cyclomatic complexity: 1 548

Cyclomatic complexity

density: 23%

Maintainability index: 113

Production build: 108K

Ember.js* Logical LOC: 43 390

Mean parameter count: 1.2

Cyclomatic complexity: 2 543

Cyclomatic complexity

density: 17%

Maintainability index: 113

Production build: 276K

Backbone* Logical LOC: 965

Mean parameter count: 1.3

Cyclomatic complexity: 275

Cyclomatic complexity

density: 28%

Maintainability index: 108

Production build: 20K

* without dependencies

Page 10: JavaScript MV* Framework - Making the Right Choice

Wonna really be in control of

your own code?

Page 11: JavaScript MV* Framework - Making the Right Choice

You have to know then exactly

what the framework does

Page 12: JavaScript MV* Framework - Making the Right Choice

Ember.js? AngularJS?

Unlikely…

Page 13: JavaScript MV* Framework - Making the Right Choice

Backbone is our hero!

http://backbonejs.org/docs/backbone.html

Page 14: JavaScript MV* Framework - Making the Right Choice

What about dependencies?

Do we need them?

Backbone

jQuery Underscore

Page 15: JavaScript MV* Framework - Making the Right Choice

Not really!

jQuery Underscore

Backbone4Exoskeleton

Page 16: JavaScript MV* Framework - Making the Right Choice

Exoskeleton is an optimized Backbone

Faster

Lightweight

Dependencies

optional

http://exosjs.com

Custom builds

Backbone drop-in

replacement

Page 17: JavaScript MV* Framework - Making the Right Choice

What about legacy browsers?

https://github.com/es-shims/es5-shim

Page 18: JavaScript MV* Framework - Making the Right Choice

An example?

TODO MVC

http://bit.ly/T0oREh

Exoskeleton + CommonJS Compiler

http://bit.ly/1lr1R7Z

Page 19: JavaScript MV* Framework - Making the Right Choice

Thank you!

My credits to www.flaticon.com for

these amazing free vector icons and

surely to Paul Miller and Adam Krebs

for Exoskeleton