https://github.com/marekpokornyova/blazorlazyload
BlazorLazyLoad is a concept of assembly lazy load in Blazor WASM application.
https://github.com/marekpokornyova/blazorlazyload
blazor lazyload
Last synced: about 1 year ago
JSON representation
BlazorLazyLoad is a concept of assembly lazy load in Blazor WASM application.
- Host: GitHub
- URL: https://github.com/marekpokornyova/blazorlazyload
- Owner: MarekPokornyOva
- License: mit
- Created: 2020-02-12T18:08:21.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-24T16:33:01.000Z (about 6 years ago)
- Last Synced: 2025-04-22T17:19:41.782Z (about 1 year ago)
- Topics: blazor, lazyload
- Language: C#
- Size: 240 KB
- Stars: 14
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BlazorLazyLoad
[](https://www.nuget.org/packages/BlazorLazyLoad)
[](https://www.nuget.org/packages/BlazorLazyLoad)
[](https://github.com/MarekPokornyOva/BlazorLazyLoad/blob/master/LICENSE)
### Description
BlazorLazyLoad is mostly loudly shared idea/concept of assembly lazy load in Blazor WASM application.
Splitting an application speeds up its start and also saves network traffic.
### Features
- Lazy loads assemblies.
- Lazy resolving on both page and component level.
- Registers included pages for routing.
- Registers included services to ServiceProvider.
### Usage
1) Include Nuget package - https://www.nuget.org/packages/BlazorLazyLoad/ in Blazor WASM application's project.
2) Create custom assembly lazy load handler. The \Samples\01\BlazorApp\AreaAssemblyLazyLoadResolver.cs might be good example - it expects areas split strategy. The resolver can also register the services defined in the lazy loaded assembly.
3) Change Router in App.razor to the enhanced one. That invokes AssemblyLazyLoadResolver when a lazy loaded page is navigated at first (entered to navigation bar or on the page refresh).
4) Register services - call builder.Services.AddLazyLoad(); within Program.Main() method.
5) Redirect navigation event to custom handler - see \Samples\01\BlazorApp\wwwroot\index.html.
6) Create project containing lazy loaded pages - see \Samples\01\LazyLoadedArea.
7) The built assembly has to be copied from wwwroot\\_framework\\_bin to the main project's wwwroot\\_framework\\bin folder. It's recommended to use gzipped versions.
8) See \Samples\01\BlazorApp\Pages\LazyComponent for component level lazy loading.
### Notes
- All is provided as is without any warranty.
- The target of this concept has been "make it functional for any price". Therefore some pieces are bit "hacky".
- Developed with version 3.2.0 wasm.
### Release notes
[See](./ReleaseNotes.md)
### Thanks to Blazor team members for their work
### Thanks to Chris Sainty for his article https://chrissainty.com/an-in-depth-look-at-routing-in-blazor/