Problem/Motivation

IETF published https://www.ietf.org/rfc/rfc9239.pdf

It updates JavaScript MIME type registrations to align with reality:

  • The JavaScript MIME type is now unambiguously text/javascript.
  • .mjs is now a registered filename extension, specifically for JavaScript modules.

AFAICS, Drupal uses the now deprecated application/javascript in its internals and in MIME type guessing.

Proposed resolution

Adjust Drupal to reflect the standard.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3284133

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mondrake created an issue. See original summary.

mondrake’s picture

Status: Active » Needs review
nod_’s picture

Status: Needs review » Reviewed & tested by the community

+1, straightforward.

Thanks :)

cilefen’s picture

Is there any possibility this is a behavioral backward-compatibility break?

lauriii’s picture

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs change record

Given apache has this in its change record I guess we shoudl too

Also I think we should update \Drupal\system\Controller\JsAssetController::$contentType too

mondrake’s picture

Version: 9.5.x-dev » 10.1.x-dev
mondrake’s picture

Rebased to 10.1.x

Also I think we should update \Drupal\system\Controller\JsAssetController::$contentType

Done.

mondrake’s picture

Status: Needs work » Needs review
Issue tags: -Needs change record

Added draft CR.

smustgrave’s picture

Status: Needs review » Needs work
Issue tags: +Needs Review Queue Initiative

Tried applying the MR locally but appears to have an issue.

Read the CR and it makes sense.

So just needs a reroll I believe.

mondrake’s picture

Status: Needs work » Needs review

Rerolled

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for the super quick turnaround!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Re #5 I don't think so. text/javascript has been valid for a while - it was obsolete for a while but now it has been brought back - as far as I can see.

Committed 58caf0f and pushed to 10.1.x. Thanks!

  • alexpott committed 58caf0f2 on 10.1.x
    Issue #3284133 by mondrake, alexpott: IETF RFC 9239 requires Javascript...

Status: Fixed » Closed (fixed)

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