End-to-end W3C APIs - tpac 2012

4,706 views
4,646 views

Published on

- Web Worker context compared to SSJS context
- Mixte Synchronous / Asynchronous APIs
- Making Existing Client-side JS APIs recommendations adaptable to the server context
- Defining W3C recommendation for Server-side JavaScript APIs?
- Remote debugging for Remote (Server) Workers
- Potential common package/module format support (CommonJS, AMD, ECMAScript 6)
- DOM Events, ProgressEvent, EventSource, Server Events (EventEmitter?), & Client Events
- Feedback on previous work at CommonJS and from some SSJS implementations
- Feedback on our experiences in the Wakanda implementation
- start the activity of the community group

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
4,706
On SlideShare
0
From Embeds
0
Number of Embeds
12
Actions
Shares
0
Downloads
20
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

End-to-end W3C APIs - tpac 2012

  1. 1. End-to-endW3C APIs By Alexandre MorgautTPAC 2012 - Lyon, France
  2. 2. Agenda• The Web & JavaScript• W3C APIs• Server-Side JavaScript• Web Applications• Now & Tomorrow
  3. 3. The Web & JavaScript
  4. 4. REST• Representational State Transfer • Client-Server • Stateless, Cache, Uniform Interface • Layered System • Code on Demand: JavaScript• defined in 2000 by Roy Thomas Fielding
  5. 5. Web Standards
  6. 6. 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...
  7. 7. 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
  8. 8. W3C on Server-Side ?
  9. 9. DOM• Java• JavaScript• .NET• PHP• python• ..;
  10. 10. Server-Side JavaScript
  11. 11. Standards• ECMAScript• CommonJS More than 60 SSJS implementations
  12. 12. Servers• Microsoft IIS• Persevere• Jaxer• node.js• Wakanda• RingoJS• SilkJS
  13. 13. NoSQL Databases• CouchDB• MongoDB• Riak• WakandaDB• ArangoDB• OrientDB
  14. 14. Web Application “1.0”
  15. 15. HTML5 APIs• XMLHttpRequest 2 • Web Cryptography• Blob • ImageData• File / FileSystem • Typed Arrays• Web SQL • Storage Quota• Web Storage • System Information• Web Workers • URL• Web Sockets • WebCL
  16. 16. WebCL“This section proposes mechanisms for transferring pixeldata between WebCL memory objects and HTML mediaelements. Server-side or Web Worker basedimplementations of WebCL will not berequired to support these features.” https://cvs.khronos.org/svn/repos/registry/trunk/public/webcl/spec/latest/index.html#4
  17. 17. Web SQL“This document was on the W3C Recommendation trackbut specification work has stopped.The specificationreached an impasse: all interested implementorshave used the same SQL backend (Sqlite),but we need multiple independentimplementations to proceed along a standardisationpath.” http://www.w3.org/TR/webdatabase/
  18. 18. Async “and” Sync• XMLHttpRequest(method, url, async)• FileReaderSync()• requestFileSystemSync()• openDatabaseSync()• indexedDBSync.open()• localStorage.getItem()
  19. 19. IndexedDB“The synchronous database API methods provide ablocking access pattern to IndexedDB databases. Sincethey block the calling thread they are onlyavailable from workers.” http://www.w3.org/TR/IndexedDB/#sync-database
  20. 20. Web Workers• Dedicated or Shared• No Window, No Document• WorkerGlobal, WorkerUtils• WorkerNavigator, WorkerLocation• postMessage(), onmessage(), onerror()• importScripts()
  21. 21. Concept• Server JS contexts == Workers • multi-threaded -> Dedicated Workers • single threaded EventLoop -> Shared• Server JS contexts === Remote JS Workers
  22. 22. Now & Tomorrow
  23. 23. RingoJS• W3C • Web Worker• CommonJS • Modules • System, fs, binary, IO, Unit Test• Other: console
  24. 24. SilkJS• W3C • XMLHttpRequest• CommonJS • Modules
  25. 25. node.js• W3C via modules • XMLHttpRequest (node-xmlhttprequest) • Web Sockets (node-websocket-client) • DOM (node-o3-fastxml), IndexedDB (perstore)• CommonJS • Modules, Packages• Other: console
  26. 26. Wakanda• W3C • XMLHttpRequest, WindowTimer, • Web Storage, Web Worker, • File, FileSystem, Blob, ...• CommonJS • Modules, System, Unit Test• Other: console
  27. 27. Wakanda• Web Storage • sessionStorage, user.storage, storage• Web Workers • Worker, SharedWorker, SystemWorker
  28. 28. Wakanda• Server-side JS context • CommonJS (module.id, require, ...) • Worker (importScripts, WindowTimer, ...)
  29. 29. 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
  30. 30. Client and Server JavaScript APIs W3C Community Grouphttp://www.w3.org/community/jseverywhere/ Let’s start!

×