Make WordPress Core


Ignore:
Timestamp:
02/13/2014 07:33:29 AM (11 years ago)
Author:
nacin
Message:

Update Backbone from 1.0 to 1.1.

Also update Underscore to 1.6. Includes the development versions of both, which are not included in the build.

Here is Backbone's changelog:

  • Made the return values of Collection’s set, add, remove, and reset more useful. Instead of returning this, they now return the changed (added, removed or updated) model or list of

models. (This means they can no longer be chained.)

  • Backbone Views no longer automatically attach options passed to the constructor as this.options and Backbone Models no longer attach url and urlRoot options, but you can do it yourself if you prefer. (But if you extend wp.Backbone.View, options will be attached for you.)
  • All "invalid" events now pass consistent arguments. First the model in question, then the error object, then options.
  • You are no longer permitted to change the id of your model during parse. Use idAttribute instead.
  • On the other hand, parse is now an excellent place to extract and vivify incoming nested JSON into associated submodels.

See [27171] (next commit) for changes made to WordPress to be compatible with Backbone 1.1.

props gcorne, georgestephanis.
see #26799.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/script-loader.php

    r27111 r27170  
    5151    include ABSPATH . WPINC . '/version.php'; // include an unmodified $wp_version
    5252
    53     if ( ! defined( 'SCRIPT_DEBUG' ) )
    54         define( 'SCRIPT_DEBUG', false !== strpos( $wp_version, '-src' ) );
     53    $develop_src = false !== strpos( $wp_version, '-src' );
     54
     55    if ( ! defined( 'SCRIPT_DEBUG' ) ) {
     56        define( 'SCRIPT_DEBUG', $develop_src );
     57    }
    5558
    5659    if ( ! $guessurl = site_url() ) {
     
    6568
    6669    $suffix = SCRIPT_DEBUG ? '' : '.min';
     70    $dev_suffix = $develop_src ? '' : '.min';
    6771
    6872    $scripts->add( 'utils', "/wp-includes/js/utils$suffix.js" );
     
    271275    $scripts->add( 'json2', "/wp-includes/js/json2$suffix.js", array(), '2011-02-23');
    272276
    273     $scripts->add( 'underscore', '/wp-includes/js/underscore.min.js', array(), '1.4.4', 1 );
    274     $scripts->add( 'backbone', '/wp-includes/js/backbone.min.js', array('underscore','jquery'), '1.0.0', 1 );
     277    $scripts->add( 'underscore', "/wp-includes/js/underscore$dev_suffix.js", array(), '1.6.0', 1 );
     278    $scripts->add( 'backbone', "/wp-includes/js/backbone$dev_suffix.js", array( 'underscore','jquery' ), '1.1.0', 1 );
    275279
    276280    $scripts->add( 'wp-util', "/wp-includes/js/wp-util$suffix.js", array('underscore', 'jquery'), false, 1 );
Note: See TracChangeset for help on using the changeset viewer.