SlideShare a Scribd company logo
Application in 24h
 Fast prototyping of rich UI applications using
                AngularJS, RequireJS, jQuery

         by Yuriy V. Silvestrov, Mikhail Valkov




                       @ysilvestrov, @valkovnet
About us

Yuriy V. Silvestrov
10+ years record in IT, 8+ years devoted to managing
projects. At the beginning of December have left Ciklum
to run a PromoRepublic startup as CTO and
cofounder.

Twitter: @ysilvestrov

Please visit my website

http://yuriy.silvestrov.com
for more info or contact me at

yuriy@silvestrov.com.


                          @ysilvestrov, @valkovnet
About us

Mikhail Valkov
10+ years record in IT. 2+ years devoted to system
architecture. Now working for   Ciklum.


for more info contact me at

valkov.net@gmail.com.




                          @ysilvestrov, @valkovnet
   Based on our own         About lection
    experience

   Useful for startups
    and pet projects

   Not the right way, not
    the best way, but the
    fast one.

   Divide and conquer 

                             @ysilvestrov, @valkovnet
⌛ < 30

Time is counting
                   @ysilvestrov, @valkovnet
   Have tried to do a startup?

   Participated in Hakatons or similar events?

   Is JavaScript/HTML5 expert?

   Is AngularJS/RequireJS expert?



   We’ll try to adapt



How many of you
                                  @ysilvestrov, @valkovnet
   Startup mode ON
    ◦ When do we need quick prototyping?
    ◦ How to quick prototype an app?
    ◦ Our “marketplace” challenge
   JavaScript DSL
    ◦ MVC in JavaScript
    ◦ AngularJS
    ◦ RequireJS, Modules and AMD
   Design DSL
    ◦ Using bootstraps (twitter etc.)
    ◦ Responsive design
   Q&A

Content
                                   @ysilvestrov, @valkovnet
 A way to write something useful and not
  to spend years on it
 Prototyping = Minimum Viable Product
  creation
    ◦ If you’ll fail, it would be fast
    ◦ If not, you’ll have plenty of time to refactor the
      application
    ◦ …while the “prototype” is still in use




Prototyping
                                    @ysilvestrov, @valkovnet
 In PromoRepublic, we’re creating promos
  like contests, lotteries etc.
 Our backend is complex .NET application
  based on Azure services
 We’d like to open marketplace to sell the
  promo templates from independent
  developers
 So we need to simplify the process for
  them, and need simple but powerful way
  to write the rich UI templates.


Marketplace challenge
                            @ysilvestrov, @valkovnet
 An ability to quickly alter UI (or create
  totally new one) leaving the promotion
  mechanic unchanged
 One app to rule them all: from mobiles to
  tablets and desktops
 < 24 hours to make it 




Promotion template:
what we’re to use it for
                           @ysilvestrov, @valkovnet
   Choose platform
   Download seed for chosen platform
   Quick UI
   Choose vital functionality to prototype
   Find the frameworks/solutions realizing
    the functionality
   Compose all together
   …
   PROFIT


How to do it FAST
                              @ysilvestrov, @valkovnet
   Plain, vanilla Client-Side JS & HTML5

   No CoffeeScript

   No node.js




Client-side JavaScript
                              @ysilvestrov, @valkovnet
   Use 3-rd party components

   Existing online services
    ◦ Prefer ones implementing REST interface
    ◦ Or having JS SDKs

   Create new ones
    ◦ create them with REST

   Use dependency managers to integrate



Component development
                                 @ysilvestrov, @valkovnet
jQuery and plugins
                     @ysilvestrov, @valkovnet
   One of 20+ MVC JS frameworks
   Supported by Google
   Integrated
    ◦   Templates
    ◦   Directives and filters
    ◦   Module systems
    ◦   Resources
    ◦   Asynchronous programming

Visit http://angularjs.org for details



Angular JS
                                   @ysilvestrov, @valkovnet
   First of all, it is simpler:
<li ng-repeat="tab in tabs" ng-class="isActive(tab.path)">
    <a href="#/{{tab.path}}">{{tab.name}}</a>
</li>
 vs
