Slide 1

Slide 1 text

MODERN WEB APPLICATION DEVELOPMENT WORKFLOW

Slide 2

Slide 2 text

FIRST, LET’S LOOK AT THE PAST

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

THROW A BUNCH OF HTML FILES

Slide 5

Slide 5 text

THROW A BUNCH OF HTML FILES ADD A COUPLE OF CSS FILES

Slide 6

Slide 6 text

THROW A BUNCH OF HTML FILES ADD A COUPLE OF CSS FILES PUT SOME JAVASCRIPT IN ALL THIS

Slide 7

Slide 7 text

THROW A BUNCH OF HTML FILES ADD A COUPLE OF CSS FILES PUT SOME JAVASCRIPT IN ALL THIS AND CALL IT A DAY...

Slide 8

Slide 8 text

COME BACK 6 MONTHS LATER AND TRY TO REMEMBER HOW TO MAINTAIN YOUR CODE

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

Node.js ≠ Server-side JavaScript

Slide 13

Slide 13 text

Node.js stand alone JavaScript runtime

Slide 14

Slide 14 text

Node.js stand alone JavaScript runtime using v8, Chrome’s JavaScript engine

Slide 15

Slide 15 text

Node.js stand alone JavaScript applications

Slide 16

Slide 16 text

Node.js stand alone JavaScript applications created by JavaScript developers

Slide 17

Slide 17 text

Node.js stand alone JavaScript applications created by JavaScript developers for JavaScript developers

Slide 18

Slide 18 text

BRAND NEW WORLD

Slide 19

Slide 19 text

JAVASCRIPT DEVELOPMENT TOOLS

Slide 20

Slide 20 text

JAVASCRIPT DEVELOPMENT WORKFLOW

Slide 21

Slide 21 text

A GOOD DEVELOPMENT WORKFLOW -HELPS YOU GET STARTED

Slide 22

Slide 22 text

A GOOD DEVELOPMENT WORKFLOW -HELPS YOU GET STARTED -MAINTAINS YOUR DEPENDENCIES

Slide 23

Slide 23 text

A GOOD DEVELOPMENT WORKFLOW -HELPS YOU GET STARTED -MAINTAINS YOUR DEPENDENCIES -ENFORCES BEST PRACTICES

Slide 24

Slide 24 text

A GOOD DEVELOPMENT WORKFLOW -HELPS YOU GET STARTED -MAINTAINS YOUR DEPENDENCIES -ENFORCES BEST PRACTICES -PREPARES YOUR TOOLS

Slide 25

Slide 25 text

A GOOD DEVELOPMENT WORKFLOW -HELPS YOU GET STARTED -MAINTAINS YOUR DEPENDENCIES -ENFORCES BEST PRACTICES -PREPARES YOUR TOOLS -FIGHTS REGRESSIONS

Slide 26

Slide 26 text

A GOOD DEVELOPMENT WORKFLOW -HELPS YOU GET STARTED -MAINTAINS YOUR DEPENDENCIES -ENFORCES BEST PRACTICES -PREPARES YOUR TOOLS -FIGHTS REGRESSIONS -EASES THE RELEASE PROCESS

Slide 27

Slide 27 text

HOW TO GET STARTED?

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

YEOMAN Born in 2012 Various contributors (Employees from Google, Twitter, etc)

Slide 30

Slide 30 text

YEOMAN scaffolding - structure - compilation - static analysis - dependencies management - development tools - unit testing

Slide 31

Slide 31 text

YEOMAN download > npm install -g yo “-g” global install

Slide 32

Slide 32 text

YEOMAN Various generators: ○ Angular ○ Ember ○ Backbone And all the other popular frameworks...

Slide 33

Slide 33 text

YEOMAN angular.js generator > npm install -g generator-angular

Slide 34

Slide 34 text

YEOMAN create an Angular project > yo angular

Slide 35

Slide 35 text

Select some dependencies

Slide 36

Slide 36 text

Choose some options

Slide 37

Slide 37 text

It creates the project

Slide 38

Slide 38 text

It downloads half of the internet

Slide 39

Slide 39 text

It uses some dark magic

Slide 40

Slide 40 text

Enjoy the view, Yeoman takes care of everything…

Slide 41

Slide 41 text

What does the result look like?

