Soenneker.Blazor.Utils.ModuleImport
4.0.1854
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.Blazor.Utils.ModuleImport --version 4.0.1854
NuGet\Install-Package Soenneker.Blazor.Utils.ModuleImport -Version 4.0.1854
<PackageReference Include="Soenneker.Blazor.Utils.ModuleImport" Version="4.0.1854" />
<PackageVersion Include="Soenneker.Blazor.Utils.ModuleImport" Version="4.0.1854" />
<PackageReference Include="Soenneker.Blazor.Utils.ModuleImport" />
paket add Soenneker.Blazor.Utils.ModuleImport --version 4.0.1854
#r "nuget: Soenneker.Blazor.Utils.ModuleImport, 4.0.1854"
#:package Soenneker.Blazor.Utils.ModuleImport@4.0.1854
#addin nuget:?package=Soenneker.Blazor.Utils.ModuleImport&version=4.0.1854
#tool nuget:?package=Soenneker.Blazor.Utils.ModuleImport&version=4.0.1854
Soenneker.Blazor.Utils.ModuleImport
A Blazor utility library assisting with asynchronous module loading
This library simplifies the process of loading JavaScript modules and provides methods for waiting until a module is loaded and disposing of modules when they are no longer needed.
Features
- Import JavaScript modules dynamically.
- Wait until a module is fully loaded.
- Dispose of JavaScript modules when they are no longer needed.
- Singleton pattern to ensure that each module is loaded only once.
Installation
To install, add the package to your Blazor project using the .NET CLI:
dotnet add package Soenneker.Blazor.Utils.ModuleImport
Register it in DI:
builder.Services.AddModuleImportUtil();
Example
Here's an example of how to use the ModuleImportUtil in a Blazor component:
@page "/example"
@inject IModuleImportUtil ModuleImportUtil
@implements IAsyncDisposable
<h3>Module Import Example</h3>
<button @onclick="LoadModule">Load Module</button>
@code {
private async Task LoadModule()
{
var module = await ModuleImportUtil.Import("exampleModule");
await ModuleImportUtil.WaitUntilLoaded("exampleModule");
// Guaranteed that the module has been added to the DOM, and available at this point
}
public async ValueTask DisposeAsync()
{
await ModuleImportUtil.DisposeModule("exampleModule");
}
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.JSInterop (>= 10.0.11)
- Soenneker.Dictionaries.Singletons (>= 4.0.77)
- Soenneker.Extensions.CancellationTokens (>= 4.0.21)
- Soenneker.Utils.CancellationScopes (>= 4.0.48)
NuGet packages (16)
Showing the top 5 NuGet packages that depend on Soenneker.Blazor.Utils.ModuleImport:
| Package | Downloads |
|---|---|
|
Soenneker.Blazor.Utils.JsVariable
A Blazor interop library that checks (and waits) for the existence of a JS variable |
|
|
Soenneker.Blazor.Clarity
A small Blazor interop library that sets up Microsoft Clarity |
|
|
Soenneker.Blazor.LogJson
A Blazor interop library that logs JSON (like HTTP requests/responses) within the browser |
|
|
Soenneker.Blazor.ApplicationInsights
A Blazor interop library that sets up client-side Application Insights |
|
|
Soenneker.Blazor.MediaQuery
A Blazor interop library for media queries for viewport size logic |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.1899 | 0 | 9/16/2026 |
| 4.0.1898 | 0 | 9/16/2026 |
| 4.0.1895 | 77 | 9/15/2026 |
| 4.0.1894 | 1,668 | 9/13/2026 |
| 4.0.1893 | 3,202 | 9/12/2026 |
| 4.0.1892 | 129 | 9/12/2026 |
| 4.0.1890 | 179 | 9/12/2026 |
| 4.0.1889 | 87 | 9/12/2026 |
| 4.0.1887 | 439 | 9/12/2026 |
| 4.0.1886 | 103 | 9/12/2026 |
| 4.0.1883 | 4,780 | 9/9/2026 |
| 4.0.1882 | 2,457 | 9/8/2026 |
| 4.0.1881 | 3,001 | 9/8/2026 |
| 4.0.1880 | 1,406 | 9/7/2026 |
| 4.0.1879 | 629 | 9/7/2026 |
| 4.0.1878 | 1,973 | 9/7/2026 |
| 4.0.1877 | 4,110 | 9/5/2026 |
| 4.0.1876 | 3,224 | 9/4/2026 |
| 4.0.1875 | 1,955 | 9/4/2026 |
| 4.0.1854 | 2,786 | 8/13/2026 |
Update dependency Soenneker.Dictionaries.Singletons to 4.0.77 (#2389)