[wp-trac] [WordPress Trac] #26870: Add (JSDoc)umentation to the Backbone-centric Media files
WordPress Trac
noreply at wordpress.org
Sat Jan 18 23:09:44 UTC 2014
#26870: Add (JSDoc)umentation to the Backbone-centric Media files
------------------------------------+------------------
Reporter: wonderboymusic | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: 3.9
Component: Media | Version: 3.5
Severity: normal | Resolution:
Keywords: needs-patch needs-docs |
------------------------------------+------------------
Comment (by wonderboymusic):
[attachment:26870-media-views.diff 26870-media-views.diff] is a first pass
at documenting `src/wp-includes/js/media-views.js`. It would be an
understatement to say I almost blacked out several times chasing down all
of the chains of inheritance. There is still more to document, but I think
this could go in for a base to work from.
Notes:
- THE most important thing is the inheritance chain of each class with a
constructor. Many of them inherit from classes 6 levels deep and mix-in
`wp.media.controller.StateMachine` just for laughs. This classes are
marked with `@constructor` and the classes in the inheritance chain are
noted annotated with `@augments`
- The next most important step for a lot of this code is documenting
`this` inside of instance methods with the `@this` annotation. This is by
far the most confusing aspect of a lot of the code.
- `wp.media.controller.State` is basically an abstract class that many of
these classes are intertwined with.
- `wp.media.controller.Region` provides a lot of the black voodoo that
triggers custom events
Anyways - more to be done.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/26870#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list