Future of JavaScript

Preview:

DESCRIPTION

Future of JavaScript

Citation preview

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il

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: Eyal@E4D.co.il

About Me

ConsultingMentoringProjects

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il

JavaScript History

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il

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: Eyal@E4D.co.il

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: Eyal@E4D.co.il

ECMAScript Versions

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il

The Challenge

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il

HTML 5 )Changes The Rules of The

Game(

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il

Single Page Web Apps (SPA)

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il

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: Eyal@E4D.co.il

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: Eyal@E4D.co.il

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: Eyal@E4D.co.il

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: Eyal@E4D.co.il

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il

Web API Growth

Source: www.programmableweb.com – current APIs: 4,535

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il

WCF vs. ASP.NET Web API

SOAP WSDL HTTP

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il

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: Eyal@E4D.co.il

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: Eyal@E4D.co.il

Node.js

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il

Node Has Arrived

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il

Node Has Arrived

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il

Node Has Arrived

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il

Node Has Arrived

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il

Node Has Arrived

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il

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: Eyal@E4D.co.il

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: Eyal@E4D.co.il

NPM

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il

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: Eyal@E4D.co.il

Node.js in Action

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il

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: Eyal@E4D.co.il

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: Eyal@E4D.co.il

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: Eyal@E4D.co.il

Web Components

© 2013 E4D LTD. All rights reserved. Tel: 054-5-767-300, Email: Eyal@E4D.co.il

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: Eyal@E4D.co.il

Thankseyalvardi.wordpress.com

Eyal VardiCEO E4D Solutions LTDMicrosoft MVP Visual C#blog: www.e4d.co.il

Recommended