Problem/Motivation

Core using version released in 2014, there's newer stable release
Main fixes in library are
- 2015 proper SVG support which still does not work in IE11 https://caniuse.com/#search=classList
- 1.2.20171109 adds shim for replace() method
- 1.2.20171210 fixes implementations of add() and contains()

Proposed resolution

update library, it has few bugfixes since 2014

Remaining tasks

review, do manual testing, commit

Comments

andypost created an issue. See original summary.

andypost’s picture

grandmaglassesropeman’s picture

Status: Needs review » Needs work

Since we've dropped support for IE 9 & 10 as of 8.4.x, can we also stop using this library? IE11 has support for classList.

andypost’s picture

@drpal do we have deprecation/removal policy for JS libs?

alexpott’s picture

I think we need to open an issue about how to deprecate a library. We shouldn't remove from core since a module might have a library that depends on it but we should stop using it in core.

berdir’s picture

@alexpott: Even stop using it could be tricky, I think @drpal pointed out somewhere that classList.js also fixes some other IE11 problems and people might be implicitly relying on that. See #2905036: Lower weight of classList library to optimize aggregation (I'd love to get either that or this issue in if we end up removing its usage, that's a practically free performance improvement for everyone that saves an additional request).

andypost’s picture

Title: Update classList.js to 1.2.2018012 » Update classList.js to 1.2.20180112
Issue summary: View changes
Status: Needs work » Needs review

I did check usage of library in core and filed #2955842: Deprecate classList library - we are no longer need this dependency on active-link library

Also since quirks for IE11 https://caniuse.com/#search=classList (which still supported by core) & SVG is widely used we should update the library

Issue summary updated with reasons to update

lauriii’s picture

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

andypost’s picture

Title: Update classList.js to 1.2.20180112 » Deprecate classList.js
Issue tags: +@deprecated, +Needs change record updates
Related issues: +#3064017: Create a means to mark an asset library as deprecated in a *.libraries.yml file
StatusFileSize
new614 bytes
new774 bytes

Repurposing as of #3064017: Create a means to mark an asset library as deprecated in a *.libraries.yml file
Also probably this could be closed as duplicate of #2955842: Deprecate classList library
But let's test it, new patch deprecates the lib

andypost’s picture

Title: Deprecate classList.js » Update classList.js to 1.2.20180112
Status: Needs review » Closed (duplicate)
andypost’s picture

Strange that both patches fail