future of javascript

39
4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected] Eyal Vard CEO E4D Solutions L Microsoft MVP Visu C# site: www.e4d.co. Everything that can be written in JavaScript will eventually be written in JavaScript .” ( Atwood’s law )

Upload: eyal-vardi

Post on 10-May-2015

2.426 views

Category:

Technology


3 download

DESCRIPTION

Future of JavaScript

TRANSCRIPT

Page 1: Future of JavaScript

© 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)

Page 2: Future of JavaScript

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]

About Me

ConsultingMentoringProjects

Page 3: Future of JavaScript

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]

JavaScript History

Page 4: Future of JavaScript

© 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')

Page 5: Future of 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.

Page 6: Future of JavaScript

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]

ECMAScript Versions

Page 7: Future of JavaScript

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]

The Challenge

Page 8: Future of JavaScript

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]

Page 9: Future of JavaScript

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]

Page 10: Future of JavaScript

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]

HTML 5 )Changes The Rules of The

Game(

Page 11: Future of JavaScript

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]

Single Page Web Apps (SPA)

Page 12: Future of JavaScript

© 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

Page 13: Future of JavaScript

© 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

Page 14: Future of JavaScript

© 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

Page 15: Future of JavaScript

© 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

Page 16: Future of JavaScript

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]

Page 17: Future of JavaScript

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]

Page 18: Future of JavaScript

© 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

Page 19: Future of JavaScript

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]

WCF vs. ASP.NET Web API

SOAP WSDL HTTP

Page 20: Future of JavaScript

© 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

Page 21: Future of JavaScript

© 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>

Page 22: Future of JavaScript

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]

Node.js

Page 23: Future of JavaScript

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]

Node Has Arrived

Page 24: Future of JavaScript

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]

Node Has Arrived

Page 25: Future of JavaScript

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]

Node Has Arrived

Page 26: Future of JavaScript

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]

Node Has Arrived

Page 27: Future of JavaScript

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]

Node Has Arrived

Page 28: Future of JavaScript

© 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

Page 29: Future of JavaScript

© 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

Page 30: Future of JavaScript

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]

NPM

Page 31: Future of JavaScript

© 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. 

Page 32: Future of JavaScript

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]

Node.js in Action

Page 34: Future of JavaScript

© 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

Page 35: Future of JavaScript

© 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

Page 36: Future of JavaScript

© 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

Page 37: Future of JavaScript

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: [email protected]

Web Components

Page 38: Future of JavaScript

© 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

Page 39: Future of JavaScript

© 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