Problem/Motivation

Drupal 10 is scheduled to ship sometime in 2022. We should plan what to do with each of our JavaScript dependencies.
CKEditor is not part of this list, it will be handled as part of #3231364: Add CKEditor 5 module to Drupal core

Package

Description

Action

Issue

@babel/core

ECMAScript 5 build

Remove

#3238497: What to do with assets build step?

@babel/preset-env

ECMAScript 5 build

Remove

#3238497: What to do with assets build step?

@babel/register

ECMAScript 5 build

Remove

#3238497: What to do with assets build step?

@drupal/once

Drupal Once

Keep

@popperjs/core

Library for positioning elements

Remove

#3301545: Remove popperjs from Drupal 10

babel-plugin-add-header-comment

ECMAScript 5 build

Remove

#3238497: What to do with assets build step?

Backbone

JavaScript framework used by CKEditor 4, QuickEdit, Contextual Links, Tour, and Toolbar.

Remove

#3145958: [META] Re-evaluate use of Backbone.js in core

chalk

Babel and jQuery UI build tools

Remove

#3266274: Remove chalk as a dependency

chokidar

Babel and PostCSS build tools

Keep

chromedriver

Nightwatch testing

Update

#3306446: Update Nightwatch to 2.4.1/#3306450: Update Chrome container to use newer version

cross-env

Babel and jQuery UI build tools

Remove

#3278415: Remove usages of the JavaScript ES6 build step, the build step itself, and associated dev dependencies

cspell

Spell check

Update

#3306441: Update to the latest cspell version (6.8.1)

css.escape

Internet Explorer 11 Polyfill

Remove

#3238501: Remove empty and deprecated IE11 polyfill library stub entries in 11.0.0

dotenv-safe

Nightwatch testing

Keep

es6-promise

Internet Explorer 11 Polyfill

Remove

#3238501: Remove empty and deprecated IE11 polyfill library stub entries in 11.0.0

eslint

JavaScript linting

Update

#3265618: Update to eslint 8

eslint-config-airbnb

JavaScript linting

Keep (possibly replace)

#3239838: Update core eslint configuration to remove unused React and JSX rules

eslint-config-prettier

JavaScript linting

Update

eslint-plugin-import

JavaScript linting

Update

eslint-plugin-jquery

JavaScript linting

Keep

eslint-plugin-jsx-a11y

JavaScript linting

Keep remove

#3239838: Update core eslint configuration to remove unused React and JSX rules

eslint-plugin-prettier

JavaScript linting

Update

eslint-plugin-react

JavaScript linting

Update remove

#3239838: Update core eslint configuration to remove unused React and JSX rules

eslint-plugin-react-hooks

JavaScript linting

Keep remove

#3239838: Update core eslint configuration to remove unused React and JSX rules

eslint-plugin-yml

YAML linting

Keep

farbtastic

Color picker

Remove

#3306210: Remove Farbtastic library from core

glob

Babel, PostCSS and jQuery UI build tools

Keep

joyride

Required for BC in Drupal 9

Remove from Drupal 10

#3268228: Remove Jquery joyride

jquery

Remove

#3052002: [meta] Replace JQuery with vanilla Javascript in core

jquery-form

Remove

#3189416: Remove jQuery Form dependency from misc/ajax.js

jquery-once

Required for BC in Drupal 9

Remove from Drupal 10

#3268550: Remove deprecated jquery-once

js-cookie

Cookie library

Keep

#3267791: Remove deprecated jquery.cookie shim

loadjs

used for the add_js Ajax command

Keep

minimist

Babel, PostCSS and jQuery UI build tools

Keep

mkdirp

Nightwatch testing

Keep

nightwatch

Nightwatch testing

Update

#3306446: Update Nightwatch to 2.4.1

normalize.css

CSS

Keep

picturefill

Internet Explorer 11 Polyfill

Remove

#3238501: Remove empty and deprecated IE11 polyfill library stub entries in 11.0.0

postcss

CSS build tool

Update

postcss-calc

Internet Explorer 11 Polyfill

Remove

#3238501: Remove empty and deprecated IE11 polyfill library stub entries in 11.0.0

postcss-header

CSS build tool

Update

postcss-import

CSS build tool

Update

postcss-preset-env

CSS build tool

Keep

postcss-pxtorem

CSS build tool

Update

postcss-url

CSS build tool

Update

prettier

JavaScript linting

Update

raw-loader

CKE5 plugins build dependency

remove

#3319917: Remove raw-loader dependency

shepherd.js

Tour

Update

#3265619: Update Shepherd.js to 9.x

sortablejs

Sorting library

Update

stylelint

CSS linting

Keep

stylelint-checkstyle-formatter

CSS linting

Keep

stylelint-config-standard

CSS linting

Keep

