Last modified: 2014-11-10 23:38:45 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T58977, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 56977 - OOjs: Split core utilities up into object-specific singletons
OOjs: Split core utilities up into object-specific singletons
Status: RESOLVED WONTFIX
Product: OOjs
Classification: Unclassified
General (Other open bugs)
unspecified
All All
: Lowest enhancement
: ---
Assigned To: Editing team bugs – take if you're interested!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-13 00:24 UTC by Krinkle
Modified: 2014-11-10 23:38 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Krinkle 2013-11-13 00:24:24 UTC
So instead of:

oo.extendObject
oo.isPlainObject
oo.cloneObject
oo.getObjectKeys
oo.getObjectValues
oo.simpleArrayUnion
We'd have:

oo.Object.extend
oo.Object.isPlain
oo.Object.clone
oo.Object.keys (obsolete, ES5 has Object.keys)
oo.Object.values
oo.Array.quickUnion (or something like that)
More like YUI for example, as well as like methods in javascript itself.


---
Migrated from https://github.com/trevorparscal/oojs/issues/23
Comment 1 Krinkle 2014-03-13 17:50:55 UTC
Not actually sure we want to do this. It's an interesting idea, but not worth breaking the API for, and considering the minimal size of the library, keeping this back-compat would be a fair amount of code.

Hopefully, the OOjs API will become smaller as time goes on when we start adopting more ES5 feature, and use global es5 shims for older browsers instead of aliases in other host objects (like jQuery.trim, jQuery.proxy, ve.indexOf and OO.getObjectkeys; instead of String#trim, Function#bind, Array#indexOf and Object.keys)
Comment 2 Krinkle 2014-11-10 23:38:45 UTC
This is nice for a framework design, but for OOjs. We use native methods instead, more with es5-shim. We don't need many utility methods or an extendable base like that.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links