Jetpack/Collections: Difference between revisions

move deign to feekback
(move deign to feekback)
Line 32: Line 32:
* Other classes
* Other classes
** Pretty much anything that takes a list in Jetpack could be using this API, at least optionally.
** Pretty much anything that takes a list in Jetpack could be using this API, at least optionally.
= Design =
* The implementation will be clean code that doesn't add any properties to the JavaSript types' prototypes.
* The code will be documented using the [http://code.google.com/intl/en/closure/compiler/docs/js-for-compiler.html JSDoc conventions].
* What should be the [http://robertnyman.com/javascript/ JavaScript version and features] this module relies on? Relying on JavaScript 1.6 would make it possible to use the JavaScript Collections with Google Chrome V8 JavaScript engine as well and thus the JavaScript Collections module would be useful for more people for more context, and a developer using the JavaScript Collections for Jetpack could use it as-is on many other web projects. That would ease many developers' life.
* Leveraging [https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/WeakMap WeakMap] (available since Firefox 6 and should be available in Google Chrome 18) should be considered.


= Example =
= Example =
Line 66: Line 56:


(extract, full docs will be in module)
(extract, full docs will be in module)
The classes are standing alone, they do not change JS Array or Object types.


== Collection ==
== Collection ==
Line 247: Line 239:
   * @returns {Collection}
   * @returns {Collection}
   function sortColl(coll, sortFunc)
   function sortColl(coll, sortFunc)
= Design =
* The code will be documented using the [http://code.google.com/intl/en/closure/compiler/docs/js-for-compiler.html JSDoc conventions].


= Implementation =
= Implementation =
Line 268: Line 263:
== Naming ==
== Naming ==
The [https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Set Set] object is available in future versions of Firefox and thus this name should not be used.
The [https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Set Set] object is available in future versions of Firefox and thus this name should not be used.
== Compatibiltiy ==
* What should be the [http://robertnyman.com/javascript/ JavaScript version and features] this module relies on? Relying on JavaScript 1.6 would make it possible to use the JavaScript Collections with Google Chrome V8 JavaScript engine as well and thus the JavaScript Collections module would be useful for more people for more context, and a developer using the JavaScript Collections for Jetpack could use it as-is on many other web projects. That would ease many developers' life.
== weak references ==
* Leveraging [https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/WeakMap WeakMap] (available since Firefox 6 and should be available in Google Chrome 18) should be considered.
Confirmed users
596

edits