Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#50408 closed defect (bug) (fixed)

Update moment.js lib to its latest version

Reported by: yoancutillas Owned by: desrosj
Priority: normal Milestone: 5.5
Component: External Libraries Version: 5.4.2
Severity: normal Keywords: has-dev-note
Cc: Focuses:

Description

Hello,

The core-bundled momentjs library hasn't been updated in two years (2.22.2 - Jun 1, 2018).

JQMigrate displays a deprecation warning:

Deprecation warning: use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info.

And some plugins and themes encounter javascript fatal errors (blocking) because of it:

Is it possible to update momentjs to its latest version (currently 2.26.0 - May 20, 2020)?

wp-includes\js\dist\vendor\moment.js
wp-includes\js\dist\vendor\moment.min.js

Change History (6)

#1 @SergeyBiryukov
6 years ago

  • Milestone Awaiting Review → 5.5

#2 @SergeyBiryukov
6 years ago

  • Owner set to SergeyBiryukov
  • Resolution → fixed
  • Status new → closed

In 48075:

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.

#4 @Hareesh Pillai
6 years ago

  • Resolution fixed
  • Status closed → reopened

There was a new version (​v2.27.0) of moment.js released two weeks ago. Let us try to update to this version before the beta.

#5 @desrosj
6 years ago

  • Owner changed from SergeyBiryukov to desrosj
  • Status reopened → assigned

Thanks @hareesh-pillai!

#6 @desrosj
6 years ago

  • Resolution → fixed
  • Status assigned → closed

In 48269:

External Libraries: Update Moment.js to version 2.27.0.

A full list of changes in this update can be found on GitHub: ​https://github.com/moment/moment/compare/2.26.0...2.27.0

Props hareesh-pillai, desrosj.
Previously [48075].
Fixes #50408.

Note: See TracTickets for help on using tickets.