Make WordPress Core

Changeset 48075


Ignore:
Timestamp:
06/17/2020 05:38:40 PM (5 years ago)
Author:
SergeyBiryukov
Message:

External Libraries: Update Moment.js to 2.26.0.

Changelog: https://github.com/moment/moment/compare/2.22.2...2.26.0

This commit also fixes a deprecation warning regarding the usage of moment.locale() to set locale properties.

As of Moment.js 2.12.0, moment.locale() is deprecated and moment.updateLocale() should be used instead.

Additionally, minimize moment.js as part of build process to remove the source map reference.

This avoids a sourceMappingURL being in the minified file, as we don't ship source maps.

Props yoancutillas, SergeyBiryukov.
Fixes #50408.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Gruntfile.js

    r47771 r48075  
    748748                src: WORKING_DIR + 'wp-includes/js/jquery/jquery.form.js',
    749749                dest: WORKING_DIR + 'wp-includes/js/jquery/jquery.form.min.js'
     750            },
     751            moment: {
     752                src: WORKING_DIR + 'wp-includes/js/dist/vendor/moment.js',
     753                dest: WORKING_DIR + 'wp-includes/js/dist/vendor/moment.min.js'
    750754            },
    751755            dynamic: {
     
    12231227        'uglify:imgareaselect',
    12241228        'uglify:jqueryform',
     1229        'uglify:moment',
    12251230        'qunit:compiled'
    12261231    ] );
     
    13631368        'uglify:jqueryui',
    13641369        'uglify:imgareaselect',
    1365         'uglify:jqueryform'
     1370        'uglify:jqueryform',
     1371        'uglify:moment'
    13661372    ] );
    13671373
  • trunk/package-lock.json

    r48048 r48075  
    1721417214        },
    1721517215        "moment": {
    17216             "version": "2.22.2",
    17217             "resolved": "https://registry.npmjs.org/moment/-/moment-2.22.2.tgz",
    17218             "integrity": "sha1-PCV/mDn8DpP/UxSWMiOeuQeD/2Y="
     17216            "version": "2.26.0",
     17217            "resolved": "https://registry.npmjs.org/moment/-/moment-2.26.0.tgz",
     17218            "integrity": "sha512-oIixUO+OamkUkwjhAVE18rAMfRJNsNe/Stid/gwHSOfHrOtw9EhAY2AHvdKZ/k/MggcYELFCJz/Sn2pL8b8JMw=="
    1721917219        },
    1722017220        "moment-timezone": {
  • trunk/package.json

    r48048 r48075  
    137137        "lodash": "4.17.15",
    138138        "masonry-layout": "4.2.2",
    139         "moment": "2.22.2",
     139        "moment": "2.26.0",
    140140        "polyfill-library": "3.42.0",
    141141        "react": "16.9.0",
  • trunk/src/wp-includes/script-loader.php

    r48067 r48075  
    9696        'react'                       => '16.9.0',
    9797        'react-dom'                   => '16.9.0',
    98         'moment'                      => '2.22.2',
     98        'moment'                      => '2.26.0',
    9999        'lodash'                      => '4.17.15',
    100100        'wp-polyfill-fetch'           => '3.0.0',
     
    140140        'moment',
    141141        sprintf(
    142             "moment.locale( '%s', %s );",
     142            "moment.updateLocale( '%s', %s );",
    143143            get_user_locale(),
    144144            wp_json_encode(
Note: See TracChangeset for help on using the changeset viewer.