SlideShare a Scribd company logo
1 of 17
Igor
Hlina,
&
Webelement #32
@srigi
Javascript, the terrible language
Gary Bernhardt makes good job pointing on
some rediculous aspects of the language. Not
to mention it was designed in 10 days.
1995 2015
EcmaScript
3
history of Javascript
birth of
Javascript
EcmaScript
5
20102005
EcmaScript
5.1 ES6
2000
This year we celebrate 20th anniversaryof Javascript birth. Here are some
interesting & important events happened during that period. Emergence of
browsers, applications or libraries that shaped the industry.
Javascript, the terrible language
You may get idea that 90% of the language is a crap
by comparing this two books :) It is not true.
Javascript, the terrible language
Vehicle
drive
Bike
signalsRing
Or is it? How do you design this simple scenario in Javascript...
var Vehicle = function(name) { this.name = name };
Vehicle.prototype.drive = function() { console.log(this.name, 'is driving') };
Javascript, the terrible language
var Bike = function(name) { Vehicle.call(this, name) };
Bike.prototype = Object.create(Vehicle.prototype);
Bike.prototype.signalsRing = function() { console.log(this.name, 'is ringing') };
var lovalot = new Bike('Lovalot');
lovalot.drive();
lovalot.signalsRing(); // Lovalot is ringing
// Lovalot is driving
Vehicle.someStaticShit = function() { console.log('Vehicle::someStaticShit') };
Bike.someStaticShit(); Uncaught TypeError: undefined is not a function
_.defaults(Bike, Vehicle);
// Vehicle::someStaticShit
Even the simplest OOP inheritance is full of non-intuitive coding. If you introduce
static method either you manually copy static props. or get help of the library.
sample project structure
This is what we
are creating
today
<script src="bower_components/lodash/lodash.js"></script>
sample project structure
<script src="src/lib/bike.js"></script>
<script src="src/lib/vehicle.js"></script>
<script src="src/index.js"></script>
With current version of language you must ensure your sources are in right order.
Easy with 4 files, not with complex dependency graph.
<script src="bower_components/lodash/lodash.js"></script>
sample project structure
<script src="src/lib/bike.js"></script>
<script src="src/lib/vehicle.js"></script>
<script src="src/index.js"></script>
With current version of language you must ensure your sources are in right order.
Easy with 4 files, not with complex dependency graph.
<script src="bower_components/lodash/lodash.js"></script>
sample project structure
<script src="src/lib/bike.js"></script>
<script src="src/lib/vehicle.js"></script>
<script src="src/index.js"></script>
With current version of language you must ensure your sources are in right order.
Easy with 4 files, not with complex dependency graph.
<script src="bower_components/lodash/lodash.js"></script>
sample project structure
<script src="src/lib/bike.js"></script>
<script src="src/lib/vehicle.js"></script>
<script src="src/index.js"></script>
With current version of language you must ensure your sources are in right order.
Easy with 4 files, not with complex dependency graph.
1995 2015
EcmaScript
3
history of Javascript
birth of
Javascript
EcmaScript
5
20102005
EcmaScript
5.1 ES6
2000
var Vehicle = require('./vehicle');
var _ = require('lodash');
With emergence Node.js we finaly have require() call in the language.
However in Node.js that call blocks. That is unacceptable in browser.
1995 2015
EcmaScript
3
history of Javascript
birth of
Javascript
EcmaScript
5
20102005
EcmaScript
5.1 ES6
2000
// some code
define([ 'lodash', './vehicle'], function(_, Vehicle) {
}); Require.js brings asynchronous require in form of
AMD. Webpack & build tools make "blocking-like syntax"
of require available in browsers.
demo
Please see the github repo & follow the commits:
https://github.com/srigi/training-webpack
recap what we learned
• module system using commonjs
• !style!css! loader
• webpack.config.js & module.loaders
• load bower dependencies
• babel-loader, EcmaScript 6
• webpack-dev-server
Igor
Hlina,
Thank you
@srigi

More Related Content

