Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

CommonJS Everywhere (Wakanday 2011)

4,030 views

Published on

CommonJS is a community-driven effort by volunteers with diverse backgrounds and interests to converge on a minimal common ground that is sound and scalable. The goal is to make writing portable JavaScript applications that run on servers, browsers, desktop applications, and secure sandboxes not only possible, but also accessible to developers and development tools without vendor lock-in or steep learning curves.

Christoph will attempt to paint us a picture of where CommonJS is today and where it is headed. CommonJS is well on its way to realizing the dream of portable JavaScript applications composed of libraries from all over the Internet. That is, modular JavaScript that runs everywhere.

Published in: Technology, Design

CommonJS Everywhere (Wakanday 2011)

  1. 1. CommonJS Everywhere wakanday 2011 JS.everywhere(Boston, October, 15) by Christoph Dorn Copyright (c) 2011 Christoph Dorn <christoph@christophdorn.com> License: Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Various names and trademarks copyright respective parties.
  2. 2. CommonJS Everywhere
  3. 3. CommonJS Everywhere What does CommonJS Everywhere mean?
  4. 4. CommonJS Everywhere What does CommonJS Everywhere mean? Being able to run CommonJScompliant code in all areas a system.
  5. 5. CommonJS Everywhere What does CommonJS Everywhere mean? Being able to run CommonJS compliant code in all areas a system.Since CommonJS builds on JavaScript we need JavaScript Everywhere first!
  6. 6. CommonJS Everywhere What does CommonJS Everywhere mean? Being able to run CommonJS compliant code in all areas a system.Since CommonJS builds on JavaScript we need JavaScript Everywhere first! Where are we at with that and where does CommonJS fit within this context?
  7. 7. JavaScript Everywhere
  8. 8. JavaScript Everywhere• All too familiar with Browsers
  9. 9. JavaScript Everywhere• All too familiar with Browsers• Have heard of Server Side JavaScript (thanks to NodeJS)
  10. 10. JavaScript Everywhere• All too familiar with Browsers• Have heard of Server Side JavaScript (thanks to NodeJS)• Know about Firebug a Firefox Extension
  11. 11. JavaScript Everywhere• All too familiar with Browsers• Have heard of Server Side JavaScript (thanks to NodeJS)• Know about Firebug a Firefox Extension• Titanium and PhoneGap for Native JS Mobile Apps
  12. 12. JavaScript Everywhere• All too familiar with Browsers• Have heard of Server Side JavaScript (thanks to NodeJS)• Know about Firebug a Firefox Extension• Titanium and PhoneGap for Native JS Mobile Apps• AppEngineJS for Google App Engine (Java/Rhino)
  13. 13. JavaScript Everywhere• All too familiar with Browsers• Have heard of Server Side JavaScript (thanks to NodeJS)• Know about Firebug a Firefox Extension• Titanium and PhoneGap for Native JS Mobile Apps• AppEngineJS for Google App Engine (Java/Rhino)• V8CGI for CGI, FastCGI, Apache module and CLI JS
  14. 14. JavaScript Everywhere• All too familiar with Browsers• Have heard of Server Side JavaScript (thanks to NodeJS)• Know about Firebug a Firefox Extension• Titanium and PhoneGap for Native JS Mobile Apps• AppEngineJS for Google App Engine (Java/Rhino)• V8CGI for CGI, FastCGI, Apache module and CLI JS• GPSEE for Embedding Spidermonkey in C and Shell JS
  15. 15. JavaScript Everywhere• All too familiar with Browsers• Have heard of Server Side JavaScript (thanks to NodeJS)• Know about Firebug a Firefox Extension• Titanium and PhoneGap for Native JS Mobile Apps• AppEngineJS for Google App Engine (Java/Rhino)• V8CGI for CGI, FastCGI, Apache module and CLI JS• GPSEE for Embedding Spidermonkey in C and Shell JS• RingoJS for Embedding Rhino in Java
  16. 16. JavaScript Everywhere• All too familiar with Browsers• Have heard of Server Side JavaScript (thanks to NodeJS)• Know about Firebug a Firefox Extension• Titanium and PhoneGap for Native JS Mobile Apps• AppEngineJS for Google App Engine (Java/Rhino)• V8CGI for CGI, FastCGI, Apache module and CLI JS• GPSEE for Embedding Spidermonkey in C and Shell JS• RingoJS for Embedding Rhino in Java• Narwhal for JavaScriptCore, Node & Rhino
  17. 17. JavaScript Everywhere• All too familiar with Browsers• Have heard of Server Side JavaScript (thanks to NodeJS)• Know about Firebug a Firefox Extension• Titanium and PhoneGap for Native JS Mobile Apps• AppEngineJS for Google App Engine (Java/Rhino)• V8CGI for CGI, FastCGI, Apache module and CLI JS• GPSEE for Embedding Spidermonkey in C and Shell JS• RingoJS for Embedding Rhino in Java• Narwhal for JavaScriptCore, Node & Rhino• Add-on SDK for Restartless & Secure Firefox Extensions
  18. 18. JavaScript Everywhere• All too familiar with Browsers• Have heard of Server Side JavaScript (thanks to NodeJS)• Know about Firebug a Firefox Extension• Titanium and PhoneGap for Native JS Mobile Apps• AppEngineJS for Google App Engine (Java/Rhino)• V8CGI for CGI, FastCGI, Apache module and CLI JS• GPSEE for Embedding Spidermonkey in C and Shell JS• RingoJS for Embedding Rhino in Java• Narwhal for JavaScriptCore, Node & Rhino• Add-on SDK for Restartless & Secure Firefox Extensions• CouchDB Apps served from a User-facing REST Database
  19. 19. JavaScript Everywhere• All too familiar with Browsers• Have heard of Server Side JavaScript (thanks to NodeJS)• Know about Firebug a Firefox Extension• Titanium and PhoneGap for Native JS Mobile Apps• AppEngineJS for Google App Engine (Java/Rhino)• V8CGI for CGI, FastCGI, Apache module and CLI JS• GPSEE for Embedding Spidermonkey in C and Shell JS• RingoJS for Embedding Rhino in Java• Narwhal for JavaScriptCore, Node & Rhino• Add-on SDK for Restartless & Secure Firefox Extensions• CouchDB Apps served from a User-facing REST Database What do all these platforms have in common?
  20. 20. JavaScript Everywhere
  21. 21. JavaScript EverywhereAll these (and many more) platforms:
  22. 22. JavaScript EverywhereAll these (and many more) platforms:• Allow us to run JavaScript everywhere
  23. 23. JavaScript EverywhereAll these (and many more) platforms:• Allow us to run JavaScript everywhere• Maintained by passionate authors and contributors
  24. 24. JavaScript EverywhereAll these (and many more) platforms:• Allow us to run JavaScript everywhere• Maintained by passionate authors and contributors• Have energetic and loyal userbases
  25. 25. JavaScript EverywhereAll these (and many more) platforms:• Allow us to run JavaScript everywhere• Maintained by passionate authors and contributors• Have energetic and loyal userbases• Have great ideas
  26. 26. JavaScript EverywhereAll these (and many more) platforms:• Allow us to run JavaScript everywhere• Maintained by passionate authors and contributors• Have energetic and loyal userbases• Have great ideas• Solve specific problems
  27. 27. JavaScript EverywhereAll these (and many more) platforms:• Allow us to run JavaScript everywhere• Maintained by passionate authors and contributors• Have energetic and loyal userbases• Have great ideas• Solve specific problems• Share common problems
  28. 28. JavaScript EverywhereAll these (and many more) platforms:• Allow us to run JavaScript everywhere• Maintained by passionate authors and contributors• Have energetic and loyal userbases• Have great ideas• Solve specific problems• Share common problems That is a great thing!
  29. 29. JavaScript Everywhere
  30. 30. JavaScript EverywhereBUT all these (and many more) platforms also lack:
  31. 31. JavaScript EverywhereBUT all these (and many more) platforms also lack:• A compatible standard library
  32. 32. JavaScript EverywhereBUT all these (and many more) platforms also lack:• A compatible standard library (Binary, IO, File, Socket, Event, System, ...)
  33. 33. JavaScript EverywhereBUT all these (and many more) platforms also lack:• A compatible standard library (Binary, IO, File, Socket, Event, System, ...)• Ability to share the same code packages & modules
  34. 34. JavaScript EverywhereBUT all these (and many more) platforms also lack:• A compatible standard library (Binary, IO, File, Socket, Event, System, ...)• Ability to share the same code packages & modules• Ability to share the same debug tools
  35. 35. JavaScript EverywhereBUT all these (and many more) platforms also lack:• A compatible standard library (Binary, IO, File, Socket, Event, System, ...)• Ability to share the same code packages & modules• Ability to share the same debug tools• Ability to set portable standards by themselves
  36. 36. JavaScript EverywhereBUT all these (and many more) platforms also lack:• A compatible standard library (Binary, IO, File, Socket, Event, System, ...)• Ability to share the same code packages & modules• Ability to share the same debug tools• Ability to set portable standards by themselves That is an unfortunate thing!
  37. 37. JavaScript Everywhere
  38. 38. JavaScript EverywhereBUT there is a solution:
  39. 39. JavaScript EverywhereBUT there is a solution: CommonJS!
  40. 40. JavaScript EverywhereBUT there is a solution: CommonJS! What is CommonJS?
  41. 41. CommonJS: What
  42. 42. CommonJS: What• Group of volunteers from many different projects
  43. 43. CommonJS: What• Group of volunteers from many different projects • Want to: use JavaScript & share code
  44. 44. CommonJS: What• Group of volunteers from many different projects • Want to: use JavaScript & share code• A Mailing List
  45. 45. CommonJS: What• Group of volunteers from many different projects • Want to: use JavaScript & share code• A Mailing List• A Wiki with specifications in various stages
  46. 46. CommonJS: What• Group of volunteers from many different projects • Want to: use JavaScript & share code• A Mailing List• A Wiki with specifications in various stages• Run by group consensus and benevolent dictators
  47. 47. CommonJS: What• Group of volunteers from many different projects • Want to: use JavaScript & share code• A Mailing List• A Wiki with specifications in various stages• Run by group consensus and benevolent dictators• Implementation driven
  48. 48. CommonJS: What• Group of volunteers from many different projects • Want to: use JavaScript & share code• A Mailing List• A Wiki with specifications in various stages• Run by group consensus and benevolent dictators• Implementation driven• Always open for membership!
  49. 49. CommonJS: What• Group of volunteers from many different projects • Want to: use JavaScript & share code• A Mailing List• A Wiki with specifications in various stages• Run by group consensus and benevolent dictators• Implementation driven• Always open for membership! A group of people working together to realize an Ecosystem for JavaScript
  50. 50. What does it look like?
  51. 51. What does it look like?
  52. 52. CommonJS: API Process
  53. 53. CommonJS: API ProcessHow does the CommonJS API proposal process work?
  54. 54. CommonJS: API ProcessHow does the CommonJS API proposal process work? 1. You pick a JS platform
  55. 55. CommonJS: API ProcessHow does the CommonJS API proposal process work? 1. You pick a JS platform 2. Play with it and tie it into some of your stuff
  56. 56. CommonJS: API ProcessHow does the CommonJS API proposal process work? 1. You pick a JS platform 2. Play with it and tie it into some of your stuff 3. Now you want to do something with a second platform; BUT:
  57. 57. CommonJS: API ProcessHow does the CommonJS API proposal process work? 1. You pick a JS platform 2. Play with it and tie it into some of your stuff 3. Now you want to do something with a second platform; BUT: • There are no consistent APIs across platforms
  58. 58. CommonJS: API ProcessHow does the CommonJS API proposal process work? 1. You pick a JS platform 2. Play with it and tie it into some of your stuff 3. Now you want to do something with a second platform; BUT: • There are no consistent APIs across platforms 4. So you ASK and then:
  59. 59. CommonJS: API ProcessHow does the CommonJS API proposal process work? 1. You pick a JS platform 2. Play with it and tie it into some of your stuff 3. Now you want to do something with a second platform; BUT: • There are no consistent APIs across platforms 4. So you ASK and then: • Hack something together based on the best you can find or know
  60. 60. CommonJS: API ProcessHow does the CommonJS API proposal process work? 1. You pick a JS platform 2. Play with it and tie it into some of your stuff 3. Now you want to do something with a second platform; BUT: • There are no consistent APIs across platforms 4. So you ASK and then: • Hack something together based on the best you can find or know • Notice sound common ground and improve your implementation
  61. 61. CommonJS: API ProcessHow does the CommonJS API proposal process work? 1. You pick a JS platform 2. Play with it and tie it into some of your stuff 3. Now you want to do something with a second platform; BUT: • There are no consistent APIs across platforms 4. So you ASK and then: • Hack something together based on the best you can find or know • Notice sound common ground and improve your implementation 5. Champion your solution on the CommonJS Wiki & Mailing List
  62. 62. CommonJS: API ProcessHow does the CommonJS API proposal process work? 1. You pick a JS platform 2. Play with it and tie it into some of your stuff 3. Now you want to do something with a second platform; BUT: • There are no consistent APIs across platforms 4. So you ASK and then: • Hack something together based on the best you can find or know • Notice sound common ground and improve your implementation 5. Champion your solution on the CommonJS Wiki & Mailing List 6. Expect to be redirected or have your solution dissected
  63. 63. CommonJS: API ProcessHow does the CommonJS API proposal process work? 1. You pick a JS platform 2. Play with it and tie it into some of your stuff 3. Now you want to do something with a second platform; BUT: • There are no consistent APIs across platforms 4. So you ASK and then: • Hack something together based on the best you can find or know • Notice sound common ground and improve your implementation 5. Champion your solution on the CommonJS Wiki & Mailing List 6. Expect to be redirected or have your solution dissected 7. See the solution grow into a specification with many implementations
  64. 64. CommonJS: API ProcessHow does the CommonJS API proposal process work? 1. You pick a JS platform 2. Play with it and tie it into some of your stuff 3. Now you want to do something with a second platform; BUT: • There are no consistent APIs across platforms 4. So you ASK and then: • Hack something together based on the best you can find or know • Notice sound common ground and improve your implementation 5. Champion your solution on the CommonJS Wiki & Mailing List 6. Expect to be redirected or have your solution dissected 7. See the solution grow into a specification with many implementationsTake pride in helping CommonJS move forward!
  65. 65. CommonJS: Standards
  66. 66. CommonJS: StandardsWhat makes a CommonJS specification ratified?
  67. 67. CommonJS: StandardsWhat makes a CommonJS specification ratified? 1. A proposal
  68. 68. CommonJS: StandardsWhat makes a CommonJS specification ratified? 1. A proposal 2. Sufficient discussions
  69. 69. CommonJS: StandardsWhat makes a CommonJS specification ratified? 1. A proposal 2. Sufficient discussions 3. Group consensus
  70. 70. CommonJS: StandardsWhat makes a CommonJS specification ratified? 1. A proposal 2. Sufficient discussions 3. Group consensus 4. Draft specification
  71. 71. CommonJS: StandardsWhat makes a CommonJS specification ratified? 1. A proposal 2. Sufficient discussions 3. Group consensus 4. Draft specification 5. Sufficient votes from members with skin in the CommonJS game
  72. 72. CommonJS: StandardsWhat makes a CommonJS specification ratified? 1. A proposal 2. Sufficient discussions 3. Group consensus 4. Draft specification 5. Sufficient votes from members with skin in the CommonJS game 6. At least a handful of implementations
  73. 73. CommonJS: StandardsWhat makes a CommonJS specification ratified? 1. A proposal 2. Sufficient discussions 3. Group consensus 4. Draft specification 5. Sufficient votes from members with skin in the CommonJS game 6. At least a handful of implementations 7. Sufficient time
  74. 74. CommonJS: StandardsWhat makes a CommonJS specification ratified? 1. A proposal 2. Sufficient discussions 3. Group consensus 4. Draft specification 5. Sufficient votes from members with skin in the CommonJS game 6. At least a handful of implementations 7. Sufficient timeIs it worth it?
  75. 75. CommonJS: StandardsWhat makes a CommonJS specification ratified? 1. A proposal 2. Sufficient discussions 3. Group consensus 4. Draft specification 5. Sufficient votes from members with skin in the CommonJS game 6. At least a handful of implementations 7. Sufficient timeIs it worth it? Absolutely!
  76. 76. CommonJS: The Result
  77. 77. CommonJS: The Result Modules, Packages & Platforms targeting CommonJS compliance are truly interoperable!
  78. 78. CommonJS: Status
  79. 79. CommonJS: StatusWhere is CommonJS at?
  80. 80. CommonJS: StatusWhere is CommonJS at? • Modules 1.1/1.1.1 (RATIFIED) MANY implementations YAY!
  81. 81. CommonJS: StatusWhere is CommonJS at? • Modules 1.1/1.1.1 (RATIFIED) MANY implementations YAY! • Packages 1.0 (RATIFIED) 1.1 in the works
  82. 82. CommonJS: StatusWhere is CommonJS at? • Modules 1.1/1.1.1 (RATIFIED) MANY implementations YAY! • Packages 1.0 (RATIFIED) 1.1 in the works • Unit Testing 1.0 (RATIFIED) amendment pending
  83. 83. CommonJS: StatusWhere is CommonJS at? • Modules 1.1/1.1.1 (RATIFIED) MANY implementations YAY! • Packages 1.0 (RATIFIED) 1.1 in the works • Unit Testing 1.0 (RATIFIED) amendment pending • System 1.0 (pre-RATIFIED) more IMPLEMENTATIONS needed
  84. 84. CommonJS: StatusWhere is CommonJS at? • Modules 1.1/1.1.1 (RATIFIED) MANY implementations YAY! • Packages 1.0 (RATIFIED) 1.1 in the works • Unit Testing 1.0 (RATIFIED) amendment pending • System 1.0 (pre-RATIFIED) more IMPLEMENTATIONS needed • JSGI 0.2/0.3 (PROPOSALS) more IMPLEMENTATIONS needed
  85. 85. CommonJS: StatusWhere is CommonJS at? • Modules 1.1/1.1.1 (RATIFIED) MANY implementations YAY! • Packages 1.0 (RATIFIED) 1.1 in the works • Unit Testing 1.0 (RATIFIED) amendment pending • System 1.0 (pre-RATIFIED) more IMPLEMENTATIONS needed • JSGI 0.2/0.3 (PROPOSALS) more IMPLEMENTATIONS needed • Many proposals that need discussion and IMPLEMENTATIONS
  86. 86. CommonJS: StatusWhere is CommonJS at? • Modules 1.1/1.1.1 (RATIFIED) MANY implementations YAY! • Packages 1.0 (RATIFIED) 1.1 in the works • Unit Testing 1.0 (RATIFIED) amendment pending • System 1.0 (pre-RATIFIED) more IMPLEMENTATIONS needed • JSGI 0.2/0.3 (PROPOSALS) more IMPLEMENTATIONS needed • Many proposals that need discussion and IMPLEMENTATIONSSufficient for CommonJS Everywhere?
  87. 87. CommonJS: StatusWhere is CommonJS at? • Modules 1.1/1.1.1 (RATIFIED) MANY implementations YAY! • Packages 1.0 (RATIFIED) 1.1 in the works • Unit Testing 1.0 (RATIFIED) amendment pending • System 1.0 (pre-RATIFIED) more IMPLEMENTATIONS needed • JSGI 0.2/0.3 (PROPOSALS) more IMPLEMENTATIONS needed • Many proposals that need discussion and IMPLEMENTATIONSSufficient for CommonJS Everywhere? Unfortunately NO :(
  88. 88. CommonJS: StatusWhere is CommonJS at? • Modules 1.1/1.1.1 (RATIFIED) MANY implementations YAY! • Packages 1.0 (RATIFIED) 1.1 in the works • Unit Testing 1.0 (RATIFIED) amendment pending • System 1.0 (pre-RATIFIED) more IMPLEMENTATIONS needed • JSGI 0.2/0.3 (PROPOSALS) more IMPLEMENTATIONS needed • Many proposals that need discussion and IMPLEMENTATIONSSufficient for CommonJS Everywhere? Unfortunately NO :(What is needed?
  89. 89. CommonJS: Needed
  90. 90. CommonJS: NeededWhat do we need for CommonJS Everywhere?
  91. 91. CommonJS: NeededWhat do we need for CommonJS Everywhere? • Portable unit tests for specifications
  92. 92. CommonJS: NeededWhat do we need for CommonJS Everywhere? • Portable unit tests for specifications • Move to Github for specifications and tests
  93. 93. CommonJS: NeededWhat do we need for CommonJS Everywhere? • Portable unit tests for specifications • Move to Github for specifications and tests • New interest from new and existing members
  94. 94. CommonJS: NeededWhat do we need for CommonJS Everywhere? • Portable unit tests for specifications • Move to Github for specifications and tests • New interest from new and existing members • More implementers seeking CommonJS compliance
  95. 95. CommonJS: NeededWhat do we need for CommonJS Everywhere? • Portable unit tests for specifications • Move to Github for specifications and tests • New interest from new and existing members • More implementers seeking CommonJS compliance • Users demanding CommonJS compliance
  96. 96. CommonJS: NeededWhat do we need for CommonJS Everywhere? • Portable unit tests for specifications • Move to Github for specifications and tests • New interest from new and existing members • More implementers seeking CommonJS compliance • Users demanding CommonJS compliance • Packages/Mappings/C (PROPOSAL)
  97. 97. Packages/Mappings/C
  98. 98. CommonJS: NeededWhat do we need for CommonJS Everywhere? • Portable unit tests for specifications • Move to Github for specifications and tests • New interest from new and existing members • More implementers seeking CommonJS compliance • Users demanding CommonJS compliance • Packages/Mappings/C (PROPOSAL)
  99. 99. CommonJS: NeededWhat do we need for CommonJS Everywhere? • Portable unit tests for specifications • Move to Github for specifications and tests • New interest from new and existing members • More implementers seeking CommonJS compliance • Users demanding CommonJS compliance • Packages/Mappings/C (PROPOSAL) • Modules 2.0 (DRAFT) “wrapped” Modules 1.1 + more
  100. 100. CommonJS: NeededWhat do we need for CommonJS Everywhere? • Portable unit tests for specifications • Move to Github for specifications and tests • New interest from new and existing members • More implementers seeking CommonJS compliance • Users demanding CommonJS compliance • Packages/Mappings/C (PROPOSAL) • Modules 2.0 (DRAFT) “wrapped” Modules 1.1 + more • Portable loaders + package managers & registries
  101. 101. CommonJS: NeededWhat do we need for CommonJS Everywhere? • Portable unit tests for specifications • Move to Github for specifications and tests • New interest from new and existing members • More implementers seeking CommonJS compliance • Users demanding CommonJS compliance • Packages/Mappings/C (PROPOSAL) • Modules 2.0 (DRAFT) “wrapped” Modules 1.1 + more • Portable loaders + package managers & registries • Agreement on low-level APIs
  102. 102. CommonJS: NeededWhat do we need for CommonJS Everywhere? • Portable unit tests for specifications • Move to Github for specifications and tests • New interest from new and existing members • More implementers seeking CommonJS compliance • Users demanding CommonJS compliance • Packages/Mappings/C (PROPOSAL) • Modules 2.0 (DRAFT) “wrapped” Modules 1.1 + more • Portable loaders + package managers & registries • Agreement on low-level APIsWhat is happening in this regard?
  103. 103. CommonJS: Happenings
  104. 104. CommonJS: HappeningsKey platforms are converging:
  105. 105. CommonJS: HappeningsKey platforms are converging: • RingoJS, GPSEE and V8CGI increasingly compatible
  106. 106. CommonJS: HappeningsKey platforms are converging: • RingoJS, GPSEE and V8CGI increasingly compatible • NodeJS learning CommonJS APIs thanks to CommonNode
  107. 107. CommonJS: HappeningsKey platforms are converging: • RingoJS, GPSEE and V8CGI increasingly compatible • NodeJS learning CommonJS APIs thanks to CommonNodeModule loaders becoming multi-platform capable:
  108. 108. CommonJS: HappeningsKey platforms are converging: • RingoJS, GPSEE and V8CGI increasingly compatible • NodeJS learning CommonJS APIs thanks to CommonNodeModule loaders becoming multi-platform capable: • RequireJS (Browser, Rhino, NodeJS)
  109. 109. CommonJS: HappeningsKey platforms are converging: • RingoJS, GPSEE and V8CGI increasingly compatible • NodeJS learning CommonJS APIs thanks to CommonNodeModule loaders becoming multi-platform capable: • RequireJS (Browser, Rhino, NodeJS) • PINF (Browser, NodeJS, V8CGI, GPSEE, RingoJS, Narwhal, Jetpack, Titanium, AdobeAir)
  110. 110. CommonJS: HappeningsKey platforms are converging: • RingoJS, GPSEE and V8CGI increasingly compatible • NodeJS learning CommonJS APIs thanks to CommonNodeModule loaders becoming multi-platform capable: • RequireJS (Browser, Rhino, NodeJS) • PINF (Browser, NodeJS, V8CGI, GPSEE, RingoJS, Narwhal, Jetpack, Titanium, AdobeAir)Module loaders implementing Packages/Mappings:
  111. 111. CommonJS: HappeningsKey platforms are converging: • RingoJS, GPSEE and V8CGI increasingly compatible • NodeJS learning CommonJS APIs thanks to CommonNodeModule loaders becoming multi-platform capable: • RequireJS (Browser, Rhino, NodeJS) • PINF (Browser, NodeJS, V8CGI, GPSEE, RingoJS, Narwhal, Jetpack, Titanium, AdobeAir)Module loaders implementing Packages/Mappings: • Nodules (Async loading: NodeJS)
  112. 112. CommonJS: HappeningsKey platforms are converging: • RingoJS, GPSEE and V8CGI increasingly compatible • NodeJS learning CommonJS APIs thanks to CommonNodeModule loaders becoming multi-platform capable: • RequireJS (Browser, Rhino, NodeJS) • PINF (Browser, NodeJS, V8CGI, GPSEE, RingoJS, Narwhal, Jetpack, Titanium, AdobeAir)Module loaders implementing Packages/Mappings: • Nodules (Async loading: NodeJS) • PINF (Async loading: NodeJS, Static loading: other platforms)
  113. 113. CommonJS: HappeningsKey platforms are converging: • RingoJS, GPSEE and V8CGI increasingly compatible • NodeJS learning CommonJS APIs thanks to CommonNodeModule loaders becoming multi-platform capable: • RequireJS (Browser, Rhino, NodeJS) • PINF (Browser, NodeJS, V8CGI, GPSEE, RingoJS, Narwhal, Jetpack, Titanium, AdobeAir)Module loaders implementing Packages/Mappings: • Nodules (Async loading: NodeJS) • PINF (Async loading: NodeJS, Static loading: other platforms)Package repositories with package managers:
  114. 114. CommonJS: HappeningsKey platforms are converging: • RingoJS, GPSEE and V8CGI increasingly compatible • NodeJS learning CommonJS APIs thanks to CommonNodeModule loaders becoming multi-platform capable: • RequireJS (Browser, Rhino, NodeJS) • PINF (Browser, NodeJS, V8CGI, GPSEE, RingoJS, Narwhal, Jetpack, Titanium, AdobeAir)Module loaders implementing Packages/Mappings: • Nodules (Async loading: NodeJS) • PINF (Async loading: NodeJS, Static loading: other platforms)Package repositories with package managers: • NodeJS Package Registry via NPM
  115. 115. CommonJS: HappeningsKey platforms are converging: • RingoJS, GPSEE and V8CGI increasingly compatible • NodeJS learning CommonJS APIs thanks to CommonNodeModule loaders becoming multi-platform capable: • RequireJS (Browser, Rhino, NodeJS) • PINF (Browser, NodeJS, V8CGI, GPSEE, RingoJS, Narwhal, Jetpack, Titanium, AdobeAir)Module loaders implementing Packages/Mappings: • Nodules (Async loading: NodeJS) • PINF (Async loading: NodeJS, Static loading: other platforms)Package repositories with package managers: • NodeJS Package Registry via NPM • Dojo Foundation Package Repository via CPM
  116. 116. CommonJS: HappeningsKey platforms are converging: • RingoJS, GPSEE and V8CGI increasingly compatible • NodeJS learning CommonJS APIs thanks to CommonNodeModule loaders becoming multi-platform capable: • RequireJS (Browser, Rhino, NodeJS) • PINF (Browser, NodeJS, V8CGI, GPSEE, RingoJS, Narwhal, Jetpack, Titanium, AdobeAir)Module loaders implementing Packages/Mappings: • Nodules (Async loading: NodeJS) • PINF (Async loading: NodeJS, Static loading: other platforms)Package repositories with package managers: • NodeJS Package Registry via NPM • Dojo Foundation Package Repository via CPM • CommonJS package URLs and paths via PINF
  117. 117. What is the ultimateCommonJS Everywhere Goal?
  118. 118. How close are we?
  119. 119. How close are we?12 to 24 months!
  120. 120. How close are we?12 to 24 months! IF
  121. 121. How close are we?12 to 24 months! IF We embrace portableloaders such as PINF andagree on low-level APIs
  122. 122. PINF JavaScript Loader
  123. 123. PINF JavaScript Loader• Loads multiple module source formats:
  124. 124. PINF JavaScript Loader• Loads multiple module source formats: • Asynchronous Module Definition (AMD)
  125. 125. PINF JavaScript Loader• Loads multiple module source formats: • Asynchronous Module Definition (AMD) • CommonJS Modules 1.1
  126. 126. PINF JavaScript Loader• Loads multiple module source formats: • Asynchronous Module Definition (AMD) • CommonJS Modules 1.1 • CommonJS Modules 2.0 (draft)
  127. 127. PINF JavaScript Loader• Loads multiple module source formats: • Asynchronous Module Definition (AMD) • CommonJS Modules 1.1 • CommonJS Modules 2.0 (draft) • Plain JavaScript files
  128. 128. PINF JavaScript Loader• Loads multiple module source formats: • Asynchronous Module Definition (AMD) • CommonJS Modules 1.1 • CommonJS Modules 2.0 (draft) • Plain JavaScript files• Dynamically downloads and resolves dependencies
  129. 129. PINF JavaScript Loader• Loads multiple module source formats: • Asynchronous Module Definition (AMD) • CommonJS Modules 1.1 • CommonJS Modules 2.0 (draft) • Plain JavaScript files• Dynamically downloads and resolves dependencies• Runs an identical CommonJS package on many platforms for development and production:
  130. 130. PINF JavaScript Loader• Loads multiple module source formats: • Asynchronous Module Definition (AMD) • CommonJS Modules 1.1 • CommonJS Modules 2.0 (draft) • Plain JavaScript files• Dynamically downloads and resolves dependencies• Runs an identical CommonJS package on many platforms for development and production: • Browser, NodeJS, V8CGI, GPSEE, RingoJS, Narwhal, Jetpack, Titanium, AdobeAir (platform and API support varies)
  131. 131. PINF JavaScript Loader• Loads multiple module source formats: • Asynchronous Module Definition (AMD) • CommonJS Modules 1.1 • CommonJS Modules 2.0 (draft) • Plain JavaScript files• Dynamically downloads and resolves dependencies• Runs an identical CommonJS package on many platforms for development and production: • Browser, NodeJS, V8CGI, GPSEE, RingoJS, Narwhal, Jetpack, Titanium, AdobeAir (platform and API support varies)• Can load CommonJS programs and export static bundle (inlined modules) based programs for running in Browser via BravoJS (multiple platforms and loaders coming soon)
  132. 132. PINF JavaScript Loader
  133. 133. PINF JavaScript LoaderTypes of applications:
  134. 134. PINF JavaScript LoaderTypes of applications: • Browser: Websites and application user interfaces (web views)
  135. 135. PINF JavaScript LoaderTypes of applications: • Browser: Websites and application user interfaces (web views) • NodeJS: Asynchronous network programs
  136. 136. PINF JavaScript LoaderTypes of applications: • Browser: Websites and application user interfaces (web views) • NodeJS: Asynchronous network programs • V8CGI: PHP-like server apps (via Apache module/CGI)
  137. 137. PINF JavaScript LoaderTypes of applications: • Browser: Websites and application user interfaces (web views) • NodeJS: Asynchronous network programs • V8CGI: PHP-like server apps (via Apache module/CGI) • GPSEE: JS scripting for C apps
  138. 138. PINF JavaScript LoaderTypes of applications: • Browser: Websites and application user interfaces (web views) • NodeJS: Asynchronous network programs • V8CGI: PHP-like server apps (via Apache module/CGI) • GPSEE: JS scripting for C apps • RingoJS: JS scripting for Java apps
  139. 139. PINF JavaScript LoaderTypes of applications: • Browser: Websites and application user interfaces (web views) • NodeJS: Asynchronous network programs • V8CGI: PHP-like server apps (via Apache module/CGI) • GPSEE: JS scripting for C apps • RingoJS: JS scripting for Java apps • Narwhal: JS scripting for Mac OS X apps via JavaScriptCore
  140. 140. PINF JavaScript LoaderTypes of applications: • Browser: Websites and application user interfaces (web views) • NodeJS: Asynchronous network programs • V8CGI: PHP-like server apps (via Apache module/CGI) • GPSEE: JS scripting for C apps • RingoJS: JS scripting for Java apps • Narwhal: JS scripting for Mac OS X apps via JavaScriptCore • Jetpack: Restartless Firefox extensions
  141. 141. PINF JavaScript LoaderTypes of applications: • Browser: Websites and application user interfaces (web views) • NodeJS: Asynchronous network programs • V8CGI: PHP-like server apps (via Apache module/CGI) • GPSEE: JS scripting for C apps • RingoJS: JS scripting for Java apps • Narwhal: JS scripting for Mac OS X apps via JavaScriptCore • Jetpack: Restartless Firefox extensions • Titanium: Native mobile, tablet and desktop apps
  142. 142. PINF JavaScript LoaderTypes of applications: • Browser: Websites and application user interfaces (web views) • NodeJS: Asynchronous network programs • V8CGI: PHP-like server apps (via Apache module/CGI) • GPSEE: JS scripting for C apps • RingoJS: JS scripting for Java apps • Narwhal: JS scripting for Mac OS X apps via JavaScriptCore • Jetpack: Restartless Firefox extensions • Titanium: Native mobile, tablet and desktop apps • AdobeAir: Mobile, desktop and TV apps
  143. 143. PINF JavaScript LoaderTypes of applications: • Browser: Websites and application user interfaces (web views) • NodeJS: Asynchronous network programs • V8CGI: PHP-like server apps (via Apache module/CGI) • GPSEE: JS scripting for C apps • RingoJS: JS scripting for Java apps • Narwhal: JS scripting for Mac OS X apps via JavaScriptCore • Jetpack: Restartless Firefox extensions • Titanium: Native mobile, tablet and desktop apps • AdobeAir: Mobile, desktop and TV apps • Wakanda: COMING SOON
  144. 144. PINF JavaScript LoaderTypes of applications: • Browser: Websites and application user interfaces (web views) • NodeJS: Asynchronous network programs • V8CGI: PHP-like server apps (via Apache module/CGI) • GPSEE: JS scripting for C apps • RingoJS: JS scripting for Java apps • Narwhal: JS scripting for Mac OS X apps via JavaScriptCore • Jetpack: Restartless Firefox extensions • Titanium: Native mobile, tablet and desktop apps • AdobeAir: Mobile, desktop and TV apps • Wakanda: COMING SOONLow-level API standards needed!
  145. 145. PINF JavaScript Loader Demos
  146. 146. Cross-platform ‘Hello World’time commonjs --platform node ./HelloWorld Hello World real 0m0.157stime commonjs --platform v8cgi ./HelloWorld Hello World real 0m0.089s <--time commonjs --platform gpsee ./HelloWorld Hello World real 0m0.071s <--time commonjs --platform ringo ./HelloWorld Hello World real 0m1.796stime commonjs --platform narwhal ./HelloWorld Hello World real 0m2.246s
  147. 147. Cross-platform benchmarkstime commonjs --platform node ./JSLintBenchmarkRunning JSLint Benchmark by running JSLint against itself ...... took: 0.874 secondsreal 0m1.675suser 0m1.578ssys 0m0.055stime commonjs --platform v8cgi ./JSLintBenchmarkRunning JSLint Benchmark by running JSLint against itself ...... took: 0.238 secondsreal 0m0.622suser 0m0.463ssys 0m0.033s Google Chrome: 0.179 Firefox: 0.533
  148. 148. Develop; integrate; deploy Production Application Standalone DevUI Framework Integration
  149. 149. Parting Suggestions
  150. 150. Parting Suggestions1. Use packages to hold modules
  151. 151. Parting Suggestions1. Use packages to hold modules2. Store packages by their URI:
  152. 152. Parting Suggestions1. Use packages to hold modules2. Store packages by their URI: ~/packages/<URI_NO_PROTOCOL>/<REVISION> ~/packages/github.com/commonjs/stdlib/zipball/v0.1.0 (dev & prod) ~/packages/github.com/commonjs/stdlib/master (dev only)
  153. 153. Parting Suggestions1. Use packages to hold modules2. Store packages by their URI: ~/packages/<URI_NO_PROTOCOL>/<REVISION> ~/packages/github.com/commonjs/stdlib/zipball/v0.1.0 (dev & prod) ~/packages/github.com/commonjs/stdlib/master (dev only)3. Define dependencies via mappings in package.json
  154. 154. Parting Suggestions1. Use packages to hold modules2. Store packages by their URI: ~/packages/<URI_NO_PROTOCOL>/<REVISION> ~/packages/github.com/commonjs/stdlib/zipball/v0.1.0 (dev & prod) ~/packages/github.com/commonjs/stdlib/master (dev only)3. Define dependencies via mappings in package.json4. Use and support module loaders and package managers that support not only modules and packages, but also mappings
  155. 155. Parting Suggestions1. Use packages to hold modules2. Store packages by their URI: ~/packages/<URI_NO_PROTOCOL>/<REVISION> ~/packages/github.com/commonjs/stdlib/zipball/v0.1.0 (dev & prod) ~/packages/github.com/commonjs/stdlib/master (dev only)3. Define dependencies via mappings in package.json4. Use and support module loaders and package managers that support not only modules and packages, but also mappingsThis will allow you to SWAP OUT PACKAGES depending on the environment your application is running in WITHOUT HAVING TO WORRY ABOUT CONFLICTS. EVER!
  156. 156. Thank you! Big applause for the Community!Slides and links will be made available at:http://bit.ly/commonjs-everywhere

×