Merge conflict Gerrit cannot merge this change. It needs a rebase onto main.

Review main Work in progress Orphaned Breaking

75924[!!!][TASK] Hash package version into public resource paths

Benjamin Franzke CR -2 V -1 Normal +58 −1 updated 10/01/22, 15:56

Commit message

This applies to installations in TYPO3 composer mode using
typo3/cms-composer-installers v4 where TYPO3 extensions
are stored in vendor/ and their public resources are linked
to public/_assets/.

The symlink name in public/_assets/ is now extended to be not
just a hash of the relative path to the vendor folder, but also
acts as a cacheHash, by including the package version into the
symlink name.

That means an extension update of packages/extensions
will trigger a new symlink name.
This has the drawback that that names in public/_assets/ are
no longer predictable, but brings the benefit that this will allow
TYPO3 to skip modification-timstamp-lookups in
GeneralUtility::createVersionNumberedFilename() and to generate
performant JavaScript importmaps via trailing slashes[1] syntax.

[1] https://github.com/WICG/import-maps#packages-via-trailing-slashes

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 3
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/24/75924/3 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/24/75924/3 && git cherry-pick FETCH_HEAD

Review

  • Code review CR -2 Blocked
    • Benjamin Franzke -2
    • Helmut Hummel +1
  • Verified V -1 Blocked
    • Helmut Hummel -1
    • core-ci +1 CI

Issues 2

Files 2

Review log 1316

  1. Benjamin Franzke uploaded patch set 1 09/30/22, 12:58

  2. Benni Mack commented on patch set 1 09/30/22, 13:04

  3. Stefan Bürk commented on patch set 1 09/30/22, 13:10

    Not tested, but wondering - would that not mean that old symlinks will stay if a package is updated ? eventually broken if it is not there anymore in the new version ? eventually doing a "public/_assets/<extension-key[hash]/<version-symlink-hash> ?
  4. core-ci voted on patch set 1 V -1 09/30/22, 13:16 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31752

  5. Benjamin Franzke commented on patch set 1 09/30/22, 13:17

    Reply Unresolved

    well, hm, this patch is quite the opposite. I think we'd rather adapt that patch to make it an explicit composer.json configuration to use a preset-qualifier as asset path (disabling optimizations for importmaps/versionNumbering). I mean: We don't want people to hardocde paths, but still there are usecases where an extension needs to be able to provide static-assets: e-mail marketing/links So my take would be: use an explicit configuration for static paths.

    Reply Unresolved

    They would stay: yes Broken: no You could end up with many stale ones, yes. Example: ls public/_assets/ -l | grep backend lrwxrwxrwx 1 ben ben 47 30. Sep 14:17 081fa96a07de1dccb64a8a83e1567439 -> ../../vendor/typo3/cms-backend/Resources/Public lrwxrwxrwx 1 ben ben 47 30. Sep 09:53 a612e037c0219f0e06b849aeb374c166 -> ../../vendor/typo3/cms-backend/Resources/Public
  6. Benjamin Franzke uploaded patch set 2 09/30/22, 13:19

  7. core-ci voted on patch set 2 V +1 09/30/22, 13:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31757

  8. Chris Müller commented on patch set 2 09/30/22, 13:46

    Breaking-98481-HashPackageVersionIntoPublicResourcePaths.rst:26

    benifit -> benefit
  9. Benjamin Franzke uploaded patch set 3 09/30/22, 14:08

  10. Benjamin Franzke commented on patch set 3 09/30/22, 14:08

    Breaking-98481-HashPackageVersionIntoPublicResourcePaths.rst:26 Reply

    Done
  11. Helmut Hummel voted on patch set 3 V +1 CR +1 09/30/22, 14:12

  12. Helmut Hummel commented on patch set 3 V -1 09/30/22, 14:13

    Ah, wait. The URL generation needs to be adapted as well then
  13. core-ci voted on patch set 3 V +1 09/30/22, 14:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/31759

  14. Benjamin Franzke commented on patch set 3 09/30/22, 14:42

    Reply Unresolved

    oops, sorry… I though that'd already use the installed-versions-api. Problably makes sense to merge and test that with https://review.typo3.org/c/Packages/TYPO3.CMS/+/75384 then, in order to provide both usecases directly.
  15. Benjamin Franzke commented on patch set 3 CR -2 10/01/22, 15:56

    Needs to be postponed for possible security reasons for now (information disclosure regarding extension version numbers).
  16. Benjamin Franzke marked it work in progress 10/01/22, 15:56