<!-- ko foreach: navigation.pages -->
<div class="body row scroll-y" data-bind="
      visible: isCurrent,
      attr: { id: 'content' + id },
      template: { name: id, 'if': isLoaded, afterRender:
afterRender }">
</div>
<!-- /ko -->




Angular JS vs Knockout JS
                                          @ysilvestrov, @valkovnet
   Then, it is faster:

   According to jsPerf tests, bindings in
    Angular 1.6 to 3 times faster than
    Knockout ones




Angular JS vs Knockout JS
                               @ysilvestrov, @valkovnet
   AngularJS has some nice features right
    from the box that I haven’t found in
    knockout

    ◦ Directives, which could be used to create
      widgets
    ◦ Integrated end to end test framework
    ◦ Filters and formatters




Angular JS vs Knockout JS
                                  @ysilvestrov, @valkovnet
 Integration with Twitter Bootstrap
 Companion AngularUI library


   AngularJS allows to create an “HTML-
    based DSL”, which include specific tags to
    solve specific tasks




Angular JS pros
                              @ysilvestrov, @valkovnet
   Load time
    ◦ Load angular + require + jquery + all the
      plugins, then load server data, then e.g. sign in
      to facebook and loaf it’s data – takes some
      time
   Databinding takes place right away, but
    services are deferred
    ◦ If to bind a GUI visible variable to a service
      result directly, user will see {{template}} while
      data loads, so that “double buffering” is
      needed.



Angular JS cons
                                   @ysilvestrov, @valkovnet
   Dependency isolation

   Dependency management

   Modules loading & cashing

Visit http://requirejs.org/ for details




RequireJS
                              @ysilvestrov, @valkovnet
   Twitter bootstrap
    http://twitter.github.com/bootstrap/
    ◦ Made for everyone




    ◦ Packed with features




Bootstrap usage
                              @ysilvestrov, @valkovnet
   Creates a lingua franca for developers and
    designers, provides a common language
    telling how the components should
    behave and look




