future of javascript
DESCRIPTION
Future of JavaScriptTRANSCRIPT
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
Eyal VardiCEO E4D Solutions LTD
Microsoft MVP Visual C#site: www.e4d.co.il
“Everything that can be written in JavaScript
will eventually be written in JavaScript .”
(’ Atwood s law)
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
About Me
ConsultingMentoringProjects
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
JavaScript History
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
In The Beginning... In 1995 Netscape hired a young lad by
the name of Brenden Eich to take charge of designing a new language.
Eich decided to create a loosly-typed scripting language that will appeal to web developers.
By December of 1995 'LiveScript' is born! (and quickly renamed 'JavaScript')
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
Standardization With the mess created by IE3's JScript
Netscape, Sun and ECMA decide to standardize JavaScript and create 'ECMAScript‘.
In the meantime, Netscape and Microsoft releases the '4.0' browser generation, each with its own implementation of the DOM.
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
ECMAScript Versions
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
The Challenge
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
HTML 5 )Changes The Rules of The
Game(
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
Single Page Web Apps (SPA)
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
Traditional apps
Browser Request
Index.html
MVC4
Traditional Request / Response for ALL rendered content and assets
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
Web Application (SPA)
Initial Request
Application.htm
MVC4
RequireJS Loader
Page1 Partial.htm
IndexViewModel.js
Application.js (bootstrap)
ViewModel (#index)
ViewModel (#login)
Model (LoginModel)JSON Requests
HTML5 localstorage
Handling disconnection
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
Web App Building Block
Comm
unication
DAL
UI
BL (MV*)
Offline Storage
Entities
Module Module Module
Server
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
The Challenge with Web Apps (SPA) DOM Manipulation Routing Templates & Data Binding Ajax Modules History Caching Validations Testing
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
Web API Growth
Source: www.programmableweb.com – current APIs: 4,535
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
WCF vs. ASP.NET Web API
SOAP WSDL HTTP
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
POST SimpleService.asmx/EchoString HTTP/1.1 Host: localhost:1489 User-Agent: Mozilla/5.0 Accept: text/html Content-Type: application/json; Content-Length: 27 ...
XML, JSON, SOAP, AtomPub ...
HTTP Communication
Headers
Data
Verb URL
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
POST SimpleService.asmx/EchoString HTTP/1.1 Host: localhost:1489 User-Agent: Mozilla/5.0 Accept: text/html,application/xhtml+xml Content-Type: application/json; Content-Length: 27 ...
JSON vs. SOAP
{"Age":37,"FirstName":"Eyal",
"ID":"123", "LastName":"Vardi“ }
Headers
Data
Verb URL
<Envelope> <Header> <!–- Headers --> <!-- Protocol's & Polices --> </Header> <Body> <!– XML Data --> </Body> </Envelope>
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
Node.js
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
Node Has Arrived
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
Node Has Arrived
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
Node Has Arrived
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
Node Has Arrived
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
Node Has Arrived
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
Node.js Building Blocks
libuv V8Js, C+
+Node.
js
Google JavaScript engine
A high performance, cross-platform evented I/O library
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
Node.JS Advantages
Architecture
Single Thread
App == Server
Middleware
Deployment
XCopy
Run
Everywhere
Community
53,228
Packages
2.5M Download
in day.
Tools
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
NPM
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
Microsoft And Node.js
Today’s release enables Custom APIs to
be written using Node.js (we will support
writing Custom APIs in .NET as well in a
future release)…
Scott Guthrie Corporate Vice President in the Microsoft Server and Tools Business.
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
Node.js in Action
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
Everything’s Gone JavaScript “Everything that can be written in
JavaScript will eventually be written in JavaScript”. – Atwood’s law
JavaScript is now an integral part of several operating systems: Windows 8 Firefox OS Gnome (Linux) Chrome OS (Chromebooks)
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
The Hardware World JavaScript is also moving quickly into the
hardware world:
Arduino
Tessel
Espruino
Nodebots
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
What’s new in ECMAScript 6.0 JavaScript history
Syntax
Functions
Classes
Collections
Iterators &
Generators
Modules
Template String
Modules
Proxy
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
ParallelJS Parallelizes JavaScript code that uses the
array methods mapPar(), filterPar() and reducePar().
Array.prototype.mapPar()
Array.prototype.filterPar()
Array.prototype.reducePar()
Thread 2
Thread 4
Thread 1Thread 3Thread 1
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
Web Components
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
Near-Native Performance (ASM.JS)
* Chrome and Opera Optimize for Mozilla-Pioneered Asm.js
© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]
Thankseyalvardi.wordpress.com
Eyal VardiCEO E4D Solutions LTDMicrosoft MVP Visual C#blog: www.e4d.co.il