Slide 42

Slide 42 text

STRUCTURE

Slide 43

Slide 43 text

CONTENT

Slide 44

Slide 44 text

DEPENDENCIES

Slide 45

Slide 45 text

DEV TOOLS

Slide 46

Slide 46 text

IT’S MAGIC! and it will be your job to maintain it...

Slide 47

Slide 47 text

HAPPY?

Slide 48

Slide 48 text

BUT HOW DOES IT WORK?

Slide 49

Slide 49 text

YEOMAN HAS FRIENDS

Slide 50

Slide 50 text

BOWER

Slide 51

Slide 51 text

No content

Slide 52

Slide 52 text

GRUNT

Slide 53

Slide 53 text

No content

Slide 54

Slide 54 text

GULP

Slide 55

Slide 55 text

No content

Slide 56

Slide 56 text

AND OTHERS

Slide 57

Slide 57 text

DEPENDENCIES MANAGEMENT

Slide 58

Slide 58 text

BOWER

Slide 59

Slide 59 text

No content

Slide 60

Slide 60 text

BOWER Package manager for the web Born in 2012 Created by Twitter and other contributors over time

Slide 61

Slide 61 text

BOWER Download > npm install -g bower

Slide 62

Slide 62 text

Find a package: bower search

Slide 63

Slide 63 text

Find more information: bower info

Slide 64

Slide 64 text

BOWER Add a specific dependency > bower install jquery#1.10.2 --save install jquery and save this new dependency

Slide 65

Slide 65 text

BOWER runtime dependencies in bower.json

Slide 66

Slide 66 text

DEPENDENCIES

Slide 67

Slide 67 text

BOWER Add all your dependencies > bower install

Slide 68

Slide 68 text

See your dependencies: bower list

Slide 69

Slide 69 text

BOWER Package management always comes with its set of problems:

Slide 70

Slide 70 text

BOWER Package management always comes with its set of problems: - how can I create a new package?

Slide 71

Slide 71 text

BOWER Package management always comes with its set of problems: - how can I create a new package? - how can I host a bower repository?

Slide 72

Slide 72 text

Create a bower package: bower init

Slide 73

Slide 73 text

BOWER Use bower with Git > bower install https://myrepository.git

Slide 74

Slide 74 text

BOWER Host multiple versions > git tag -a 1.4 -m 'version 1.4' > bower install https://myrepository.git#1.4

Slide 75

Slide 75 text

BOWER Download > bower install jquery > bower install git://github.com/jquery/jquery.git

Slide 76

Slide 76 text

BOWER Registry https://github.com/bower/registry A simple web server listing Git repository URLs

Slide 77

Slide 77 text

BOWER Register > bower register myrepository https://…git > bower install myrepository

Slide 78

Slide 78 text

BUILD

Slide 79

Slide 79 text

No content

Slide 80

Slide 80 text

GRUNT GULP

Slide 81

Slide 81 text

CONFIGURATION GULP CODE GRUNT

Slide 82

Slide 82 text

EQUALLY POWERFUL

Slide 83

Slide 83 text

GRUNT is a bit older so its ECOSYSTEM is more mature

Slide 84

Slide 84 text

Grunt and Gulp development tools dependencies in package.json >npm install

Slide 85

Slide 85 text

DEV TOOLS

Slide 86

Slide 86 text

GRUNT

Slide 87

Slide 87 text

No content

Slide 88

Slide 88 text

GRUNT configuration over code grunt.initConfig({ lint: { src: 'src/<%= pkg.name %>.js' }, concat: { src: [ '' , '.js>' ], dest: '<%= pkg.name %>.js' } });

Slide 89

Slide 89 text

GRUNT Configuration in Gruntfile.js

Slide 90

Slide 90 text

GRUNT Global install before Grunt 0.4 Updating Grunt cannot break existing projects anymore

Slide 91

Slide 91 text

GRUNT gruntfile.js structure 3 parts: -Task loading -Task configuration -Task registration

Slide 92

Slide 92 text

GRUNT An example: Static code analysis with JSHINT

Slide 93

Slide 93 text

GRUNT

Slide 94

Slide 94 text

HOW DO YOU USE IT? >grunt >grunt jshint:all

Slide 95

Slide 95 text

GULP

