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.
CommonJS Everywhere
CommonJS Everywhere
 What does CommonJS Everywhere mean?
CommonJS Everywhere
 What does CommonJS Everywhere mean?

   Being able to run CommonJS
compliant code in all areas a system.
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!
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?
JavaScript Everywhere
JavaScript Everywhere
• All too familiar with Browsers
JavaScript Everywhere
• All too familiar with Browsers
• Have heard of Server Side JavaScript (thanks to NodeJS)
JavaScript Everywhere
• All too familiar with Browsers
• Have heard of Server Side JavaScript (thanks to NodeJS)
• Know about Firebug a Firefox Extension
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
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)
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
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
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
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
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
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
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?
JavaScript Everywhere
JavaScript Everywhere
All these (and many more) platforms:
JavaScript Everywhere
All these (and many more) platforms:

• Allow us to run JavaScript everywhere
JavaScript Everywhere
All these (and many more) platforms:

• Allow us to run JavaScript everywhere
• Maintained by passionate authors and contributors
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
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
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
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
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!
JavaScript Everywhere
JavaScript Everywhere
BUT all these (and many more) platforms also lack:
JavaScript Everywhere
BUT all these (and many more) platforms also lack:

• A compatible standard library
JavaScript Everywhere
BUT all these (and many more) platforms also lack:

• A compatible standard library
    (Binary, IO, File, Socket, Event, System, ...)
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
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
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
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!
JavaScript Everywhere
JavaScript Everywhere
BUT there is a solution:
JavaScript Everywhere
BUT there is a solution:



         CommonJS!
JavaScript Everywhere
BUT there is a solution:



         CommonJS!
         What is CommonJS?
CommonJS: What
CommonJS: What
• Group of volunteers from many different projects
CommonJS: What
• Group of volunteers from many different projects
  • Want to: use JavaScript & share code
CommonJS: What
• Group of volunteers from many different projects
  • Want to: use JavaScript & share code
• A Mailing List
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
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
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
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!
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
What does it look like?
What does it look like?
CommonJS: API Process
CommonJS: API Process
How does the CommonJS API proposal process work?
CommonJS: API Process
How does the CommonJS API proposal process work?

 1. You pick a JS platform
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
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:
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
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:
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
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
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
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
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
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!
CommonJS: Standards
CommonJS: Standards
What makes a CommonJS specification ratified?
CommonJS: Standards
What makes a CommonJS specification ratified?

 1. A proposal
CommonJS: Standards
What makes a CommonJS specification ratified?

 1. A proposal
 2. Sufficient discussions
CommonJS: Standards
What makes a CommonJS specification ratified?

 1. A proposal
 2. Sufficient discussions
 3. Group consensus
CommonJS: Standards
What makes a CommonJS specification ratified?

 1. A proposal
 2. Sufficient discussions
 3. Group consensus
 4. Draft specification
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
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
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
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?
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!
CommonJS: The Result
CommonJS: The Result

  Modules, Packages &
   Platforms targeting
 CommonJS compliance
 are truly interoperable!
CommonJS: Status
CommonJS: Status
Where is CommonJS at?
CommonJS: Status
Where is CommonJS at?

 • Modules 1.1/1.1.1 (RATIFIED) MANY implementations YAY!
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
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
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
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
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
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?
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 :(
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?
CommonJS: Needed
CommonJS: Needed
What do we need for CommonJS Everywhere?
CommonJS: Needed
What do we need for CommonJS Everywhere?
 • Portable unit tests for specifications
CommonJS: Needed
What do we need for CommonJS Everywhere?
 • Portable unit tests for specifications
 • Move to Github for specifications and tests
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
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
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
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)
Packages/Mappings/C
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)
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
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
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
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?
CommonJS: Happenings
CommonJS: Happenings
Key platforms are converging:
CommonJS: Happenings
Key platforms are converging:
 • RingoJS, GPSEE and V8CGI increasingly compatible
CommonJS: Happenings
Key platforms are converging:
 • RingoJS, GPSEE and V8CGI increasingly compatible
 • NodeJS learning CommonJS APIs thanks to CommonNode
CommonJS: Happenings
Key platforms are converging:
 • RingoJS, GPSEE and V8CGI increasingly compatible
 • NodeJS learning CommonJS APIs thanks to CommonNode
Module loaders becoming multi-platform capable:
CommonJS: Happenings
Key platforms are converging:
 • RingoJS, GPSEE and V8CGI increasingly compatible
 • NodeJS learning CommonJS APIs thanks to CommonNode
Module loaders becoming multi-platform capable:
 • RequireJS (Browser, Rhino, NodeJS)
