Review main Merged

61625[BUGFIX] Hash extension versions into requireJS bust parameter

Benjamin Franzke CR +2 V +2 Easy +20 −16 updated 09/06/19, 11:41

Commit message

When a third party extension that contains a requireJS backend module is
updated, the cache bust parameter needs to be updated as well, otherwise
browsers would not download the updated asset.

We will now include all extensions that contain requireJS modules into the
requireJS bust parameter hash calculation (by extension name and version).
That means an extension update of these extensions will trigger a new
bust parameter.

This has the slight drawback that the requireJS bust parameter will need
to be re-calculated after every extension update of such extensions, but
that's actually limited to extensions that provide requireJS modules, and
better than no asset updates at all.

This patch uses the PackageManager instead of ExtensionManagementUtility
to get access to the package version using the PackageInterface. Having
the full package array available we can also drop the
GeneralUtility::getFileAbsFilename('EXT:…') indirection which ends up
calling PackageManager anyway (only with added string parsing overhead).

Review

  • Code review CR +2 Done
    • Andreas Kienast +2
    • Frank Nägler +1
  • Verified V +2 Done
    • Andreas Kienast +2
    • Frank Nägler +1
    • TYPO3com +1 CI

Issues 1

Files 1

Review log 912

  1. Benjamin Franzke uploaded patch set 1 09/05/19, 06:45

  2. Andreas Kienast commented on patch set 1 09/05/19, 07:03

    PageRenderer.php:1352

    Would it hurt to use the extension version for core extensions as well? This way we could drop TYPO3_version and the code is simpler to read.
  3. Benjamin Franzke commented on patch set 1 09/05/19, 07:09

    PageRenderer.php:1352 Reply

    No, wouldn't. I wasn't sure whether the hmac calculation would become less efficient, as it would need to handle a longer string – but I didn't measure that and the result is cached, so it would actually be fine. One "slight" drawback: (De)Activating a core extension would trigger a new bust parameter (although not needed as the core versions are synchronous), while the current solution using TYPO3_version and type != 'typo3-cms-framework' would not. Anyway, for the sake of clean code I'd be fine with dropping TYPO3_version anyway.
  4. TYPO3com voted on patch set 1 V +1 09/05/19, 07:20 Completed build in 28m 59s on Thu, 5 Sep, 07:20 AM Test Summary: 47361 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-36076

  5. Benjamin Franzke uploaded patch set 2 09/05/19, 07:25

  6. Benjamin Franzke commented on patch set 2 09/05/19, 07:26

    PageRenderer.php:1352 Reply

    Adapted in patchset 2.
  7. TYPO3com voted on patch set 2 V -1 09/05/19, 07:41 Completed build in 13m 39s on Thu, 5 Sep, 07:41 AM Test Summary: 1 of 47720 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-36080

  8. TYPO3com voted on patch set 2 V +1 09/05/19, 08:04 Completed build in 18m 33s on Thu, 5 Sep, 08:04 AM Test Summary: 47361 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-36082

  9. Andreas Kienast voted on patch set 2 CR +1 09/05/19, 10:32

  10. Frank Nägler voted on patch set 2 V +1 CR +1 09/06/19, 11:32

  11. Andreas Kienast voted on patch set 2 V +2 CR +2 09/06/19, 11:41

  12. Andreas Kienast merged patch set 3 09/06/19, 11:41