Bootstrap usage
                              @ysilvestrov, @valkovnet
   Jasny bootstrap(http://jasny.github.com/bootstrap/)
    ◦ Row links, Input mask, File upload
    ◦ … and much more
   Kickstrap (http://getkickstrap.com/)
    ◦ Bootstrap with blackjack and hookers
    ◦ actually, with apps and themes




Twitter bootstrap extensions
                                    @ysilvestrov, @valkovnet
https://github.com/angular/angular-seed
https://github.com/ysilvestrov/angular-seed

Angular Seed
                           @ysilvestrov, @valkovnet
   Use domReady! plugin to start Angular bootstrap at a
    time

   define(['require', 'lib/angular/angular', 'app',
    'lib/angular/angular-ui'],
   function(require, angular) {
      'use strict';
      return require(['lib/require/domReady!'],
    function(document) {
         return angular.bootstrap(document, ['TwitContest']);
      });
   });




Requiring Angular:
what’s inside
                                        @ysilvestrov, @valkovnet
 Do not use “define” for controllers – you’d
  to return too much
 Use services to manage controllers
  dependencies




Requiring Angular:
practical advices
                            @ysilvestrov, @valkovnet
   The speed of first-time loading is not
    perfect; so in production minifying and
    compressing became the must

   However, RequireJS needs NodeJS for
    minification process, which is still not the
    common part of most architectures




Requiring Angular: cons
                                @ysilvestrov, @valkovnet
 Twitter have had the same problem this
  year
 It’s rather architectural then framework
  one
 Standard approach
    1.   Load common GUI template
    2.   Make series of requests to server
    3.   Load required data (pictures etc.)
    4.   Parse the data
    5.   Present it to user



Rich JS UI approach – twitter trap
                                    @ysilvestrov, @valkovnet
   Straightforward approach fails because of:
    ◦ User doesn’t want to wait seconds while
      application is loading data
    ◦ If something goes wrong (i.e. one of the
      requests fail, or JS error) – nothing is shown
   Solution:
    ◦ Prerender some data on server side and
      present it to user right away
    ◦ Redraw data on client side when it’s available




Rich JS UI approach – twitter trap
                                   @ysilvestrov, @valkovnet
???

Questions?
                   @ysilvestrov, @valkovnet
yuriy@silvestrov.com

valkov.net@gmail.com

Thank you!
Waiting for your demos
Ad

Recommended

Fast prototyping apps using AngularJS, RequireJS and Twitter Bootstrap
Fast prototyping apps using AngularJS, RequireJS and Twitter Bootstrap
Yuriy Silvestrov
 
Muhammad azamuddin introduction-to-reactjs
Muhammad azamuddin introduction-to-reactjs
PHP Indonesia
 
Quick prototyping apps using JS - Ciklum, Vinnitsa
Quick prototyping apps using JS - Ciklum, Vinnitsa
Yuriy Silvestrov
 
Combining Angular and React Together
Combining Angular and React Together
Sebastian Pederiva
 
introduction to Vue.js 3
introduction to Vue.js 3
ArezooKmn
 
Transforming Front-End Disaster Code™ Into A Maintainable Masterpiece
Transforming Front-End Disaster Code™ Into A Maintainable Masterpiece
Dan Gribbin
 
The Modern Java Web Developer - JavaOne 2013
The Modern Java Web Developer - JavaOne 2013
Matt Raible
 
AngularJS : Superheroic JavaScript MVW Framework
AngularJS : Superheroic JavaScript MVW Framework
Edureka!
 
Vuejs getting-started - Extended Version
Vuejs getting-started - Extended Version
Murat Doğan
 
Java Web Application Security - Denver JUG 2013
Java Web Application Security - Denver JUG 2013
Matt Raible
 
Angularjs tutorial
Angularjs tutorial
HarikaReddy115
 
The Art of Angular in 2016 - vJUG24
The Art of Angular in 2016 - vJUG24
Matt Raible
 
Gettings started with the superheroic JavaScript library AngularJS
Gettings started with the superheroic JavaScript library AngularJS
Armin Vieweg
 
AngularJS + React
AngularJS + React
justvamp
 
The Art of Angular in 2016 - Devoxx France 2016
The Art of Angular in 2016 - Devoxx France 2016
Matt Raible
 
Overview about AngularJS Framework
Overview about AngularJS Framework
Camilo Lopes
 
The Art of Angular in 2016 - Devoxx UK 2016
The Art of Angular in 2016 - Devoxx UK 2016
Matt Raible
 
Automated perf optimization - jQuery Conference
Automated perf optimization - jQuery Conference
Matthew Lancaster
 
AngularJS One Day Workshop
AngularJS One Day Workshop
Shyam Seshadri
 
Learn react the right way
Learn react the right way
Mohamed Thareef Bin Ubaid
 
Web Frameworks of the Future: Flex, GWT, Grails and Rails
Web Frameworks of the Future: Flex, GWT, Grails and Rails
Matt Raible
 
jQuery Foundation Keynote
jQuery Foundation Keynote
Richard Worth
 
OCTO BOF - How to build Netvibes with AngularJS
OCTO BOF - How to build Netvibes with AngularJS
Jonathan Meiss
 
jQuery Keynote - Fall 2010
jQuery Keynote - Fall 2010
jeresig
 
Get Hip with JHipster - Denver JUG 2015
Get Hip with JHipster - Denver JUG 2015
Matt Raible
 
jQuery Mobile Overview - Boston
jQuery Mobile Overview - Boston
Todd Parker
 
JHipster for Spring Boot webinar
JHipster for Spring Boot webinar
Julien Dubois
 
What's new in Angular 2?
What's new in Angular 2?
Alfred Jett Grandeza
 
AngularJS with RequireJS
AngularJS with RequireJS
Johannes Weber
 
Descubre Villaviciosa De OdóN
Descubre Villaviciosa De OdóN
50045882
 

More Related Content

What's hot (20)

Vuejs getting-started - Extended Version
Vuejs getting-started - Extended Version
Murat Doğan
 
Java Web Application Security - Denver JUG 2013
Java Web Application Security - Denver JUG 2013
Matt Raible
 
Angularjs tutorial
Angularjs tutorial
HarikaReddy115
 
The Art of Angular in 2016 - vJUG24
The Art of Angular in 2016 - vJUG24
Matt Raible
 
Gettings started with the superheroic JavaScript library AngularJS
Gettings started with the superheroic JavaScript library AngularJS
Armin Vieweg
 
AngularJS + React
AngularJS + React
justvamp
 
The Art of Angular in 2016 - Devoxx France 2016
The Art of Angular in 2016 - Devoxx France 2016
Matt Raible
 
Overview about AngularJS Framework
Overview about AngularJS Framework
Camilo Lopes
 
The Art of Angular in 2016 - Devoxx UK 2016
The Art of Angular in 2016 - Devoxx UK 2016
Matt Raible
 
Automated perf optimization - jQuery Conference
Automated perf optimization - jQuery Conference
Matthew Lancaster
 
AngularJS One Day Workshop
AngularJS One Day Workshop
Shyam Seshadri
 
Learn react the right way
Learn react the right way
Mohamed Thareef Bin Ubaid
 
Web Frameworks of the Future: Flex, GWT, Grails and Rails
Web Frameworks of the Future: Flex, GWT, Grails and Rails
Matt Raible
 
jQuery Foundation Keynote
jQuery Foundation Keynote
Richard Worth
 
OCTO BOF - How to build Netvibes with AngularJS
OCTO BOF - How to build Netvibes with AngularJS
Jonathan Meiss
 
jQuery Keynote - Fall 2010
jQuery Keynote - Fall 2010
jeresig
 
Get Hip with JHipster - Denver JUG 2015
Get Hip with JHipster - Denver JUG 2015
Matt Raible
 
jQuery Mobile Overview - Boston
jQuery Mobile Overview - Boston
Todd Parker
 
JHipster for Spring Boot webinar
JHipster for Spring Boot webinar
Julien Dubois
 
What's new in Angular 2?
What's new in Angular 2?
Alfred Jett Grandeza
 
Vuejs getting-started - Extended Version
Vuejs getting-started - Extended Version
Murat Doğan
 
Java Web Application Security - Denver JUG 2013
Java Web Application Security - Denver JUG 2013
Matt Raible
 
The Art of Angular in 2016 - vJUG24
The Art of Angular in 2016 - vJUG24
Matt Raible
 
Gettings started with the superheroic JavaScript library AngularJS
Gettings started with the superheroic JavaScript library AngularJS
Armin Vieweg
 
AngularJS + React
AngularJS + React
justvamp
 
The Art of Angular in 2016 - Devoxx France 2016
The Art of Angular in 2016 - Devoxx France 2016
Matt Raible
 
Overview about AngularJS Framework
Overview about AngularJS Framework
Camilo Lopes
 
The Art of Angular in 2016 - Devoxx UK 2016
The Art of Angular in 2016 - Devoxx UK 2016
Matt Raible
 
Automated perf optimization - jQuery Conference
Automated perf optimization - jQuery Conference
Matthew Lancaster
 
AngularJS One Day Workshop
AngularJS One Day Workshop
Shyam Seshadri
 
Web Frameworks of the Future: Flex, GWT, Grails and Rails
Web Frameworks of the Future: Flex, GWT, Grails and Rails
Matt Raible
 
jQuery Foundation Keynote
jQuery Foundation Keynote
Richard Worth
 
OCTO BOF - How to build Netvibes with AngularJS
OCTO BOF - How to build Netvibes with AngularJS
Jonathan Meiss
 
jQuery Keynote - Fall 2010
jQuery Keynote - Fall 2010
jeresig
 
Get Hip with JHipster - Denver JUG 2015
Get Hip with JHipster - Denver JUG 2015
Matt Raible
 
jQuery Mobile Overview - Boston
jQuery Mobile Overview - Boston
Todd Parker
 
JHipster for Spring Boot webinar
JHipster for Spring Boot webinar
Julien Dubois
 

Viewers also liked (20)

AngularJS with RequireJS
AngularJS with RequireJS
Johannes Weber
 
Descubre Villaviciosa De OdóN
Descubre Villaviciosa De OdóN
50045882
 
AHC Network Monitoring Plan
AHC Network Monitoring Plan
dkmorgan51
 
euroFOT, Aachener Kolloquium, Ford
euroFOT, Aachener Kolloquium, Ford
euroFOT
 
Grammar Focus
Grammar Focus
Analys Milano
 
初めてのプラグイン開発
初めてのプラグイン開発
ikikko
 
Full Day Kindergarten
Full Day Kindergarten
guest8c7eb4
 
Stewart Townsend - #smib10 Presentation
Stewart Townsend - #smib10 Presentation
smibevents
 
ProMAMA Center
ProMAMA Center
soranam
 
No access to technology - by Michelle
No access to technology - by Michelle
Amalia Giebitz
 
How to register a project
How to register a project
ivanabrabcova
 
Slidecast Sander Gansbeke
Slidecast Sander Gansbeke
sanderg1989
 
Matrix Safety Catolgue 1
Matrix Safety Catolgue 1
kausarh
 
Smoking Hypnosis - Say No To The Cancer Sticks
Smoking Hypnosis - Say No To The Cancer Sticks
Biotherapy-clinic Usa
 
Kutadgu profile nov2012
Kutadgu profile nov2012
Ahter Kutadgu
 
мобильный смарт фитнес
мобильный смарт фитнес
Интернет магазин Staleks.SU
 
Digital & Concept Artist: come diventare autori di successo (free webinar)
Digital & Concept Artist: come diventare autori di successo (free webinar)
Artlandis' Webinar & Workshop
 
Why Simple Works
Why Simple Works
Kayak Online Marketing
 
AngularJS with RequireJS
AngularJS with RequireJS
Johannes Weber
 
Descubre Villaviciosa De OdóN
Descubre Villaviciosa De OdóN
50045882
 
AHC Network Monitoring Plan
AHC Network Monitoring Plan
dkmorgan51
 
euroFOT, Aachener Kolloquium, Ford
euroFOT, Aachener Kolloquium, Ford
euroFOT
 
初めてのプラグイン開発
初めてのプラグイン開発
ikikko
 
Full Day Kindergarten
Full Day Kindergarten
guest8c7eb4
 
Stewart Townsend - #smib10 Presentation
Stewart Townsend - #smib10 Presentation
smibevents
 
ProMAMA Center
ProMAMA Center
soranam
 
No access to technology - by Michelle
No access to technology - by Michelle
Amalia Giebitz
 
How to register a project
How to register a project
ivanabrabcova
 
Slidecast Sander Gansbeke
Slidecast Sander Gansbeke
sanderg1989
 
Matrix Safety Catolgue 1
Matrix Safety Catolgue 1
kausarh
 
Smoking Hypnosis - Say No To The Cancer Sticks
Smoking Hypnosis - Say No To The Cancer Sticks
Biotherapy-clinic Usa
 
Kutadgu profile nov2012
Kutadgu profile nov2012
Ahter Kutadgu
 
Digital & Concept Artist: come diventare autori di successo (free webinar)
Digital & Concept Artist: come diventare autori di successo (free webinar)
Artlandis' Webinar & Workshop
 
Ad

Similar to JS FAST Prototyping with AngularJS & RequireJS (20)

Prototyping app using JS and HTML5 (Ciklum Kharkiv)
Prototyping app using JS and HTML5 (Ciklum Kharkiv)
Yuriy Silvestrov
 
The State of Front-end At CrowdTwist
The State of Front-end At CrowdTwist
Mark Fayngersh
 
Angular JS, A dive to concepts
Angular JS, A dive to concepts
Abhishek Sur
 
Yeoman AngularJS and D3 - A solid stack for web apps
Yeoman AngularJS and D3 - A solid stack for web apps
climboid
 
Integrating AngularJS into the Campus CMS
Integrating AngularJS into the Campus CMS
Tom Borger
 
AngularJS : Superheroic Javascript MVW Framework
AngularJS : Superheroic Javascript MVW Framework
Edureka!
 
Front End Development for Back End Java Developers - NYJavaSIG 2019
Front End Development for Back End Java Developers - NYJavaSIG 2019
Matt Raible
 
JavaScript for ASP.NET programmers (webcast) upload
JavaScript for ASP.NET programmers (webcast) upload
Russ Fustino
 
Angular JS - Introduction
Angular JS - Introduction
Sagar Acharya
 
Valentine with Angular js - Introduction
Valentine with Angular js - Introduction
Senthil Kumar
 
Webinar on Angular JS titled 'Develop Responsive Single Page Application'
Webinar on Angular JS titled 'Develop Responsive Single Page Application'
Edureka!
 
Angular JS - Develop Responsive Single Page Application
Angular JS - Develop Responsive Single Page Application
Edureka!
 
SnapyX
SnapyX
ekino
 
SnapyX - ParisJS
SnapyX - ParisJS
florianharmel
 
Moving to the Client - JavaFX and HTML5 (PowerPoint Version)
Moving to the Client - JavaFX and HTML5 (PowerPoint Version)
Stephen Chin
 
Bdd with Cucumber and Mocha
Bdd with Cucumber and Mocha
Atish Narlawar
 
Overview of the AngularJS framework
Overview of the AngularJS framework
Yakov Fain
 
Angular js workshop
Angular js workshop
Rolands Krumbergs
 
ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...
ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...
Gavin Pickin
 
Welcome to Wijmo 5
Welcome to Wijmo 5
Chris Bannon
 
Prototyping app using JS and HTML5 (Ciklum Kharkiv)
Prototyping app using JS and HTML5 (Ciklum Kharkiv)
Yuriy Silvestrov
 
The State of Front-end At CrowdTwist
The State of Front-end At CrowdTwist
Mark Fayngersh
 
Angular JS, A dive to concepts
Angular JS, A dive to concepts
Abhishek Sur
 
Yeoman AngularJS and D3 - A solid stack for web apps
Yeoman AngularJS and D3 - A solid stack for web apps
climboid
 
Integrating AngularJS into the Campus CMS
Integrating AngularJS into the Campus CMS
Tom Borger
 
AngularJS : Superheroic Javascript MVW Framework
AngularJS : Superheroic Javascript MVW Framework
Edureka!
 
Front End Development for Back End Java Developers - NYJavaSIG 2019
Front End Development for Back End Java Developers - NYJavaSIG 2019
Matt Raible
 
JavaScript for ASP.NET programmers (webcast) upload
JavaScript for ASP.NET programmers (webcast) upload
Russ Fustino
 
Angular JS - Introduction
Angular JS - Introduction
Sagar Acharya
 
Valentine with Angular js - Introduction
Valentine with Angular js - Introduction
Senthil Kumar
 
Webinar on Angular JS titled 'Develop Responsive Single Page Application'
Webinar on Angular JS titled 'Develop Responsive Single Page Application'
Edureka!
 
Angular JS - Develop Responsive Single Page Application
Angular JS - Develop Responsive Single Page Application
Edureka!
 
SnapyX
SnapyX
ekino
 
Moving to the Client - JavaFX and HTML5 (PowerPoint Version)
Moving to the Client - JavaFX and HTML5 (PowerPoint Version)
Stephen Chin
 
Bdd with Cucumber and Mocha
Bdd with Cucumber and Mocha
Atish Narlawar
 
Overview of the AngularJS framework
Overview of the AngularJS framework
Yakov Fain
 
ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...
ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...
Gavin Pickin
 
Welcome to Wijmo 5
Welcome to Wijmo 5
Chris Bannon
 
Ad

More from Yuriy Silvestrov (8)

How to run asp.net on virtual server for $5 per mo
How to run asp.net on virtual server for $5 per mo
Yuriy Silvestrov
 
Startups intro to agile (по-русски)
Startups intro to agile (по-русски)
Yuriy Silvestrov
 
Developing the startup (in Russian)
Developing the startup (in Russian)
Yuriy Silvestrov
 
Startup agile (Ciklum Agile Saturday - Dnipropetrovsk) - in russian
Startup agile (Ciklum Agile Saturday - Dnipropetrovsk) - in russian
Yuriy Silvestrov
 
Developing the ideas
Developing the ideas
Yuriy Silvestrov
 
Agile antipatterns - AgileBC
Agile antipatterns - AgileBC
Yuriy Silvestrov
 
Agile antipatterns (Odessa, Vinnitsa)
Agile antipatterns (Odessa, Vinnitsa)
Yuriy Silvestrov
 
Catch agile
Catch agile
Yuriy Silvestrov
 
How to run asp.net on virtual server for $5 per mo
How to run asp.net on virtual server for $5 per mo
Yuriy Silvestrov
 
Startups intro to agile (по-русски)
Startups intro to agile (по-русски)
Yuriy Silvestrov
 
Developing the startup (in Russian)
Developing the startup (in Russian)
Yuriy Silvestrov
 
Startup agile (Ciklum Agile Saturday - Dnipropetrovsk) - in russian
Startup agile (Ciklum Agile Saturday - Dnipropetrovsk) - in russian
Yuriy Silvestrov
 
Agile antipatterns - AgileBC
Agile antipatterns - AgileBC
Yuriy Silvestrov
 
Agile antipatterns (Odessa, Vinnitsa)
Agile antipatterns (Odessa, Vinnitsa)
Yuriy Silvestrov
 

JS FAST Prototyping with AngularJS & RequireJS

  • 1. Application in 24h Fast prototyping of rich UI applications using AngularJS, RequireJS, jQuery by Yuriy V. Silvestrov, Mikhail Valkov @ysilvestrov, @valkovnet
  • 2. About us Yuriy V. Silvestrov 10+ years record in IT, 8+ years devoted to managing projects. At the beginning of December have left Ciklum to run a PromoRepublic startup as CTO and cofounder. Twitter: @ysilvestrov Please visit my website http://yuriy.silvestrov.com for more info or contact me at [email protected]. @ysilvestrov, @valkovnet
  • 3. About us Mikhail Valkov 10+ years record in IT. 2+ years devoted to system architecture. Now working for Ciklum. for more info contact me at [email protected]. @ysilvestrov, @valkovnet
  • 4. Based on our own About lection experience  Useful for startups and pet projects  Not the right way, not the best way, but the fast one.  Divide and conquer  @ysilvestrov, @valkovnet
  • 5. ⌛ < 30 Time is counting @ysilvestrov, @valkovnet
  • 6. Have tried to do a startup?  Participated in Hakatons or similar events?  Is JavaScript/HTML5 expert?  Is AngularJS/RequireJS expert?  We’ll try to adapt How many of you @ysilvestrov, @valkovnet
  • 7. Startup mode ON ◦ When do we need quick prototyping? ◦ How to quick prototype an app? ◦ Our “marketplace” challenge  JavaScript DSL ◦ MVC in JavaScript ◦ AngularJS ◦ RequireJS, Modules and AMD  Design DSL ◦ Using bootstraps (twitter etc.) ◦ Responsive design  Q&A Content @ysilvestrov, @valkovnet
  • 8.  A way to write something useful and not to spend years on it  Prototyping = Minimum Viable Product creation ◦ If you’ll fail, it would be fast ◦ If not, you’ll have plenty of time to refactor the application ◦ …while the “prototype” is still in use Prototyping @ysilvestrov, @valkovnet
  • 9.  In PromoRepublic, we’re creating promos like contests, lotteries etc.  Our backend is complex .NET application based on Azure services  We’d like to open marketplace to sell the promo templates from independent developers  So we need to simplify the process for them, and need simple but powerful way to write the rich UI templates. Marketplace challenge @ysilvestrov, @valkovnet
  • 10.  An ability to quickly alter UI (or create totally new one) leaving the promotion mechanic unchanged  One app to rule them all: from mobiles to tablets and desktops  < 24 hours to make it  Promotion template: what we’re to use it for @ysilvestrov, @valkovnet
  • 11. Choose platform  Download seed for chosen platform  Quick UI  Choose vital functionality to prototype  Find the frameworks/solutions realizing the functionality  Compose all together  …  PROFIT How to do it FAST @ysilvestrov, @valkovnet
  • 12. Plain, vanilla Client-Side JS & HTML5  No CoffeeScript  No node.js Client-side JavaScript @ysilvestrov, @valkovnet
  • 13. Use 3-rd party components  Existing online services ◦ Prefer ones implementing REST interface ◦ Or having JS SDKs  Create new ones ◦ create them with REST  Use dependency managers to integrate Component development @ysilvestrov, @valkovnet
  • 14. jQuery and plugins @ysilvestrov, @valkovnet
  • 15. One of 20+ MVC JS frameworks  Supported by Google  Integrated ◦ Templates ◦ Directives and filters ◦ Module systems ◦ Resources ◦ Asynchronous programming Visit http://angularjs.org for details Angular JS @ysilvestrov, @valkovnet
  • 16. First of all, it is simpler: <li ng-repeat="tab in tabs" ng-class="isActive(tab.path)"> <a href="#/{{tab.path}}">{{tab.name}}</a> </li>  vs <!-- ko foreach: navigation.pages --> <div class="body row scroll-y" data-bind=" visible: isCurrent, attr: { id: 'content' + id }, template: { name: id, 'if': isLoaded, afterRender: afterRender }"> </div> <!-- /ko --> Angular JS vs Knockout JS @ysilvestrov, @valkovnet
  • 17. Then, it is faster:  According to jsPerf tests, bindings in Angular 1.6 to 3 times faster than Knockout ones Angular JS vs Knockout JS @ysilvestrov, @valkovnet
  • 18. AngularJS has some nice features right from the box that I haven’t found in knockout ◦ Directives, which could be used to create widgets ◦ Integrated end to end test framework ◦ Filters and formatters Angular JS vs Knockout JS @ysilvestrov, @valkovnet
  • 19.  Integration with Twitter Bootstrap  Companion AngularUI library  AngularJS allows to create an “HTML- based DSL”, which include specific tags to solve specific tasks Angular JS pros @ysilvestrov, @valkovnet
  • 20. Load time ◦ Load angular + require + jquery + all the plugins, then load server data, then e.g. sign in to facebook and loaf it’s data – takes some time  Databinding takes place right away, but services are deferred ◦ If to bind a GUI visible variable to a service result directly, user will see {{template}} while data loads, so that “double buffering” is needed. Angular JS cons @ysilvestrov, @valkovnet
  • 21. Dependency isolation  Dependency management  Modules loading & cashing Visit http://requirejs.org/ for details RequireJS @ysilvestrov, @valkovnet
  • 22. Twitter bootstrap http://twitter.github.com/bootstrap/ ◦ Made for everyone ◦ Packed with features Bootstrap usage @ysilvestrov, @valkovnet
  • 23. Creates a lingua franca for developers and designers, provides a common language telling how the components should behave and look Bootstrap usage @ysilvestrov, @valkovnet
  • 24. Jasny bootstrap(http://jasny.github.com/bootstrap/) ◦ Row links, Input mask, File upload ◦ … and much more  Kickstrap (http://getkickstrap.com/) ◦ Bootstrap with blackjack and hookers ◦ actually, with apps and themes Twitter bootstrap extensions @ysilvestrov, @valkovnet
  • 26. Use domReady! plugin to start Angular bootstrap at a time  define(['require', 'lib/angular/angular', 'app', 'lib/angular/angular-ui'],  function(require, angular) {  'use strict';  return require(['lib/require/domReady!'], function(document) {  return angular.bootstrap(document, ['TwitContest']);  });  }); Requiring Angular: what’s inside @ysilvestrov, @valkovnet
  • 27.  Do not use “define” for controllers – you’d to return too much  Use services to manage controllers dependencies Requiring Angular: practical advices @ysilvestrov, @valkovnet
  • 28. The speed of first-time loading is not perfect; so in production minifying and compressing became the must  However, RequireJS needs NodeJS for minification process, which is still not the common part of most architectures Requiring Angular: cons @ysilvestrov, @valkovnet
  • 29.  Twitter have had the same problem this year  It’s rather architectural then framework one  Standard approach 1. Load common GUI template 2. Make series of requests to server 3. Load required data (pictures etc.) 4. Parse the data 5. Present it to user Rich JS UI approach – twitter trap @ysilvestrov, @valkovnet
  • 30. Straightforward approach fails because of: ◦ User doesn’t want to wait seconds while application is loading data ◦ If something goes wrong (i.e. one of the requests fail, or JS error) – nothing is shown  Solution: ◦ Prerender some data on server side and present it to user right away ◦ Redraw data on client side when it’s available Rich JS UI approach – twitter trap @ysilvestrov, @valkovnet
  • 31. ??? Questions? @ysilvestrov, @valkovnet