stylelint-order

CSS linting

Update

tabbable

Library for checking tabbable elements

Keep

terser

jQuery UI build tools, needs issue for updating to latest
minor release

Update

#3296481: Update terser and terser-webpack-plugin to the latest versions

underscore

This is a dependency of Backbone. Usage outside of that is
light.

Remove #3239796: [meta] Remove dependency on Underscore.js outside of Backbone and mark it internal

Modernizr

Feature detection for JS behaviors

Remove #3101922: Find replacement for Modernizr touchevent test and deprecate ,
#3239980: Deprecate Modernizr

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

lauriii created an issue. See original summary.

nod_’s picture

Issue summary: View changes
lauriii’s picture

Issue summary: View changes

Added link to Underscore.js issue.

nod_’s picture

Issue summary: View changes
nod_’s picture

Issue summary: View changes
nod_’s picture

Issue summary: View changes
xjm’s picture

xjm’s picture

Thanks, I incorporated the issues from this plan into #3118154: [meta] Deprecate dependencies, libraries, modules, and themes that will be removed from Drupal 10 core by 9.4.0-beta1.

The issues in the list are a mix of the deprecation/decoupling issues for D9 and the actual removals for D10. E.g., are the IE11 polyfills and Modernizr already deprecated, or do we still need to add deprecations for those before we remove them from 10.0.x?

mherchel’s picture

alexpott’s picture

In order to update chalk to the latest version if looks like we have to change quite a bit. If you run yarn upgrade --latest and then the build command you'll get

Error [ERR_REQUIRE_ESM]: require() of ES Module core/node_modules/chalk/source/index.js from core/scripts/css/compile.js not supported.
Instead change the require of index.js in core/scripts/css/compile.js to a dynamic import() which is available in all CommonJS modules.

I'm not sure the extent of the changes necessary but https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c looks quite involved.

xjm’s picture

Issue summary: View changes

 

xjm’s picture

Issue summary: View changes

 

lauriii’s picture

Issue summary: View changes
effulgentsia’s picture

For jquery-form, I wrote in #3189416-9: Remove jQuery Form dependency from misc/ajax.js that we might want to keep it but as internal only, just like the Backbone decision in #3145958: [META] Re-evaluate use of Backbone.js in core.

Perhaps there are other ones in this issue's table we should do that with as well?

xjm’s picture

Issue summary: View changes

Updating to clarify that Joyride and jQuery Once are required for BC in D9 and that we need issues to remove them from 10.0.x HEAD.

mradcliffe’s picture

Issue summary: View changes
lauriii’s picture

Issue summary: View changes
lauriii’s picture

Issue summary: View changes
lauriii’s picture

Issue summary: View changes
lauriii’s picture

Issue summary: View changes
effulgentsia’s picture

The only "Remove" left in the table without an issue link is jquery-once.

effulgentsia’s picture

Also, I think that at this point, "Remove" is the incorrect action for jquery, at least for D10.

lauriii’s picture

Issue summary: View changes

Opened issue for removing jquery-once.

lauriii’s picture

Issue summary: View changes
lauriii’s picture

Should we remove js-cookie as well given that its only usage in core was removed in #3267791: Remove deprecated jquery.cookie shim?

nod_’s picture

I would say yes, the work to get rid of the need for cookies on the frontend bears fruit :)

xjm’s picture

Issue summary: View changes

 

Spokje’s picture

Issue summary: View changes
Spokje’s picture

Issue summary: View changes
catch’s picture

kostyashupenko’s picture

Spokje’s picture

Issue summary: View changes
quietone’s picture

Spokje’s picture

Issue summary: View changes
Spokje’s picture

Issue summary: View changes
Spokje’s picture

Issue summary: View changes
nod_’s picture

Issue summary: View changes
nod_’s picture

Issue summary: View changes
effulgentsia’s picture

We're coming up on the one year anniversary of this issue. So much great progress since then! The title of this issue is "Drupal 10 JavaScript dependency plan", but some of the items seem clearly to be Drupal 11 material at this point, such as #3238501: Remove empty and deprecated IE11 polyfill library stub entries in 11.0.0 which is now explicitly Drupal 11 and #3052002: [meta] Replace JQuery with vanilla Javascript in core which perhaps some of the items can still happen in Drupal 10 but the thing in its entirety is impractical for Drupal 10 at this point.

I think it would be helpful at this point to clone this issue into a "Drupal 11 JavaScript dependency plan", and update the summary of each to be appropriate for each respective version. I think that would help clarify which of these items, if any, are still needed before we tag a Drupal 10 beta, or can still happen during the beta.

nod_’s picture

Issue summary: View changes
lauriii’s picture

Status: Active » Fixed
Issue tags: -Needs issue summary update

Closing this as Drupal 10 has shipped.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.