Review main Ready for review

96337[TASK] Register default frontend JavaScript directly

Wouter Wolters CR 0 V 0 Hard +272 −13 updated 11/10/26, 12:36

Commit message

Protected email links and JavaScript window links register the default
frontend JavaScript. Exporting it to typo3temp reads the source and
hashes its contents on every registration, even when the exported file
already exists.

Register the packaged asset directly and let the existing resource
publisher generate its URL and apply modification-time cache busting.
This removes the source reads, content hashing and temporary export.
Disabling default JavaScript and merging asset attributes and options
continue to work as before.

Registration costs decrease as follows:

  Registrations   Source reads      Time before / after
  1               1 -> 0            37.73 / 0.48 us
  20              20 -> 0           581.32 / 7.08 us
  100             100 -> 0          2985.30 / 34.82 us

These timings cover registration, not the complete frontend request.
Peak allocations for repeated registration fall from 13,848 to 1,680
bytes. Rendering still checks file metadata for cache busting.

The asset now opts into Content-Security-Policy handling. With
'strict-dynamic' in script-src, browsers ignore 'self', so the script
was blocked unless it carried a nonce. Policies without
'strict-dynamic' keep cacheable pages free of nonce values, since the
nonce is dropped again when it is not required.

The TypoScript reference for "config.removeDefaultJS = external" now
mentions only the inline JavaScript that is still exported.

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 5
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/37/96337/5 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/37/96337/5 && git cherry-pick FETCH_HEAD

Review

  • Code review CR 0 Needs a vote
  • Verified V 0 Needs a vote
    • core-ci +1 CI

Merge conflicts 1

Issues 2

Files 4

Review log 79

  1. Wouter Wolters uploaded patch set 1 10/02/26, 21:07

  2. Wouter Wolters uploaded patch set 2 10/02/26, 21:27

  3. Wouter Wolters updated the commit message in patch set 3 10/09/26, 16:40

  4. Wouter Wolters rebased onto patch set 4 10/09/26, 16:40

  5. Wouter Wolters wrote 10/09/26, 16:40

    Unset private
  6. Wouter Wolters marked it ready for review 10/09/26, 16:40

  7. core-ci voted on patch set 4 V +1 10/09/26, 17:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/110651

  8. Benni Mack uploaded patch set 5 V +1 11/10/26, 12:27

  9. core-ci voted on patch set 5 V +1 11/10/26, 12:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113897