Blazor WebAssembly - Lazy loading for better performance

preview_player
Показать описание
In this video I add a Razor Class Library containing Radzen Components. This dll will be lazy loaded only if required. The same method can be used with other dlls that are not immediately required.

Note:

var assemblies = (await LazyAssemblyLoader.LoadAssembliesAsync(new[]
{
})).ToList();
AdditionalAssemblies.AddRange(assemblies);

Language: C#
IDE: Rider
Рекомендации по теме
Комментарии
Автор

Thanks!, I was looking for this video

kevinarias
Автор

Also is there a way to lazy load dlls when we don`t really know exactly where it is used?

norbertcsibi
Автор

What happens when in the Radzen project we have for example 5 components and we lazy load this project. Then what happens when one component is being used in index.razor and 2 of them in another page? When index.razor kicks in it will load all of them? Then it`s not really a lazy loading, isn`t?

norbertcsibi