Download - End-to-end W3C APIs
![Page 1: End-to-end W3C APIs](https://reader033.vdocuments.us/reader033/viewer/2022051608/5400086d8d7f724c088b4a84/html5/thumbnails/1.jpg)
End-to-endW3C APIsBy Alexandre Morgaut
JS.everywhere(2012) Silicon Valley
![Page 2: End-to-end W3C APIs](https://reader033.vdocuments.us/reader033/viewer/2022051608/5400086d8d7f724c088b4a84/html5/thumbnails/2.jpg)
Presentation• W3C AC member
• Web Architect
• JS Expert
• REST Lover
• NoSQL Fanboy
• W3C “jseverywhere“ community group
@amorgaut
![Page 3: End-to-end W3C APIs](https://reader033.vdocuments.us/reader033/viewer/2022051608/5400086d8d7f724c088b4a84/html5/thumbnails/3.jpg)
Agenda
• The World Wide Web
• The Standards
• Server-Side JavaScript
•Web Applications
•Now & Tomorrow
![Page 4: End-to-end W3C APIs](https://reader033.vdocuments.us/reader033/viewer/2022051608/5400086d8d7f724c088b4a84/html5/thumbnails/4.jpg)
![Page 5: End-to-end W3C APIs](https://reader033.vdocuments.us/reader033/viewer/2022051608/5400086d8d7f724c088b4a84/html5/thumbnails/5.jpg)
The Web
•WWW: WorldWideWeb(aka “Hypertext Project”)
•UDI: Uniform Document Identifier
•HTML: Hypertext Markup Language
•HTTP: Hypertext Transfer Protocol
• created in 1989 by Tim Berners-Lee
![Page 6: End-to-end W3C APIs](https://reader033.vdocuments.us/reader033/viewer/2022051608/5400086d8d7f724c088b4a84/html5/thumbnails/6.jpg)
REST
• Representational State Transfer
•Client-Server
• Stateless, Cache, Uniform Interface
• Layered System
•Code on Demand: JavaScript
• defined in 2000 by Roy Thomas Fielding
![Page 7: End-to-end W3C APIs](https://reader033.vdocuments.us/reader033/viewer/2022051608/5400086d8d7f724c088b4a84/html5/thumbnails/7.jpg)
Web Standards
![Page 8: End-to-end W3C APIs](https://reader033.vdocuments.us/reader033/viewer/2022051608/5400086d8d7f724c088b4a84/html5/thumbnails/8.jpg)
W3C
• Created at the MIT in 1994
• Led by Tim Berners-Lee and Dr. Jeffrey Jaffe
• Joint agreement among three "Host Institutions"
• MIT, ERCIM, Keio University
• Working Groups
• HTML, MathML, RDF, SVG, CSS, Audio, Device...
![Page 9: End-to-end W3C APIs](https://reader033.vdocuments.us/reader033/viewer/2022051608/5400086d8d7f724c088b4a84/html5/thumbnails/9.jpg)
IANA• Internet Assigned Numbers Authority
• created by Jon Postel and Joyce K. Reynolds
• department of ICANN (Internet Corporation for Assigned Names and Numbers)
• manages
• Domain Names, IP Addresses, Protocol registries
• MIME Media Types
• application, text, image, multipart...
![Page 10: End-to-end W3C APIs](https://reader033.vdocuments.us/reader033/viewer/2022051608/5400086d8d7f724c088b4a84/html5/thumbnails/10.jpg)
IETF
• Internet Engineering Task Force
• organized activity of the Internet Society (ISOC)
• cooperates with W3C & ISO/IEC
• manages the RFCs (Request For Comments)
• DNS, FTP, HTTP, SMTP, Zlib, Cookie, Atom
![Page 11: End-to-end W3C APIs](https://reader033.vdocuments.us/reader033/viewer/2022051608/5400086d8d7f724c088b4a84/html5/thumbnails/11.jpg)
ECMA• European Computer Manufacturers Association
• Standards
• CD-ROM, ECMAScript, C#, Office Open XML File Formats
• JavaScript
• ECMA-262 aka ECMAScript aka ISO/IEC 16262
• TC39-TG1 managed by Mr. J. Neumann
• E4X: ECMAScript for XML
• ECMAScript Internationalization API
• Test262
http://wiki.ecmascript.org
![Page 12: End-to-end W3C APIs](https://reader033.vdocuments.us/reader033/viewer/2022051608/5400086d8d7f724c088b4a84/html5/thumbnails/12.jpg)
WaSP• Web Standards Project
• founded in 1998 by Georges Olsen, Glenn Davis, & Jeffrey Zeldman
• convinced in 2001 Microsoft, Netscape, Opera & other browsers to support HTML 4.01, XHTML 1.0, CSS1, and ECMAScript
• AcidTests (by Ian Hickson)
• 1: HTML 4 & CSS 1
• 2: CSS 1 & CSS 2
• 3: HTML 4, XHTML 1.0, CSS 2.1, DOM 2, ECMAScript 3.1
• Today last versions of all major Browsers 100% compliant
![Page 13: End-to-end W3C APIs](https://reader033.vdocuments.us/reader033/viewer/2022051608/5400086d8d7f724c088b4a84/html5/thumbnails/13.jpg)
WHATWG• Web Hypertext Application Technology Working Group
• founded in 2004 by individuals from Apple, the Mozilla & Opera
• Led by Ian Hickson
• Created to work on HTML5 based on Web Apps 1.0 + Web Forms 2.0 while the W3C choose to concentrate on XHTML
• HTML being a living standard (no more versions)
• Proposed
• Web Workers, Web Storage, Web Sockets, ...
• New W3C working group created in 2007 to work on HTML5
• WHATWG & W3C editions of HTML5 can have some differences
![Page 14: End-to-end W3C APIs](https://reader033.vdocuments.us/reader033/viewer/2022051608/5400086d8d7f724c088b4a84/html5/thumbnails/14.jpg)
CommonJS• created in 2009 by Kevin Dangoor as ServerJS on Mozilla Wiki
• standards for JavaScript on the server
• Narwhal, Helma NG, v8CGI, GPSEE, chiron, Persevere
• Renamed CommonJS
• command line tools, desktop, addon, or browser implementations
• joined by CouchDB, Wakanda, Sproutcore, node.js, RequireJS...
• Modules, Packages, and Promises
• Binary, FileSystem, System, I/O stream, Socket I/O
• Browser like APIs: worker, console, HTTP client
![Page 15: End-to-end W3C APIs](https://reader033.vdocuments.us/reader033/viewer/2022051608/5400086d8d7f724c088b4a84/html5/thumbnails/15.jpg)
Server-Side JavaScript
![Page 16: End-to-end W3C APIs](https://reader033.vdocuments.us/reader033/viewer/2022051608/5400086d8d7f724c088b4a84/html5/thumbnails/16.jpg)
Engines
• Mozilla SpiderMonkey
• Mozilla Rhino
• Webkit JavaScriptCore
• Google V8
• Microsoft Chakra
• Opera Carakan
![Page 17: End-to-end W3C APIs](https://reader033.vdocuments.us/reader033/viewer/2022051608/5400086d8d7f724c088b4a84/html5/thumbnails/17.jpg)
Standards
• ECMAScript
• CommonJS
![Page 18: End-to-end W3C APIs](https://reader033.vdocuments.us/reader033/viewer/2022051608/5400086d8d7f724c088b4a84/html5/thumbnails/18.jpg)
Servers• Microsoft IIS
• Persevere
• Jaxer
• node.js
• Wakanda
• RingoJS
• SilkJS
![Page 19: End-to-end W3C APIs](https://reader033.vdocuments.us/reader033/viewer/2022051608/5400086d8d7f724c088b4a84/html5/thumbnails/19.jpg)
NoSQL Databases
• CouchDB
• MongoDB
• Riak
• WakandaDB
• ArangoDB
• OrientDB
![Page 20: End-to-end W3C APIs](https://reader033.vdocuments.us/reader033/viewer/2022051608/5400086d8d7f724c088b4a84/html5/thumbnails/20.jpg)
Web Application “1.0”
![Page 21: End-to-end W3C APIs](https://reader033.vdocuments.us/reader033/viewer/2022051608/5400086d8d7f724c088b4a84/html5/thumbnails/21.jpg)
HTML5 APIs• XMLHttpRequest 2
• Blob
• File / FileSystem
• Web SQL
• Web Storage
• Web Workers
• Web Sockets
• Web Cryptography
• ImageData
• Typed Arrays
• Storage Quota
• System Information
• URL
• WebCL
![Page 22: End-to-end W3C APIs](https://reader033.vdocuments.us/reader033/viewer/2022051608/5400086d8d7f724c088b4a84/html5/thumbnails/22.jpg)
Async & Sync
• XMLHttpRequest(method, url, async)
• FileReaderSync()
• requestFileSystemSync()
• openDatabaseSync()
• indexedDBSync.open()
• localStorage.getItem()
![Page 23: End-to-end W3C APIs](https://reader033.vdocuments.us/reader033/viewer/2022051608/5400086d8d7f724c088b4a84/html5/thumbnails/23.jpg)
Web Workers
• Dedicated or Shared
• No Window, No Document
• WorkerGlobal, WorkerUtils
• WorkerNavigator, WorkerLocation
• postMessage(), onmessage(), onerror()
• importScripts()
![Page 24: End-to-end W3C APIs](https://reader033.vdocuments.us/reader033/viewer/2022051608/5400086d8d7f724c088b4a84/html5/thumbnails/24.jpg)
Concept
• Server JS contexts == Workers
• multi-threaded -> Dedicated Workers
• single threaded EventLoop -> Shared
• Server JS contexts === Remote JS Workers
![Page 25: End-to-end W3C APIs](https://reader033.vdocuments.us/reader033/viewer/2022051608/5400086d8d7f724c088b4a84/html5/thumbnails/25.jpg)
Now & Tomorrow
![Page 26: End-to-end W3C APIs](https://reader033.vdocuments.us/reader033/viewer/2022051608/5400086d8d7f724c088b4a84/html5/thumbnails/26.jpg)
RingoJS
• W3C
• Web Worker
• CommonJS
• Modules
• System, fs, binary, IO, Unit Test
• Other: console
![Page 27: End-to-end W3C APIs](https://reader033.vdocuments.us/reader033/viewer/2022051608/5400086d8d7f724c088b4a84/html5/thumbnails/27.jpg)
SilkJS
• W3C
• XMLHttpRequest
• CommonJS
• Modules
![Page 28: End-to-end W3C APIs](https://reader033.vdocuments.us/reader033/viewer/2022051608/5400086d8d7f724c088b4a84/html5/thumbnails/28.jpg)
node.js• W3C via modules
• XMLHttpRequest (node-xmlhttprequest)
• Web Sockets (node-websocket-client)
• DOM (node-o3-fastxml), IndexedDB (perstore)
• CommonJS
• Modules, Packages
• Other: console
![Page 29: End-to-end W3C APIs](https://reader033.vdocuments.us/reader033/viewer/2022051608/5400086d8d7f724c088b4a84/html5/thumbnails/29.jpg)
Wakanda• W3C
• XMLHttpRequest, WindowTimer,
• Web Storage, Web Worker,
• File, FileSystem, Blob, ...
• CommonJS
• Modules, System, Unit Test
• Other: console
![Page 30: End-to-end W3C APIs](https://reader033.vdocuments.us/reader033/viewer/2022051608/5400086d8d7f724c088b4a84/html5/thumbnails/30.jpg)
Summary• ECMAScript is already everywhere
• Modules: CommonJS already standard, AMD, ECMAScript 6
• Many W3C APIs already applicable server-side
• Same APIs means
• better learning curve
• more shared libraries / modules
• DRY -> shared Model work Offline
![Page 31: End-to-end W3C APIs](https://reader033.vdocuments.us/reader033/viewer/2022051608/5400086d8d7f724c088b4a84/html5/thumbnails/31.jpg)
Client and Server JavaScript APIs W3C Community Group
http://www.w3.org/community/jseverywhere/