LPS-131777 call getStaticResourceUrl to get timestamp and perform correct redeploys to cdn's #101514
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Forwarded from: liferay-frontend#1028 (Took 1
ci:forward
attempt in 3 hours 15 minutes)Console
@jgarcialr
@liferay-frontend
Original pull request comment:
Hello Frontend Team,
Description of the issue:
When you use
<@liferay.js file_name>
or<@liferay.css file_name>
macros, those imports doesn't have a timestamp.This is causing that when you redeploy the theme, files imported with those macros, doesn't always show latest version and causes problems with some cdn's (pex dxp-cloud cdn)
Things I've tried.
Created a new theme.
Inside portal-normal.ftl import two different js files with the macro and with other mechanism provided by liferay.
Using the macro:
<@liferay.js file_name="${javascript_folder}/unav/unav72.js"/>
Using portalUtil.getStaticResourceURL
For the first case, a <script tag is created. src attribute, contains the filename, without any parameters.
For the second case, the source of the script tag has a timestamp and browserId parameters.
Test plan
After applying this change both requests have parameters and those parameters are updated with each redeployment of the theme
✔️ ci:test:stable - 9 out of 9 jobs passed
✔️ ci:test:relevant - 21 out of 22 jobs passed in 2 hours 24 minutes
Click here for more details.
Base Branch:
Branch Name: master
Branch GIT ID: d57c657bd5e4815bae43c722ab39cfee7b6caac0
Upstream Comparison:
Branch GIT ID: 14a0d4956e9427b920e405c091588977e891b02d
Jenkins Build URL: Acceptance Upstream DXP (master) #1841
ci:test:stable - 9 out of 9 jobs PASSED
9 Successful Jobs:
ci:test:relevant - 20 out of 22 jobs PASSED
2 Failed Jobs:
test-portal-acceptance-pullrequest(master)test-portal-acceptance-pullrequest-batch(master)/lpkg-base-jdk8/020 Successful Jobs:
For more details click here.
This pull contains no unique failures.
Failures in common with acceptance upstream results at 14a0d49:
test-portal-acceptance-pullrequest-batch(master)/lpkg-base-jdk8/0
Job Results:
2 Tests Passed.
3 Tests Failed.