Unplanned
Last Updated: 23 Oct 2023 14:46 by Thomas
Rick
Created on: 21 Jul 2022 12:13
Category: UI for Blazor
Type: Feature Request
12
Start using JavaScript isolation / modules

I have been trying to improve my Lighthouse score with Google and one of the items it is tagging is the "telerik-blazor.js" file.  I have seen new practices where the JavaScript is imported as needed, see this article here from Microsoft.

Can you please consider this in the future?

===

Telerik edit: A possible workaround is to build the Telerik JavaScript file without some of the components that you don't need.

5 comments
Thomas
Posted on: 23 Oct 2023 14:46

Thank you for the update. :)

ADMIN
Dimo
Posted on: 11 Oct 2023 14:28

Hello Thomas and everyone who is following this request,

We discussed the possibility to expand this feature and include NuGet package splitting together with JavaScript file splitting. It seems that removing components from the package (i.e. assembly) may not produce a significant benefit, especially if we take into account that the user will be downloading a lot of other assemblies too. Thus we may focus only on the JavaScript file (for example, removing the Charts or the PDF Viewer will reduce the JS file size quite a bit).

In the meantime, you can rebuild telerik-blazor.js and remove the components that you don't use.

Regards,
Dimo
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources!
Thomas
Posted on: 06 Oct 2023 14:04
This feature would be great for public facing Blazor Webassambly applications, where the initial download is quite large.
ADMIN
Nadezhda Tacheva
Posted on: 28 Jul 2022 09:22

Hi Rick,

Generally speaking, the UI for Blazor components use JavaScript only where needed and for functionalities that cannot be completely handled on the C# side. Having this is mind, the size of the JavaScript file should not be troublesome. However, using JavaScript isolation is something that we'd like to look further into and consider for future product version. I've updated the status of the request and added your vote.

Regards,
Nadezhda Tacheva
Progress Telerik

The Premier Dev Conference is back! 

Coming to you live from Progress360 in-person or on your own time, DevReach for all. Register Today.


Rick
Posted on: 21 Jul 2022 15:13

An example of what I am talking about doing refers to loading only the JavaScript required for the component on the screen.  So, we don't have to load the entire Telerik Blazor library if we are only looking using a couple components.

 

So, if loading the "ToolBar" only load the JavaScript required for the toolbar control. This could be imported on control render.