User tests: Successful: Unsuccessful:
Add a posibility to mark asset as Deprecated, with optional description
See joomla/schemas#15
Apply patch.
Edit media/system/joomla.asset.json
, add to "core" asset:
"deprecated": true,
"deprecatedMsg": "The deprecation testing"
Enable Debug, and deprecation loging.
Open any page, and check the logs.
Nothing
There should be an message of deprecated asset "core"
Please select:
Category | ⇒ | Libraries |
Status | New | ⇒ | Pending |
Should be there, at least was in my test :)
All data in debug plugin is collected onAfterRespond
.
We already have a use case for this PR. When it will be merged, we would have to add the deprecated flag and string to the 2 assets here: https://github.com/joomla/joomla-cms/blob/4.3-dev/build/media_source/com_templates/joomla.asset.json#L8-L31
They had been restored with my PR #39431 in the 4.3-dev branch, and in 5.0-dev they have will deleted when my PR #40302 gets merged, so the deprecation message would be for 5.0, or for 6.0 if my PR gets postponed until 6.0.
Maybe it would make sense to add that deprecation for the 2 assets to this PR here, so it can be tested with that use case?
Category | Libraries | ⇒ | Repository NPM Change Libraries |
Labels |
Added:
?
PR-4.4-dev
|
Added :)
@Fedik A question regarding dependencies: Does the "dependencies": ["com_templates.admin-template-compare.es5"],
of the "com_templates.admin-template-compare" asset mean that the "com_templates.admin-template-compare.es5" depends on the "com_templates.admin-template-compare"? In this case your last change would be right. Or does it mean that the "com_templates.admin-template-compare" depends on "com_templates.admin-template-compare.es5"? In this case you maybe should have added the deprecation to the "es5". Or am I completely wrong?
of the "com_templates.admin-template-compare" asset mean that the "com_templates.admin-template-compare.es5" depends on the "com_templates.admin-template-compare"?
It is vice versa, com_templates.admin-template-compare
depend from com_templates.admin-template-compare.es5
But, in current case they work each "stand alone", no real dependency.
The depndency here means when User use com_templates.admin-template-compare
then the AssetManager will also load com_templates.admin-template-compare.es5
.
Then in modern Browser will be executed only com_templates.admin-template-compare
script,
and in old only com_templates.admin-template-compare.es5
script.
Only com_templates.admin-template-compare
will cause the deprecated message in the log.
Because com_templates.admin-template-compare.es5
should not be used as stand alone asset.
When we delete blabla-script
, we also delete blabla-script.es5
(if there any). No reason to spam deprecation log, it is already huge ;)
But yes, both users wil see that message.
I have tested this item
I've successfully tested this PR as follows:
I've created an override in the Atum template for the "administrator/components/com_templates/tmpl/template/default.php" file.
Then I have added a line ->useScript('com_templates.admin-template-compare')
before line 32 of the override file "administrator/templates/atum/html/com_templates/template/default.php".
Then with the PR applied I have verified that whenever I open the file editor view of the template manager, the deprecated message added by this PR to the asset is correctly logged in the "administrator/logs/deprecated.php" and also shown in the "Deprecated" tab of the debug bar if debug is enabled.
Finally I have verified that the new deprecated log does not happen when "Log deprecated" is switched off.
Labels |
Added:
NPM Resource Changed
|
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2023-04-28 10:55:18 |
Closed_By | ⇒ | laoneo |
Thanks!
Just checking that this shows up in the debug plugin - as we're already in the renderer.