CommonJS: Happenings
Key platforms are converging:
 • RingoJS, GPSEE and V8CGI increasingly compatible
 • NodeJS learning CommonJS APIs thanks to CommonNode
Module loaders becoming multi-platform capable:
 • RequireJS (Browser, Rhino, NodeJS)
 • PINF (Browser, NodeJS, V8CGI, GPSEE, RingoJS, Narwhal, Jetpack, Titanium, AdobeAir)
CommonJS: Happenings
Key platforms are converging:
 • RingoJS, GPSEE and V8CGI increasingly compatible
 • NodeJS learning CommonJS APIs thanks to CommonNode
Module loaders becoming multi-platform capable:
 • RequireJS (Browser, Rhino, NodeJS)
 • PINF (Browser, NodeJS, V8CGI, GPSEE, RingoJS, Narwhal, Jetpack, Titanium, AdobeAir)
Module loaders implementing Packages/Mappings:
CommonJS: Happenings
Key platforms are converging:
 • RingoJS, GPSEE and V8CGI increasingly compatible
 • NodeJS learning CommonJS APIs thanks to CommonNode
Module 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)
CommonJS: Happenings
Key platforms are converging:
 • RingoJS, GPSEE and V8CGI increasingly compatible
 • NodeJS learning CommonJS APIs thanks to CommonNode
Module 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)
CommonJS: Happenings
Key platforms are converging:
 • RingoJS, GPSEE and V8CGI increasingly compatible
 • NodeJS learning CommonJS APIs thanks to CommonNode
Module 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:
CommonJS: Happenings
Key platforms are converging:
 • RingoJS, GPSEE and V8CGI increasingly compatible
 • NodeJS learning CommonJS APIs thanks to CommonNode
Module 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
CommonJS: Happenings
Key platforms are converging:
 • RingoJS, GPSEE and V8CGI increasingly compatible
 • NodeJS learning CommonJS APIs thanks to CommonNode
Module 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: Happenings
Key platforms are converging:
 • RingoJS, GPSEE and V8CGI increasingly compatible
 • NodeJS learning CommonJS APIs thanks to CommonNode
Module 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
What is the ultimate
CommonJS Everywhere
         Goal?
How close are we?
How close are we?
12 to 24 months!
How close are we?
12 to 24 months!
        IF
How close are we?
12 to 24 months!
           IF
   We embrace portable
loaders such as PINF and
agree on low-level APIs
PINF JavaScript Loader
PINF JavaScript Loader
• Loads multiple module source formats:
PINF JavaScript Loader
• Loads multiple module source formats:
 • Asynchronous Module Definition (AMD)
PINF JavaScript Loader
• Loads multiple module source formats:
 • Asynchronous Module Definition (AMD)
 • CommonJS Modules 1.1
PINF JavaScript Loader
• Loads multiple module source formats:
 • Asynchronous Module Definition (AMD)
 • CommonJS Modules 1.1
 • CommonJS Modules 2.0 (draft)
PINF JavaScript Loader
• Loads multiple module source formats:
 •   Asynchronous Module Definition (AMD)
 •   CommonJS Modules 1.1
 •   CommonJS Modules 2.0 (draft)
 •   Plain JavaScript files
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
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:
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)
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)
PINF JavaScript Loader
PINF JavaScript Loader
Types of applications:
PINF JavaScript Loader
Types of applications:
 • Browser: Websites and application user interfaces (web views)
PINF JavaScript Loader
Types of applications:
 • Browser: Websites and application user interfaces (web views)
 • NodeJS: Asynchronous network programs
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)
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
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
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
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
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
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
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
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!
PINF JavaScript Loader


      Demos
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
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
Develop; integrate; deploy
                           Production Application
    Standalone Dev




UI Framework Integration
Parting Suggestions
Parting Suggestions
1. Use packages to hold modules
Parting Suggestions
1. Use packages to hold modules
2. Store packages by their URI:
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)
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
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
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!
Thank you!


         Big applause for the
                  Community!


Slides and links will be made available at:


http://bit.ly/commonjs-everywhere

