Problem/Motivation

Based on discussion during Drupal Dev Days between @lauriii, @nod_, and @justafish, the build tooling is no longer needed in Drupal 10 due to wide enough support for ES6 features in browsers. However, the tooling is used widely by contrib ecosystem even though it was never designed for that use case, and was explicitly marked as internal.

Proposed resolution

Deprecate core/scripts/js/babel-es6-build.js for removal from 10.0.x

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

The JavaScript ES6 build process is removed given that all browsers supported by Drupal Core are now ES6 compatible. This means that once the build tooling is removed from Drupal 10, core developers are no longer required to run the commands when they make changes to core JavaScript. This also means that babel/core and all related dependencies will no longer be included as core development dependencies.

Comments

lauriii created an issue. See original summary.

lauriii’s picture

Status: Active » Needs review
StatusFileSize
new1.21 KB
lauriii’s picture

Issue tags: +Needs change record

Status: Needs review » Needs work

The last submitted patch, 2: 3278246-2.patch, failed testing. View results

nod_’s picture

Status: Needs work » Reviewed & tested by the community

Code looks good to me.

+++ b/core/scripts/js/babel-es6-build.js
@@ -22,6 +22,8 @@ const changeOrAdded = require('./changeOrAdded');
+console.warn('⚠️  yarn `build:js` command is deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. This command is no longer needed in Drupal 10.0.0.️');

Ideally we would display this message at the end of the file processing so it's clearly visible. But the way things are done we don't have a good way of deferring the message after all the files have been processed (unless we rewrite a bunch of things to use promises). So displaying on top is fine.

lauriii’s picture

Issue tags: -Needs change record

Added a draft change record

alexpott’s picture

There's a bit of chicken and egg with this issue and #3278415: Remove usages of the JavaScript ES6 build step, the build step itself, and associated dev dependencies but I don't think we can deprecate this in 9.4.x until it is no longer necessary in D10.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

Discussed with @lauriii - we need to commit this before #3278415: Remove usages of the JavaScript ES6 build step, the build step itself, and associated dev dependencies as that one should be delayed for as long as possible. So I proposed we change the message to:

yarn `build:js` command is deprecated in drupal:9.4.0 and will be removed from drupal:10.0.0. This command is no longer needed in Drupal 10.0.0 once https://www.drupal.org/project/drupal/issues/3278415 is committed.️

Yes this is not in the standard deprecation format but it does tell the truth and explain why we are still using the command in D10 today. Once #3278415: Remove usages of the JavaScript ES6 build step, the build step itself, and associated dev dependencies lands and removes the file this message will be in 9.4.x and 9.5.x and still helpful as people will be able to see what we did to remove core's dependency on it if they are using the tool for contrib or custom development.

lauriii’s picture

Status: Needs work » Reviewed & tested by the community
StatusFileSize
new1.36 KB
new1.61 KB
lauriii’s picture

StatusFileSize
new1.36 KB
new903 bytes

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed 8620063ae0 to 10.0.x and 004fa86e19 to 9.5.x and eb3ef8c00a to 9.4.x. Thanks!

  • alexpott committed 8620063 on 10.0.x
    Issue #3278246 by lauriii, alexpott, nod_, justafish: Deprecate core/...

  • alexpott committed 004fa86 on 9.5.x
    Issue #3278246 by lauriii, alexpott, nod_, justafish: Deprecate core/...

  • alexpott committed eb3ef8c on 9.4.x
    Issue #3278246 by lauriii, alexpott, nod_, justafish: Deprecate core/...
lauriii’s picture

Issue summary: View changes
Issue tags: +10.0.0 release notes

Adding a Drupal 10.0.0 release note.

xjm’s picture

Issue tags: +9.4.0 release notes

Status: Fixed » Closed (fixed)

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