Announcement

Collapse
No announcement yet.

Asynchronous loading of custom js scripts to minimize page rendering time

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Asynchronous loading of custom js scripts to minimize page rendering time

    I would like to add the 'asynch' keyword to custom scripts loaded by application/Espo/Core/Utils/ClientManager.php Is is possible to extend this class in the Custom namespace to override it ?

    Thanks
    Last edited by telecastg; 07-22-2020, 11:32 PM.

  • #2
    I think overriding the proper loader will put you on the right track, unless the loader is hardcoded somehow and it is run before any code can be overridden (I found there are some that cannot be extended with loaders i believe when I was looking into the earliest possible point in espo where custom code can be executed). for example I did that to override the uncustomizable ConsoleCommandManager so this might be the way
    https://forum.espocrm.com/forum/deve...iting-metadata

    Maybe an easier way is to make a single script that loads the other asynchronously. I see one could try to understnd how window.Espo.loadLib() function works.
    Last edited by tothewine; 07-23-2020, 11:02 AM.

    Comment

Working...
X