OrchardCMS / OrchardCore

Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
https://orchardcore.net
BSD 3-Clause "New" or "Revised" License
7.43k stars 2.4k forks source link

Add external library-based module loading feature. #15885

Closed hyzx86 closed 6 months ago

hyzx86 commented 6 months ago

Is your feature request related to a problem? Please describe.

Sometimes, we encounter issues that require using the source code debugging capabilities of OrchardCore, but most business modules are stored in their own repositories, making it difficult to quickly switch to the preview branch through the debugging features to locate issues.

Remember that we mentioned about the development of dynamic loading external libraries, but at that time our purpose was just to dynamically load. However, we discovered that if you load after that, you may not be able to completely uninstall already loaded into memory library classes.

Describe the solution you'd like

  1. This feature should only be managed in the Default tenant.
  2. When the Default tenant enables a specified external class library after that, it should be able to function like an internal module. The Subtenants can choose to enable it.
  3. In appsettings.json, add corresponding configuration items for external class library saving location. It might be an array, just like NuGet.Config. We may need to search from multiple paths to find the package.
  4. Advanced version, it might be in the future that we provide or directly use NuGet.org provides service to load class library from network just like GitExtensions does

image

Describe alternatives you've considered

No

Piedone commented 6 months ago

I'm not sure I completely understand. Are you looking for a way to be able to swap out the Orchard Core package that module projects used by your application depend on? E.g., the module A depends on OC v.1.8.0, but you want it to use 1.9.0-preview-18189 quickly? Can you provide examples?

A few notes about the topic that may help you and solve this without anything required in Orchard Core:

hyzx86 commented 6 months ago

Hi @Piedone , Thank you for sharing!

Our repositry is https://github.com/EasyOC/EasyOC

We reference of OC‘s architecture , it also can quickly adjust package version of OC, and implemented similar OrchardCore.Application.Cms.Targets.csproj structure of the project.

So far these business modules are relatively stable, but in turn we have to update common modules frequently, such as components that are re-implemented in a way that overwrites the OC's original interface. Now we plan to separate these business modules.

We currently use git submodules integration method to integrate these business modules into our project.


Thanks for the reply, it occurred to me while writing the reply that we should really put our generic modules on the package management server and then create separate solutions for different businesses

The repository has not been updated for a long time because it currently includes some business modules 😅

Piedone commented 6 months ago

OK then! BTW we use submodules in a similar way in this solution too: https://github.com/Lombiq/Open-Source-Orchard-Core-Extensions.

hyzx86 commented 6 months ago

Yeah, I've seen this project, too 🤣

Mention this, because accessing github from China is a bit of a hassle, I made an OC mirror repository here

https://gitee.com/orchardcore