Slide 96

Slide 96 text

No content

Slide 97

Slide 97 text

GULP code over configuration gulp.src('src/main.mycss' ) .pipe(stylus()) .pipe(rename({ ext: 'css' })) .pipe(autoprefixer()) .pipe(cssmin()) .pipe(header( '/* All Right Reserved */' )) .pipe(gulp.dest( 'dist'))

Slide 98

Slide 98 text

GULP Configuration in Gulpfile.js

Slide 99

Slide 99 text

GULP gulpfile.js structure 3 parts: - task loading - task configuration - task registration

Slide 100

Slide 100 text

GULP

Slide 101

Slide 101 text

GULP differences with Grunt node.js streams (asynchronous by nature) nice and simple api less IO operations

Slide 102

Slide 102 text

BUILD TASKS

Slide 103

Slide 103 text

STATIC ANALYSIS grunt-contrib-jshint gulp-jshint Detect coding errors in your JavaScript files

Slide 104

Slide 104 text

STATIC ANALYSIS Various style of reports (checkstyle, html, etc) Configuration in .jshtinrc

Slide 105

Slide 105 text

MINIFICATION grunt-contrib-uglify gulp-uglify Reduce the size of JavaScript files

Slide 106

Slide 106 text

CSS TRIMMING grunt-uncss gulp-uncss-task Remove unused CSS rules

Slide 107

Slide 107 text

TESTING Frameworks: Jasmine & QUnit Runner: Karma Code Coverage: Istanbul

Slide 108

Slide 108 text

LIVE RELOAD grunt-contrib-watch gulp-livereload Reload automatically the web application if some files have been changed

Slide 109

Slide 109 text

init concat jshint min unit server endtoend watch WORKFLOW

Slide 110

Slide 110 text

No content

Slide 111

Slide 111 text

Orion Eclipse project Introduced in 2011 in the Eclipse Foundation

Slide 112

Slide 112 text

Orion Two versions: Jetty or Node.js

Slide 113

Slide 113 text

Orion npm install orion node node_modules/orion/server.js /projectpath

Slide 114

Slide 114 text

No content

Slide 115

Slide 115 text

PROJECTS MANAGEMENT

Slide 116

Slide 116 text

No content

Slide 117

Slide 117 text

EDITOR

Slide 118

Slide 118 text

No content

Slide 119

Slide 119 text

No content

Slide 120

Slide 120 text

FIRST CLASS GIT SUPPORT

Slide 121

Slide 121 text

No content

Slide 122

Slide 122 text

No content

Slide 123

Slide 123 text

No content

Slide 124

Slide 124 text

No content

Slide 125

Slide 125 text

SEARCH

Slide 126

Slide 126 text

No content

Slide 127

Slide 127 text

PLUGINS

Slide 128

Slide 128 text

No content

Slide 129

Slide 129 text

No content

Slide 130

Slide 130 text

No content

Slide 131

Slide 131 text

No content

Slide 132

Slide 132 text

READY TO DEPLOY

Slide 133

Slide 133 text

No content

Slide 134

Slide 134 text

No content

Slide 135

Slide 135 text

DOCKER SUPPORT SOON

Slide 136

Slide 136 text

WHAT ABOUT ECLIPSE?

Slide 137

Slide 137 text

Back-end Lot of tooling for Java development Jetty, EclipseLink, Webtools, etc

Slide 138

Slide 138 text

Front-end ...

Slide 139

Slide 139 text

WHAT ABOUT OTHERS?

Slide 140

Slide 140 text

No content

Slide 141

Slide 141 text

No content

Slide 142

Slide 142 text

No content

Slide 143

Slide 143 text

Back-end Lot of tooling for Java development Jetty, EclipseLink, Webtools, etc

Slide 144

Slide 144 text

No content

Slide 145

Slide 145 text

No content

Slide 146

Slide 146 text

TO SUM UP

Slide 147

Slide 147 text

THANKS! Stéphane Bégaudeau Twitter: @sbegaudeau Google+: +stephane.begaudeau The research leading to these results has received funding from the European Union’s Seventh Framework Program (FP7/2007-2013) for CRYSTAL – Critical System Engineering Acceleration Joint Undertaking under grant agreement № 332830 and from specific national programs and/or funding authorities.