What's hot

Andrew Mykhaliuk - Sorry, I need to make a build for frontend
Andrew Mykhaliuk - Sorry, I need to make a build for frontendAndrew Mykhaliuk - Sorry, I need to make a build for frontend
Andrew Mykhaliuk - Sorry, I need to make a build for frontend
OdessaJS Conf
 
Getting started with Catalyst and extjs
Getting started with Catalyst and extjsGetting started with Catalyst and extjs
Getting started with Catalyst and extjs
Peter Edwards
 

What's hot (20)

Strangers In The Night: Ruby, Rack y Sinatra - Herramientas potentes para con...
Strangers In The Night: Ruby, Rack y Sinatra - Herramientas potentes para con...Strangers In The Night: Ruby, Rack y Sinatra - Herramientas potentes para con...
Strangers In The Night: Ruby, Rack y Sinatra - Herramientas potentes para con...
 
Ruby and Rails by Example (GeekCamp edition)
Ruby and Rails by Example (GeekCamp edition)Ruby and Rails by Example (GeekCamp edition)
Ruby and Rails by Example (GeekCamp edition)
 
Ruby On Rails Introduction
Ruby On Rails IntroductionRuby On Rails Introduction
Ruby On Rails Introduction
 
Ruby Isn't Just About Rails
Ruby Isn't Just About RailsRuby Isn't Just About Rails
Ruby Isn't Just About Rails
 
Developing cross platform desktop application with Ruby
Developing cross platform desktop application with RubyDeveloping cross platform desktop application with Ruby
Developing cross platform desktop application with Ruby
 
Ruby, the language of devops
Ruby, the language of devopsRuby, the language of devops
Ruby, the language of devops
 
I18nize Scala programs à la gettext
I18nize Scala programs à la gettextI18nize Scala programs à la gettext
I18nize Scala programs à la gettext
 
Till Vollmer Presentation
Till Vollmer PresentationTill Vollmer Presentation
Till Vollmer Presentation
 
Workin On The Rails Road
Workin On The Rails RoadWorkin On The Rails Road
Workin On The Rails Road
 
Andrew Mykhaliuk - Sorry, I need to make a build for frontend
Andrew Mykhaliuk - Sorry, I need to make a build for frontendAndrew Mykhaliuk - Sorry, I need to make a build for frontend
Andrew Mykhaliuk - Sorry, I need to make a build for frontend
 
Ruby application based on http
Ruby application based on httpRuby application based on http
Ruby application based on http
 
Introduction to Ruby on Rails
Introduction to Ruby on RailsIntroduction to Ruby on Rails
Introduction to Ruby on Rails
 
Getting started with Catalyst and extjs
Getting started with Catalyst and extjsGetting started with Catalyst and extjs
Getting started with Catalyst and extjs
 
遇見 Ruby on Rails
遇見 Ruby on Rails遇見 Ruby on Rails
遇見 Ruby on Rails
 
Practical catalyst
Practical catalystPractical catalyst
Practical catalyst
 
SPARQLing Services
SPARQLing ServicesSPARQLing Services
SPARQLing Services
 
Conscious Coupling
Conscious CouplingConscious Coupling
Conscious Coupling
 
Killing the Angle Bracket
Killing the Angle BracketKilling the Angle Bracket
Killing the Angle Bracket
 
Functional Programming in Clojure
Functional Programming in ClojureFunctional Programming in Clojure
Functional Programming in Clojure
 
mod_php vs FastCGI vs FPM vs CLI
mod_php vs FastCGI vs FPM vs CLImod_php vs FastCGI vs FPM vs CLI
mod_php vs FastCGI vs FPM vs CLI
 

Viewers also liked

JavaScript - new features in ECMAScript 6
JavaScript - new features in ECMAScript 6JavaScript - new features in ECMAScript 6
JavaScript - new features in ECMAScript 6
Solution4Future
 

Viewers also liked (17)

Cool shits javascript can do
Cool shits javascript can doCool shits javascript can do
Cool shits javascript can do
 
