Drupal 11 - jQuery 4.0.0-beta.2

Created on 31 October 2024, 21 days ago

Problem/Motivation

Spun up a Drupal 11 core debugging modules, libraries and themes.
Even though the theme was "compliant" by the upgrade status module audit.
Loading Drupal 11 with the theme installed it fails.

Steps to reproduce

Load any page with the theme or a sub-theme.

Proposed resolution

Debug configuration, update library versions, update core functions.
Review and highlight api changes in Drupal 11.

Remaining tasks

Audit module JavaScript, resource libraries, and scripts.

Page Load

Drupal 11 jQuery Version

πŸ› Bug report
Status

Active

Version

5.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States emptyvoid

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @emptyvoid
  • πŸ‡ΊπŸ‡ΈUnited States emptyvoid

    Upgrading the minified bootstrap.min.js to version 5 fixes the errors for the theme.
    However, though not related directly to this theme. The jQuery 4 version depreciated .isFunction()

    https://api.jquery.com/jQuery.isFunction/

    Description: Determines if its argument is callable as a function.
    
    version added: 1.2jQuery.isFunction( value )
    value
    Type: Anything
    The value to be tested.
    As of jQuery 3.3, jQuery.isFunction() has been deprecated. In most cases, its use can be replaced by typeof x === "function".
    
    Note: As of jQuery 1.3, functions provided by the browser like alert() and DOM element methods like getAttribute() are not guaranteed to be detected as functions in browsers such as Internet Explorer.
    
  • πŸ‡ΊπŸ‡ΈUnited States emptyvoid

    Loads of JavaScript libraries are affected by Drupal Core using jQuery 4.
    There are even core libraries which fail because of the missing $.isFunction().

    I've created a "shim" module and library to restore the function signature and use the "short cut" method.

Production build 0.71.5 2024