blazor-lazy-loading icon indicating copy to clipboard operation
blazor-lazy-loading copied to clipboard

Non referenced RCLs (RazorClassLibraries)

Open FrMalan opened this issue 5 years ago • 1 comments

Hi,

I am working through the wiki docs and thank you for taking the time to write some docs. I realize these are early days, so I would like to ask:

For a wasm client, can one create RCL modules that are not directly referenced by the wasm project (or a modulesHost project), kind of a "disconnected" setup where I could then build a module from a separate solution and deploy the output to some common modules folder?

FrMalan avatar May 07 '20 09:05 FrMalan

Yes absolutely! You can reference BlazorLazyLoading.Module from an isolated project and then later deploy the _content folder of the Module to the Wasm wwwroot folder.

There are 2 ways of consuming the module from that point:

Manual approach

Inject IAssemblyLoader and call LoadAssemblyByName. The module DLLs and it's dependencies will be automatically located based on the name.

Automatic approach

Use <Lazy ModuleName="WHATEVER" Name="TYPE_FULL_NAME" /> to force a module discovery and render that component.

If you can give me a more in-detail example of what you are trying to achieve I can give you a more specific answer and even adapt the existing system for such scenarios.

Sorry that there is no documentation yet on the "raw" stuff like IAssemblyLoader. Thanks!

isc30 avatar May 07 '20 10:05 isc30