JavaScript 1.5 to 2.0 (TomTom)
JavaScript 1.5 to 2.0 (TomTom)JavaScript 1.5 to 2.0 (TomTom)
JavaScript 1.5 to 2.0 (TomTom)
 
CSS Frameworks: Faster Layout, Consistent Results
CSS Frameworks: Faster Layout, Consistent ResultsCSS Frameworks: Faster Layout, Consistent Results
CSS Frameworks: Faster Layout, Consistent Results
 
Easily Manage Software on Windows with Chocolatey - PuppetConf 2016
Easily Manage Software on Windows with Chocolatey - PuppetConf 2016Easily Manage Software on Windows with Chocolatey - PuppetConf 2016
Easily Manage Software on Windows with Chocolatey - PuppetConf 2016
 
Standard Offer and Feed-in Tariff Development Lessons Learned
Standard Offer and Feed-in Tariff Development Lessons LearnedStandard Offer and Feed-in Tariff Development Lessons Learned
Standard Offer and Feed-in Tariff Development Lessons Learned
 
ECMAScript 6 from an Attacker's Perspective - Breaking Frameworks, Sandboxes,...
ECMAScript 6 from an Attacker's Perspective - Breaking Frameworks, Sandboxes,...ECMAScript 6 from an Attacker's Perspective - Breaking Frameworks, Sandboxes,...
ECMAScript 6 from an Attacker's Perspective - Breaking Frameworks, Sandboxes,...
 
JavaScript - new features in ECMAScript 6
JavaScript - new features in ECMAScript 6JavaScript - new features in ECMAScript 6
JavaScript - new features in ECMAScript 6
 
學習JavaScript_Dom
學習JavaScript_Dom學習JavaScript_Dom
學習JavaScript_Dom
 
JavaScript & Dom Manipulation
JavaScript & Dom ManipulationJavaScript & Dom Manipulation
JavaScript & Dom Manipulation
 
Comparing JVM Web Frameworks - Devoxx France 2013
Comparing JVM Web Frameworks - Devoxx France 2013Comparing JVM Web Frameworks - Devoxx France 2013
Comparing JVM Web Frameworks - Devoxx France 2013
 
Something about Golang
Something about GolangSomething about Golang
Something about Golang
 
ES2015 / ES6: Basics of modern Javascript
ES2015 / ES6: Basics of modern JavascriptES2015 / ES6: Basics of modern Javascript
ES2015 / ES6: Basics of modern Javascript
 
ECMAScript 6: A Better JavaScript for the Ambient Computing Era
ECMAScript 6: A Better JavaScript for the Ambient Computing EraECMAScript 6: A Better JavaScript for the Ambient Computing Era
ECMAScript 6: A Better JavaScript for the Ambient Computing Era
 
Front-end Development Process - 어디까지 개선할 수 있나
Front-end Development Process - 어디까지 개선할 수 있나Front-end Development Process - 어디까지 개선할 수 있나
Front-end Development Process - 어디까지 개선할 수 있나
 
Codeware
CodewareCodeware
Codeware
 
Comparing JVM Web Frameworks - Jfokus 2012
Comparing JVM Web Frameworks - Jfokus 2012Comparing JVM Web Frameworks - Jfokus 2012
Comparing JVM Web Frameworks - Jfokus 2012
 
HTML5 with Play Scala, CoffeeScript and Jade - Jfokus 2012
HTML5 with Play Scala, CoffeeScript and Jade - Jfokus 2012HTML5 with Play Scala, CoffeeScript and Jade - Jfokus 2012
HTML5 with Play Scala, CoffeeScript and Jade - Jfokus 2012
 

