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.
Make fontawesome images load fast
The fontwasome images take a long time to load.
Labels |
Added:
?
|
Title |
|
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 arelative => 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.
yes
@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
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
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-06-08 12:21:03 |
Closed_By | ⇒ | Stuartemk |
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.
@Stuartemk I've tried to fix this some time ago but it didn't worked out: joomla/40-backend-template#441
Not really. The uri:
vendor/awesomplete/awesomplete.min.js
is passed through the HTMLHelper with arelative => 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)