Underscore.js library is deprecated under Drupal 10, quick dependencies fix

Created on 22 February 2023, almost 2 years ago
Updated 17 April 2023, over 1 year ago

Problem/Motivation

Underscore.js library was deprecated in Drupal 9.4 ( https://www.drupal.org/node/3273118 β†’ )
But it is used in following files: attributes.js, drupal.bootstrap.js, modal.js

This causes unpredictable JS errors under Drupal 10.

Proposed resolution

There is a quick fix for this issue: library still present in Drupal 10 core but was renamed to 'core/internal.underscore'.

I've added merge request to add this library as dependency for mentioned files and this solves a problem for Drupal 10.0.x.

This is safe for both Drupal 10 and Drupal 9.5 because it was deprecated in Drupal 9.4. So Drupal 9.5 (which is requirement since 3.27) has Underscore.js library defined as both 'core/underscore' and 'core/internal.underscore'.

P.S.: Created separate Issue #3343712 πŸ“Œ Underscore.js library deprecation in Drupal's core Active to discuss a long term solution.

πŸ› Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡§πŸ‡ΎBelarus f1mishutka Minsk

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

Comments & Activities

Production build 0.71.5 2024