? NPM Resource Changed bug PR-5.0-dev Pending

User tests: Successful: Unsuccessful:

avatar dgrammatiko
dgrammatiko
4 Oct 2023

Pull Request for Issue #42028 a redo of #32574.

Summary of Changes

  • Adds cache invalidation for all the url() parts of static CSS
  • New script entry for the package.json
  • Added in the build.php

Testing Instructions

  • Get a clean clone of the repo
  • run composer install and npm install
  • run the command npm run cssversioning

Actual result BEFORE applying this Pull Request

urls paths don't have an invalidation string

Expected result AFTER applying this Pull Request

urls paths do have an invalidation string

Verification:
Screenshot 2023-10-04 at 13 48 37

Link to documentations

Please select:

  • No documentation changes for docs.joomla.org needed
  • No documentation changes for manual.joomla.org needed

This affects only the released packages, so more or less it's only affecting the release teams

avatar dgrammatiko dgrammatiko - open - 4 Oct 2023
avatar dgrammatiko dgrammatiko - change - 4 Oct 2023
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 4 Oct 2023
Category JavaScript Repository NPM Change
avatar dgrammatiko dgrammatiko - change - 4 Oct 2023
Labels Added: NPM Resource Changed PR-5.0-dev
avatar dgrammatiko dgrammatiko - change - 4 Oct 2023
The description was changed
avatar dgrammatiko dgrammatiko - edited - 4 Oct 2023
avatar brianteeman brianteeman - test_item - 4 Oct 2023 - Tested successfully
avatar brianteeman
brianteeman - comment - 4 Oct 2023

I have tested this item ✅ successfully on 9d52aaf

Tested by installing 4.4 and then using the update url for this pr to update to j5

thank you


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42038.

avatar HLeithner
HLeithner - comment - 4 Oct 2023

can we get the version string short 5 to match the other new autogenerated version strings?

avatar rdeutz rdeutz - test_item - 4 Oct 2023 - Tested successfully
avatar rdeutz
rdeutz - comment - 4 Oct 2023

I have tested this item ✅ successfully on 9d52aaf


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42038.

avatar dgrammatiko dgrammatiko - change - 4 Oct 2023
Labels Added: bug
avatar dgrammatiko
dgrammatiko - comment - 4 Oct 2023

@HLeithner hash reduced (using the same trick as @Fedik 's PR)

Screenshot 2023-10-04 at 21 10 38

avatar rdeutz rdeutz - test_item - 4 Oct 2023 - Tested successfully
avatar rdeutz
rdeutz - comment - 4 Oct 2023

I have tested this item ✅ successfully on bb5af54

retest with shorter hash lenght, still works


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42038.

avatar richard67
richard67 - comment - 4 Oct 2023

@dgrammatiko I did run the build.php script with your PR applied. I get the following error:

> joomla@5.0.0 cssversioning
> node build/build.js --cssversioning

Error: TypeError: crypto.createHash is not a function
    at fixVersion (/home/richard/lamp/public_html/joomla-cms-5.0-dev/build/tmp/1696444855/build/build-modules-js/css-versioning.es6.js:42:11)
    at async Promise.all (index 40)
    at async module.exports.cssVersioning (/home/richard/lamp/public_html/joomla-cms-5.0-dev/build/tmp/1696444855/build/build-modules-js/css-versioning.es6.js:55:3)
avatar dgrammatiko
dgrammatiko - comment - 4 Oct 2023

@richard67 interesting, could you try the following commit 56bd56e ?

avatar richard67
richard67 - comment - 4 Oct 2023

@richard67 interesting, could you try the following commit 56bd56e ?

@dgrammatiko That works, the error is gone.

avatar richard67
richard67 - comment - 4 Oct 2023

@dgrammatiko Maybe you last change was not necessary because it could have been my fault: When running php ./build/build.php --remote=HEAD on a local branch where no remote exists, I think git fetches the 5.0-dev branch from my fork, and so calls the old js file for the versioning. I'm not 100% sure yet, will check that. But the last commit seems not to do any harm either. The script seems to work, I get version numbers appended to URLs inside the css files where they include images or other css files.

avatar richard67
richard67 - comment - 4 Oct 2023

@dgrammatiko Not my mistake. The error happens also with the code before the last commit when the branch can be fetched from remote, so the last commit was necessary to fix that error.

avatar richard67 richard67 - test_item - 4 Oct 2023 - Tested successfully
avatar richard67
richard67 - comment - 4 Oct 2023

I have tested this item ✅ successfully on 56bd56e


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42038.

avatar richard67
richard67 - comment - 4 Oct 2023

@brianteeman Could you test again if it still works after the last changes? Thanks in advance.

avatar HLeithner
HLeithner - comment - 5 Oct 2023

can we get another test here please.

avatar rdeutz rdeutz - test_item - 5 Oct 2023 - Tested successfully
avatar rdeutz
rdeutz - comment - 5 Oct 2023

I have tested this item ✅ successfully on 56bd56e

Tested:

npm run cssversioning
node build/build.js --cssversioning

no errors and working


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42038.
avatar richard67 richard67 - change - 5 Oct 2023
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 5 Oct 2023

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/42038.

avatar HLeithner HLeithner - close - 5 Oct 2023
avatar HLeithner HLeithner - merge - 5 Oct 2023
avatar HLeithner HLeithner - change - 5 Oct 2023
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2023-10-05 09:48:58
Closed_By HLeithner
Labels Added: ?
avatar HLeithner
HLeithner - comment - 5 Oct 2023

thanks

Add a Comment

Login with GitHub to post a comment