Similar to Webpack & EcmaScript 6 (Webelement #32)

There is something about JavaScript - Choose Forum 2014
There is something about JavaScript - Choose Forum 2014There is something about JavaScript - Choose Forum 2014
There is something about JavaScript - Choose Forum 2014
jbandi
 

Similar to Webpack & EcmaScript 6 (Webelement #32) (20)

There is something about JavaScript - Choose Forum 2014
There is something about JavaScript - Choose Forum 2014There is something about JavaScript - Choose Forum 2014
There is something about JavaScript - Choose Forum 2014
 
Consegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com RubyConsegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com Ruby
 
Multi Lingual Websites In Umbraco
Multi Lingual Websites In UmbracoMulti Lingual Websites In Umbraco
Multi Lingual Websites In Umbraco
 
DSLs in JavaScript
DSLs in JavaScriptDSLs in JavaScript
DSLs in JavaScript
 
APEX Alpe Adria 2019 - JavaScript in APEX - do it right!
APEX Alpe Adria 2019 -  JavaScript in APEX - do it right!APEX Alpe Adria 2019 -  JavaScript in APEX - do it right!
APEX Alpe Adria 2019 - JavaScript in APEX - do it right!
 
Crystal internals (part 1)
Crystal internals (part 1)Crystal internals (part 1)
Crystal internals (part 1)
 
Crystal internals (part 1)
Crystal internals (part 1)Crystal internals (part 1)
Crystal internals (part 1)
 
Crystal internals (part 1)
Crystal internals (part 1)Crystal internals (part 1)
Crystal internals (part 1)
 
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
Alberto Maria Angelo Paro - Isomorphic programming in Scala and WebDevelopmen...
 
Java script Basic
Java script BasicJava script Basic
Java script Basic
 
DiUS Computing Lca Rails Final
DiUS  Computing Lca Rails FinalDiUS  Computing Lca Rails Final
DiUS Computing Lca Rails Final
 
Sprockets
SprocketsSprockets
Sprockets
 
JavaScript Like It’s 2013
JavaScript Like It’s 2013JavaScript Like It’s 2013
JavaScript Like It’s 2013
 
JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4JavaScript 2.0 in Dreamweaver CS4
JavaScript 2.0 in Dreamweaver CS4
 
FFWD.PRO - It's not you, It's me (or how to avoid being coupled with a Javasc...
FFWD.PRO - It's not you, It's me (or how to avoid being coupled with a Javasc...FFWD.PRO - It's not you, It's me (or how to avoid being coupled with a Javasc...
FFWD.PRO - It's not you, It's me (or how to avoid being coupled with a Javasc...
 
Flash skills for silverlight design and development (30 Abr 2010)
Flash skills for silverlight design and development (30 Abr 2010)Flash skills for silverlight design and development (30 Abr 2010)
Flash skills for silverlight design and development (30 Abr 2010)
 
PharoJS for Real World Applications
PharoJS for Real World ApplicationsPharoJS for Real World Applications
PharoJS for Real World Applications
 
PharoJS for Real World Applications
PharoJS for Real World ApplicationsPharoJS for Real World Applications
PharoJS for Real World Applications
 
Fisl 11 - Dicas de Desenvolvimento Web com Ruby
Fisl 11 - Dicas de Desenvolvimento Web com RubyFisl 11 - Dicas de Desenvolvimento Web com Ruby
Fisl 11 - Dicas de Desenvolvimento Web com Ruby
 
Ruby On Rails Introduction
Ruby On Rails IntroductionRuby On Rails Introduction
Ruby On Rails Introduction
 

Recently uploaded

valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
 
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Chandigarh Call girls 9053900678 Call girls in Chandigarh
 
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
soniya singh
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
ellan12
 
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
sexy call girls service in goa
 

Recently uploaded (20)

Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Shahpur Jat Escort Service Delhi N.C.R.
 
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
 
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
 
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
 
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
 
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
 
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
 
Al Barsha Night Partner +0567686026 Call Girls Dubai
Al Barsha Night Partner +0567686026 Call Girls  DubaiAl Barsha Night Partner +0567686026 Call Girls  Dubai
Al Barsha Night Partner +0567686026 Call Girls Dubai
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
 
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
 
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
 
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptxAWS Community DAY Albertini-Ellan Cloud Security (1).pptx
AWS Community DAY Albertini-Ellan Cloud Security (1).pptx
 
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024
 
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
 
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl ServiceRussian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
 

Webpack & EcmaScript 6 (Webelement #32)

  • 2. Javascript, the terrible language Gary Bernhardt makes good job pointing on some rediculous aspects of the language. Not to mention it was designed in 10 days.
  • 3. 1995 2015 EcmaScript 3 history of Javascript birth of Javascript EcmaScript 5 20102005 EcmaScript 5.1 ES6 2000 This year we celebrate 20th anniversaryof Javascript birth. Here are some interesting & important events happened during that period. Emergence of browsers, applications or libraries that shaped the industry.
  • 4. Javascript, the terrible language You may get idea that 90% of the language is a crap by comparing this two books :) It is not true.
  • 5. Javascript, the terrible language Vehicle drive Bike signalsRing Or is it? How do you design this simple scenario in Javascript...
  • 6. var Vehicle = function(name) { this.name = name }; Vehicle.prototype.drive = function() { console.log(this.name, 'is driving') }; Javascript, the terrible language var Bike = function(name) { Vehicle.call(this, name) }; Bike.prototype = Object.create(Vehicle.prototype); Bike.prototype.signalsRing = function() { console.log(this.name, 'is ringing') }; var lovalot = new Bike('Lovalot'); lovalot.drive(); lovalot.signalsRing(); // Lovalot is ringing // Lovalot is driving Vehicle.someStaticShit = function() { console.log('Vehicle::someStaticShit') }; Bike.someStaticShit(); Uncaught TypeError: undefined is not a function _.defaults(Bike, Vehicle); // Vehicle::someStaticShit Even the simplest OOP inheritance is full of non-intuitive coding. If you introduce static method either you manually copy static props. or get help of the library.
  • 7. sample project structure This is what we are creating today
  • 8. <script src="bower_components/lodash/lodash.js"></script> sample project structure <script src="src/lib/bike.js"></script> <script src="src/lib/vehicle.js"></script> <script src="src/index.js"></script> With current version of language you must ensure your sources are in right order. Easy with 4 files, not with complex dependency graph.
  • 9. <script src="bower_components/lodash/lodash.js"></script> sample project structure <script src="src/lib/bike.js"></script> <script src="src/lib/vehicle.js"></script> <script src="src/index.js"></script> With current version of language you must ensure your sources are in right order. Easy with 4 files, not with complex dependency graph.
  • 10. <script src="bower_components/lodash/lodash.js"></script> sample project structure <script src="src/lib/bike.js"></script> <script src="src/lib/vehicle.js"></script> <script src="src/index.js"></script> With current version of language you must ensure your sources are in right order. Easy with 4 files, not with complex dependency graph.
  • 11. <script src="bower_components/lodash/lodash.js"></script> sample project structure <script src="src/lib/bike.js"></script> <script src="src/lib/vehicle.js"></script> <script src="src/index.js"></script> With current version of language you must ensure your sources are in right order. Easy with 4 files, not with complex dependency graph.
  • 12. 1995 2015 EcmaScript 3 history of Javascript birth of Javascript EcmaScript 5 20102005 EcmaScript 5.1 ES6 2000 var Vehicle = require('./vehicle'); var _ = require('lodash'); With emergence Node.js we finaly have require() call in the language. However in Node.js that call blocks. That is unacceptable in browser.
  • 13. 1995 2015 EcmaScript 3 history of Javascript birth of Javascript EcmaScript 5 20102005 EcmaScript 5.1 ES6 2000 // some code define([ 'lodash', './vehicle'], function(_, Vehicle) { }); Require.js brings asynchronous require in form of AMD. Webpack & build tools make "blocking-like syntax" of require available in browsers.
  • 14. demo Please see the github repo & follow the commits: https://github.com/srigi/training-webpack
  • 15. recap what we learned • module system using commonjs • !style!css! loader • webpack.config.js & module.loaders • load bower dependencies • babel-loader, EcmaScript 6 • webpack-dev-server
  • 16.