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.
4. CommonJS Everywhere
What does CommonJS Everywhere mean?
Being able to run CommonJS
compliant code in all areas a system.
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. 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?
9. JavaScript Everywhere
• All too familiar with Browsers
• Have heard of Server Side JavaScript (thanks to NodeJS)
10. JavaScript Everywhere
• All too familiar with Browsers
• Have heard of Server Side JavaScript (thanks to NodeJS)
• Know about Firebug a Firefox Extension
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. 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. 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. 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. 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. 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. 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. 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. 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?
23. JavaScript Everywhere
All these (and many more) platforms:
• Allow us to run JavaScript everywhere
• Maintained by passionate authors and contributors
24. JavaScript Everywhere
All these (and many more) platforms:
• Allow us to run JavaScript everywhere
• Maintained by passionate authors and contributors
• Have energetic and loyal userbases
25. JavaScript Everywhere
All 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. JavaScript Everywhere
All 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. JavaScript Everywhere
All 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. JavaScript Everywhere
All 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!
32. JavaScript Everywhere
BUT all these (and many more) platforms also lack:
• A compatible standard library
(Binary, IO, File, Socket, Event, System, ...)
33. JavaScript Everywhere
BUT 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. JavaScript Everywhere
BUT 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. JavaScript Everywhere
BUT 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. JavaScript Everywhere
BUT 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!
43. CommonJS: What
• Group of volunteers from many different projects
• Want to: use JavaScript & share code
44. CommonJS: What
• Group of volunteers from many different projects
• Want to: use JavaScript & share code
• A Mailing List
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. 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. 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. 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. 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
55. CommonJS: API Process
How 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. CommonJS: API Process
How 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. CommonJS: API Process
How 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. CommonJS: API Process
How 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. CommonJS: API Process
How 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. CommonJS: API Process
How 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. CommonJS: API Process
How 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. CommonJS: API Process
How 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. CommonJS: API Process
How 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. CommonJS: API Process
How 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
Take pride in helping CommonJS move forward!
69. CommonJS: Standards
What makes a CommonJS specification ratified?
1. A proposal
2. Sufficient discussions
3. Group consensus
70. CommonJS: Standards
What makes a CommonJS specification ratified?
1. A proposal
2. Sufficient discussions
3. Group consensus
4. Draft specification
71. CommonJS: Standards
What 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. CommonJS: Standards
What 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. CommonJS: Standards
What 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. CommonJS: Standards
What 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
Is it worth it?
75. CommonJS: Standards
What 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
Is it worth it?
Absolutely!
81. CommonJS: Status
Where is CommonJS at?
• Modules 1.1/1.1.1 (RATIFIED) MANY implementations YAY!
• Packages 1.0 (RATIFIED) 1.1 in the works
82. CommonJS: Status
Where 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. CommonJS: Status
Where 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. CommonJS: Status
Where 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. CommonJS: Status
Where 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. CommonJS: Status
Where 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
Sufficient for CommonJS Everywhere?
87. CommonJS: Status
Where 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
Sufficient for CommonJS Everywhere?
Unfortunately NO :(
88. CommonJS: Status
Where 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
Sufficient for CommonJS Everywhere?
Unfortunately NO :(
What is needed?
91. CommonJS: Needed
What do we need for CommonJS Everywhere?
• Portable unit tests for specifications
92. CommonJS: Needed
What do we need for CommonJS Everywhere?
• Portable unit tests for specifications
• Move to Github for specifications and tests
93. CommonJS: Needed
What 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. CommonJS: Needed
What 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. CommonJS: Needed
What 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. CommonJS: Needed
What 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)
98. CommonJS: Needed
What 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. CommonJS: Needed
What 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. CommonJS: Needed
What 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. CommonJS: Needed
What 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. CommonJS: Needed
What 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
What is happening in this regard?
140. PINF JavaScript Loader
Types of applications:
• Browser: Websites and application user interfaces (web views)
• NodeJS: Asynchronous network programs
141. PINF JavaScript Loader
Types of applications:
• Browser: Websites and application user interfaces (web views)
• NodeJS: Asynchronous network programs
• V8CGI: PHP-like server apps (via Apache module/CGI)
142. PINF JavaScript Loader
Types 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
143. PINF JavaScript Loader
Types 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
144. PINF JavaScript Loader
Types 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
145. PINF JavaScript Loader
Types 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
146. PINF JavaScript Loader
Types 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
147. PINF JavaScript Loader
Types 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
148. PINF JavaScript Loader
Types 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
149. PINF JavaScript Loader
Types 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
Low-level API standards needed!
151. Cross-platform ‘Hello World’
time commonjs --platform node ./HelloWorld
Hello World
real 0m0.157s
time 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.796s
time commonjs --platform narwhal ./HelloWorld
Hello World
real 0m2.246s
152. Cross-platform benchmarks
time commonjs --platform node ./JSLintBenchmark
Running JSLint Benchmark by running JSLint against itself ...
... took: 0.874 seconds
real 0m1.675s
user 0m1.578s
sys 0m0.055s
time commonjs --platform v8cgi ./JSLintBenchmark
Running JSLint Benchmark by running JSLint against itself ...
... took: 0.238 seconds
real 0m0.622s
user 0m0.463s
sys 0m0.033s
Google Chrome: 0.179 Firefox: 0.533
157. Parting Suggestions
1. Use packages to hold modules
2. 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)
158. Parting Suggestions
1. Use packages to hold modules
2. 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
159. Parting Suggestions
1. Use packages to hold modules
2. 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
4. Use and support module loaders and package managers that
support not only modules and packages, but also mappings
160. Parting Suggestions
1. Use packages to hold modules
2. 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
4. Use and support module loaders and package managers that
support not only modules and packages, but also mappings
This will allow you to SWAP OUT PACKAGES depending on
the environment your application is running in WITHOUT
HAVING TO WORRY ABOUT CONFLICTS. EVER!
161. Thank you!
Big applause for the
Community!
Slides and links will be made available at:
http://bit.ly/commonjs-everywhere