[wp-trac] [WordPress Trac] #34350: Update Backbone to 1.2.3 and Underscore to 1.8.3

WordPress Trac noreply at wordpress.org
Thu Jan 14 23:27:25 UTC 2016


#34350: Update Backbone to 1.2.3 and Underscore to 1.8.3
----------------------------------+------------------------------
 Reporter:  caseypatrickdriscoll  |       Owner:  adamsilverstein
     Type:  enhancement           |      Status:  assigned
 Priority:  normal                |   Milestone:  4.5
Component:  External Libraries    |     Version:  4.4
 Severity:  normal                |  Resolution:
 Keywords:                        |     Focuses:  javascript
----------------------------------+------------------------------

Comment (by adamsilverstein):

 I verified this is due to a change in Underscore's _flatten function.

 wp.Backbone.Subviews keeps track of all the views you add to a parent
 view. the subviews are tracked by their DOM element id or a blank string
 if they aren't stored against an ID. On the revisions page that looks like
 this:

 [[Image(http://cl.ly/2P103C2s3X38/Revisions__test__WordPress_2016-01-14_16-19-50.jpg)]]

 I wrote a tiny bit of test code to see what happens when I _.flatten an
 array that is indexed with a blank string.

 With Underscore.js 1.6.0 I get:

 [[Image(http://cl.ly/1k0a4647252e/Revisions__test__WordPress_2016-01-14_16-18-16.jpg)]]

 After upgrading to Underscore.js 1.8.3 I get:

 [[Image(http://cl.ly/241L3S1p2t1z/Revisions__test__WordPress_2016-01-14_16-18-39.jpg)]]

 This breaks the way wp.backbone.Views/Subviews stores views.

 I'm going to keep digging to see if this is a is an intentional change in
 Underscore or a bug.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34350#comment:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list