CommonJS Everywhere (Wakanday 2011)

  • 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.
  • 3.
    CommonJS Everywhere Whatdoes CommonJS Everywhere mean?
  • 4.
    CommonJS Everywhere Whatdoes 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?
  • 7.
  • 8.
    JavaScript Everywhere • Alltoo familiar with Browsers
  • 9.
    JavaScript Everywhere • Alltoo familiar with Browsers • Have heard of Server Side JavaScript (thanks to NodeJS)
  • 10.
    JavaScript Everywhere • Alltoo familiar with Browsers • Have heard of Server Side JavaScript (thanks to NodeJS) • Know about Firebug a Firefox Extension
  • 11.
    JavaScript Everywhere • Alltoo 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 • Alltoo 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 • Alltoo 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 • Alltoo 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 • Alltoo 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 • Alltoo 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 • Alltoo 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 • Alltoo 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 • Alltoo 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.
  • 21.
    JavaScript Everywhere All these(and many more) platforms:
  • 22.
    JavaScript Everywhere All these(and many more) platforms: • Allow us to run JavaScript everywhere
  • 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!
  • 29.
  • 30.
    JavaScript Everywhere BUT allthese (and many more) platforms also lack:
  • 31.
    JavaScript Everywhere BUT allthese (and many more) platforms also lack: • A compatible standard library
  • 32.
    JavaScript Everywhere BUT allthese (and many more) platforms also lack: • A compatible standard library (Binary, IO, File, Socket, Event, System, ...)
  • 33.
    JavaScript Everywhere BUT allthese (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 allthese (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 allthese (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 allthese (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.
  • 38.
  • 39.
    JavaScript Everywhere BUT thereis a solution: CommonJS!
  • 40.
    JavaScript Everywhere BUT thereis a solution: CommonJS! What is CommonJS?
  • 41.
  • 42.
    CommonJS: What • Groupof volunteers from many different projects
  • 43.
    CommonJS: What • Groupof volunteers from many different projects • Want to: use JavaScript & share code
  • 44.
    CommonJS: What • Groupof volunteers from many different projects • Want to: use JavaScript & share code • A Mailing List
  • 45.
    CommonJS: What • Groupof volunteers from many different projects • Want to: use JavaScript & share code • A Mailing List • A Wiki with specifications in various stages
  • 46.
    CommonJS: What • Groupof 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 • Groupof 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 • Groupof 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 • Groupof 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.
    What does itlook like?
  • 51.
    What does itlook like?
  • 52.
  • 53.
    CommonJS: API Process Howdoes the CommonJS API proposal process work?
  • 54.
    CommonJS: API Process Howdoes the CommonJS API proposal process work? 1. You pick a JS platform
  • 55.
    CommonJS: API Process Howdoes 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 Howdoes 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 Howdoes 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 Howdoes 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 Howdoes 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 Howdoes 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 Howdoes 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 Howdoes 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 Howdoes 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 Howdoes 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!
  • 65.
  • 66.
    CommonJS: Standards What makesa CommonJS specification ratified?
  • 67.
    CommonJS: Standards What makesa CommonJS specification ratified? 1. A proposal
  • 68.
    CommonJS: Standards What makesa CommonJS specification ratified? 1. A proposal 2. Sufficient discussions
  • 69.
    CommonJS: Standards What makesa CommonJS specification ratified? 1. A proposal 2. Sufficient discussions 3. Group consensus
  • 70.
    CommonJS: Standards What makesa CommonJS specification ratified? 1. A proposal 2. Sufficient discussions 3. Group consensus 4. Draft specification
  • 71.
    CommonJS: Standards What makesa 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 makesa 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 makesa 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 makesa 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 makesa 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!
  • 76.
  • 77.
    CommonJS: The Result Modules, Packages & Platforms targeting CommonJS compliance are truly interoperable!
  • 78.
  • 79.
  • 80.
    CommonJS: Status Where isCommonJS at? • Modules 1.1/1.1.1 (RATIFIED) MANY implementations YAY!
  • 81.
    CommonJS: Status Where isCommonJS at? • Modules 1.1/1.1.1 (RATIFIED) MANY implementations YAY! • Packages 1.0 (RATIFIED) 1.1 in the works
  • 82.
    CommonJS: Status Where isCommonJS 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 isCommonJS 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 isCommonJS 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 isCommonJS 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 isCommonJS 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 isCommonJS 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 isCommonJS 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?
  • 89.
  • 90.
    CommonJS: Needed What dowe need for CommonJS Everywhere?
  • 91.
    CommonJS: Needed What dowe need for CommonJS Everywhere? • Portable unit tests for specifications
  • 92.
    CommonJS: Needed What dowe need for CommonJS Everywhere? • Portable unit tests for specifications • Move to Github for specifications and tests
  • 93.
    CommonJS: Needed What dowe 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 dowe 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 dowe 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 dowe 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.
  • 98.
    CommonJS: Needed What dowe 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 dowe 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 dowe 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 dowe 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 dowe 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?
  • 103.
  • 104.
  • 105.
    CommonJS: Happenings Key platformsare converging: • RingoJS, GPSEE and V8CGI increasingly compatible
  • 106.
    CommonJS: Happenings Key platformsare converging: • RingoJS, GPSEE and V8CGI increasingly compatible • NodeJS learning CommonJS APIs thanks to CommonNode
  • 107.
    CommonJS: Happenings Key platformsare converging: • RingoJS, GPSEE and V8CGI increasingly compatible • NodeJS learning CommonJS APIs thanks to CommonNode Module loaders becoming multi-platform capable:
  • 108.
    CommonJS: Happenings Key platformsare converging: • RingoJS, GPSEE and V8CGI increasingly compatible • NodeJS learning CommonJS APIs thanks to CommonNode Module loaders becoming multi-platform capable: • RequireJS (Browser, Rhino, NodeJS)
  • 109.
    CommonJS: Happenings Key platformsare converging: • RingoJS, GPSEE and V8CGI increasingly compatible • NodeJS learning CommonJS APIs thanks to CommonNode Module loaders becoming multi-platform capable: • RequireJS (Browser, Rhino, NodeJS) • PINF (Browser, NodeJS, V8CGI, GPSEE, RingoJS, Narwhal, Jetpack, Titanium, AdobeAir)
  • 110.
    CommonJS: Happenings Key platformsare converging: • RingoJS, GPSEE and V8CGI increasingly compatible • NodeJS learning CommonJS APIs thanks to CommonNode Module 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.
    CommonJS: Happenings Key platformsare converging: • RingoJS, GPSEE and V8CGI increasingly compatible • NodeJS learning CommonJS APIs thanks to CommonNode Module 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.
    CommonJS: Happenings Key platformsare converging: • RingoJS, GPSEE and V8CGI increasingly compatible • NodeJS learning CommonJS APIs thanks to CommonNode Module 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.
    CommonJS: Happenings Key platformsare converging: • RingoJS, GPSEE and V8CGI increasingly compatible • NodeJS learning CommonJS APIs thanks to CommonNode Module 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.
    CommonJS: Happenings Key platformsare converging: • RingoJS, GPSEE and V8CGI increasingly compatible • NodeJS learning CommonJS APIs thanks to CommonNode Module 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.
    CommonJS: Happenings Key platformsare converging: • RingoJS, GPSEE and V8CGI increasingly compatible • NodeJS learning CommonJS APIs thanks to CommonNode Module 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.
    CommonJS: Happenings Key platformsare converging: • RingoJS, GPSEE and V8CGI increasingly compatible • NodeJS learning CommonJS APIs thanks to CommonNode Module 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.
    What is theultimate CommonJS Everywhere Goal?
  • 123.
  • 124.
    How close arewe? 12 to 24 months!
  • 125.
    How close arewe? 12 to 24 months! IF
  • 126.
    How close arewe? 12 to 24 months! IF We embrace portable loaders such as PINF and agree on low-level APIs
  • 127.
  • 128.
    PINF JavaScript Loader •Loads multiple module source formats:
  • 129.
    PINF JavaScript Loader •Loads multiple module source formats: • Asynchronous Module Definition (AMD)
  • 130.
    PINF JavaScript Loader •Loads multiple module source formats: • Asynchronous Module Definition (AMD) • CommonJS Modules 1.1
  • 131.
    PINF JavaScript Loader •Loads multiple module source formats: • Asynchronous Module Definition (AMD) • CommonJS Modules 1.1 • CommonJS Modules 2.0 (draft)
  • 132.
    PINF JavaScript Loader •Loads multiple module source formats: • Asynchronous Module Definition (AMD) • CommonJS Modules 1.1 • CommonJS Modules 2.0 (draft) • Plain JavaScript files
  • 133.
    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
  • 134.
    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:
  • 135.
    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)
  • 136.
    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)
  • 137.
  • 138.
  • 139.
    PINF JavaScript Loader Typesof applications: • Browser: Websites and application user interfaces (web views)
  • 140.
    PINF JavaScript Loader Typesof applications: • Browser: Websites and application user interfaces (web views) • NodeJS: Asynchronous network programs
  • 141.
    PINF JavaScript Loader Typesof 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 Typesof 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 Typesof 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 Typesof 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 Typesof 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 Typesof 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 Typesof 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 Typesof 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 Typesof 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!
  • 150.
  • 151.
    Cross-platform ‘Hello World’ timecommonjs --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
  • 153.
    Develop; integrate; deploy Production Application Standalone Dev UI Framework Integration
  • 154.
  • 155.
    Parting Suggestions 1. Usepackages to hold modules
  • 156.
    Parting Suggestions 1. Usepackages to hold modules 2. Store packages by their URI:
  • 157.
    Parting Suggestions 1. Usepackages 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. Usepackages 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. Usepackages 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. Usepackages 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