Skip to content

Add jquery-type-polyfill library providing $.type() for jQuery 4

Issue 3467129

jQuery 4 removed $.type() which Slick <= 1.8.x still calls. This MR restores compatibility by adding a tiny polyfill and wiring it into the base Slick library.

Rationale

Slick relies on $.type() to detect data types. jQuery 4 removed this API, causing broken carousels on Drupal 11 sites. The polyfill restores the minimal behavior Slick needs without needing to modify Slick upstream.

Changes

  • New files:
    • js/src/jquery-type-polyfill.js
    • js/jquery-type-polyfill.min.js
  • Modified:
    • slick.libraries.yml — adds jquery-type-polyfill library and set weight to -19 and dependcy on core/jquery; makes slick library depend on the polyfill instead of directly on core/jquery

Backward compatibility

  • On Drupal <11, the polyfill exits early and does not override existing behavior.
  • No configuration changes needed for site builders.

Release notes (proposed)

  • Added a tiny jQuery $.type() polyfill to keep Slick working with jQuery 4/Drupal 11. No changes required for existing sites.

Maintainer notes

  • Consider removing this once Slick upstream drops reliance on $.type()
Edited by j.

Merge request reports

Loading