Underscore.js library deprecation in Drupal's core

Created on 22 February 2023, over 1 year ago
Updated 30 March 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

Proposed resolution

Drupal 10 has Underscore.js library in core yet so there is a quick fix for this: Issue #3343708 πŸ› Underscore.js library is deprecated under Drupal 10, quick dependencies fix Fixed

But this library can be removed from core any moment so for long term there two possible solutions:
1) Get rid of Underscore.js usage at all (replacing with vanilla JS code probably).
2) Add copy of Underscore.js library to theme sources and use it as dependency to be sure that things will work even if Underscore.js library will be removed from Drupal core completely. It is safe to have Underscore.js library from both theme and Drupal core because it checks internally if it already loaded and will not load second time.

I'm not so good in JS so I can not do 1)
But if no one will do it I can prepare merge request for 2)

Waiting for maintainers opinions on this :)

πŸ“Œ Task
Status

Active

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.69.0 2024