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. git-svn-id: https://develop.svn.wordpress.org/trunk@48075 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
6ce65a2207
commit
fbb42b017b
@ -748,6 +748,10 @@ module.exports = function(grunt) {
|
|||||||
src: WORKING_DIR + 'wp-includes/js/jquery/jquery.form.js',
|
src: WORKING_DIR + 'wp-includes/js/jquery/jquery.form.js',
|
||||||
dest: WORKING_DIR + 'wp-includes/js/jquery/jquery.form.min.js'
|
dest: WORKING_DIR + 'wp-includes/js/jquery/jquery.form.min.js'
|
||||||
},
|
},
|
||||||
|
moment: {
|
||||||
|
src: WORKING_DIR + 'wp-includes/js/dist/vendor/moment.js',
|
||||||
|
dest: WORKING_DIR + 'wp-includes/js/dist/vendor/moment.min.js'
|
||||||
|
},
|
||||||
dynamic: {
|
dynamic: {
|
||||||
expand: true,
|
expand: true,
|
||||||
cwd: WORKING_DIR,
|
cwd: WORKING_DIR,
|
||||||
@ -1222,6 +1226,7 @@ module.exports = function(grunt) {
|
|||||||
'jshint:corejs',
|
'jshint:corejs',
|
||||||
'uglify:imgareaselect',
|
'uglify:imgareaselect',
|
||||||
'uglify:jqueryform',
|
'uglify:jqueryform',
|
||||||
|
'uglify:moment',
|
||||||
'qunit:compiled'
|
'qunit:compiled'
|
||||||
] );
|
] );
|
||||||
|
|
||||||
@ -1362,7 +1367,8 @@ module.exports = function(grunt) {
|
|||||||
'uglify:embed',
|
'uglify:embed',
|
||||||
'uglify:jqueryui',
|
'uglify:jqueryui',
|
||||||
'uglify:imgareaselect',
|
'uglify:imgareaselect',
|
||||||
'uglify:jqueryform'
|
'uglify:jqueryform',
|
||||||
|
'uglify:moment'
|
||||||
] );
|
] );
|
||||||
|
|
||||||
grunt.registerTask( 'build:webpack', [
|
grunt.registerTask( 'build:webpack', [
|
||||||
|
6
package-lock.json
generated
6
package-lock.json
generated
@ -17213,9 +17213,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"moment": {
|
"moment": {
|
||||||
"version": "2.22.2",
|
"version": "2.26.0",
|
||||||
"resolved": "https://registry.npmjs.org/moment/-/moment-2.22.2.tgz",
|
"resolved": "https://registry.npmjs.org/moment/-/moment-2.26.0.tgz",
|
||||||
"integrity": "sha1-PCV/mDn8DpP/UxSWMiOeuQeD/2Y="
|
"integrity": "sha512-oIixUO+OamkUkwjhAVE18rAMfRJNsNe/Stid/gwHSOfHrOtw9EhAY2AHvdKZ/k/MggcYELFCJz/Sn2pL8b8JMw=="
|
||||||
},
|
},
|
||||||
"moment-timezone": {
|
"moment-timezone": {
|
||||||
"version": "0.5.28",
|
"version": "0.5.28",
|
||||||
|
@ -136,7 +136,7 @@
|
|||||||
"jquery-ui": "https://github.com/jquery/jquery-ui/archive/1.11.4.tar.gz",
|
"jquery-ui": "https://github.com/jquery/jquery-ui/archive/1.11.4.tar.gz",
|
||||||
"lodash": "4.17.15",
|
"lodash": "4.17.15",
|
||||||
"masonry-layout": "4.2.2",
|
"masonry-layout": "4.2.2",
|
||||||
"moment": "2.22.2",
|
"moment": "2.26.0",
|
||||||
"polyfill-library": "3.42.0",
|
"polyfill-library": "3.42.0",
|
||||||
"react": "16.9.0",
|
"react": "16.9.0",
|
||||||
"react-dom": "16.9.0",
|
"react-dom": "16.9.0",
|
||||||
|
@ -95,7 +95,7 @@ function wp_default_packages_vendor( $scripts ) {
|
|||||||
$vendor_scripts_versions = array(
|
$vendor_scripts_versions = array(
|
||||||
'react' => '16.9.0',
|
'react' => '16.9.0',
|
||||||
'react-dom' => '16.9.0',
|
'react-dom' => '16.9.0',
|
||||||
'moment' => '2.22.2',
|
'moment' => '2.26.0',
|
||||||
'lodash' => '4.17.15',
|
'lodash' => '4.17.15',
|
||||||
'wp-polyfill-fetch' => '3.0.0',
|
'wp-polyfill-fetch' => '3.0.0',
|
||||||
'wp-polyfill-formdata' => '3.0.12',
|
'wp-polyfill-formdata' => '3.0.12',
|
||||||
@ -139,7 +139,7 @@ function wp_default_packages_vendor( $scripts ) {
|
|||||||
did_action( 'init' ) && $scripts->add_inline_script(
|
did_action( 'init' ) && $scripts->add_inline_script(
|
||||||
'moment',
|
'moment',
|
||||||
sprintf(
|
sprintf(
|
||||||
"moment.locale( '%s', %s );",
|
"moment.updateLocale( '%s', %s );",
|
||||||
get_user_locale(),
|
get_user_locale(),
|
||||||
wp_json_encode(
|
wp_json_encode(
|
||||||
array(
|
array(
|
||||||
|
Loading…
Reference in New Issue
Block a user