?
avatar Stuartemk
Stuartemk
8 Jun 2021

Steps to reproduce the issue

Perhaps there are those that I do not understand or do not know, but it seems to me that all the paths of that file are wrong, they are missing a css or js subfolder in each corresponding case.

The file /media/vendor/joomla.asset.json on line 350 has the route "uri": "vendor/awesomplete/awesomplete.min.js" that's wrong.

The correct is "uri": "vendor/awesomplete/js/awesomplete.min.js"

I realized because I am trying to find why the fontwasome images take a long time to load.

Please, before minimizing my contribution to this bug, as they usually do with all new collaborators, REVIEW the file and the routes. Thanks.

Expected result

Make fontawesome images load fast

Actual result

The fontwasome images take a long time to load.

System information (as much as possible)

Additional comments

avatar Stuartemk Stuartemk - open - 8 Jun 2021
avatar joomla-cms-bot joomla-cms-bot - change - 8 Jun 2021
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 8 Jun 2021
avatar Stuartemk Stuartemk - change - 8 Jun 2021
Title
4.0 RC2 Wrong route awesomplete.min.js
4.0 RC2 Wrong route /media/vendor/joomla.asset.json
avatar Stuartemk Stuartemk - edited - 8 Jun 2021
avatar Stuartemk Stuartemk - change - 8 Jun 2021
The description was changed
avatar Stuartemk Stuartemk - edited - 8 Jun 2021
avatar dgrammatiko
dgrammatiko - comment - 8 Jun 2021

but it seems to me that all the paths of that file are wrong, they are missing a css or js subfolder in each corresponding case.

Not really. The uri: vendor/awesomplete/awesomplete.min.js is passed through the HTMLHelper with a relative => true option so the code is fine as is. The full path is only correct if you use directly $document->addScript() which nobody should use in J4 as these functions are deprecated (for a number of good reasons)

avatar Stuartemk Stuartemk - change - 8 Jun 2021
The description was changed
avatar Stuartemk Stuartemk - edited - 8 Jun 2021
avatar Stuartemk
Stuartemk - comment - 8 Jun 2021

but it seems to me that all the paths of that file are wrong, they are missing a css or js subfolder in each corresponding case.

Not really. The uri: vendor/awesomplete/awesomplete.min.js is passed through the HTMLHelper with a relative => true option so the code is fine as is. The full path is only correct if you use directly $document->addScript() which nobody should use in J4 as these functions are deprecated (for a number of good reasons)

@dgrammatiko Thanks for answering, when I try to open the files in those paths they are obviously not found, what you are saying is that the system knows that it has to autocomplete the css and js subfolders in each case? If so, please confirm me to close this bug. Thanks.

avatar brianteeman
brianteeman - comment - 8 Jun 2021

yes

avatar dgrammatiko
dgrammatiko - comment - 8 Jun 2021

@Stuartemk it's easy to test it yourself: add

HTMLHelper::_('script', 'vendor/awesomplete/awesomplete.min.js', ['relative' => true, 'version' => 'auto'], ['defer' => true]);

somewhere in the Atum index.php and observe the rendered HTML
Screenshot 2021-06-08 at 13 42 37

In short, the new Web Assets still uses HTMLHelper under the hood for the static assets and once again I will point out that you should ALWAYS USE HTMLHelper for css/js

avatar Stuartemk Stuartemk - change - 8 Jun 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-06-08 12:21:03
Closed_By Stuartemk
avatar Stuartemk Stuartemk - close - 8 Jun 2021
avatar Stuartemk
Stuartemk - comment - 8 Jun 2021

Ok thank you very much for answering.
Now the issue that remains pending is the slow loading of fontawesome, since when I use fontawesome from a third party they load very fast, I'm not sure but it seems to me that they have to be loaded in memory since when browsing through several sections of my page or The section change is not even noticeable, on the other hand, when using the joomla fontawesome, all the texts move and until the joomla fontawesome images are loaded the texts are positioned in their place, the problem is that if I use the fontawesome from a third party implies more load since they are duplicated, that is, it loads fontawesome twice, and if I remove the fontawsome from the third party, the texts have to wait for the joomla fontawesome to load, which are very slow, perhaps a possible solution is to remove the joomla fontawesome only on the frontend and leave them enabled in the backend so they don't disappear from the administration, but I don't know how.

avatar dgrammatiko
dgrammatiko - comment - 8 Jun 2021

@Stuartemk I've tried to fix this some time ago but it didn't worked out: joomla/40-backend-template#441

Add a Comment

Login with GitHub to post a comment