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.23k stars 2.34k forks source link

Remove dependency on OrchardCore.Abstractions from OrchardCore.ResourceManagement #11576

Open sebastienros opened 2 years ago

sebastienros commented 2 years ago

@sebastienros the reason OrchardCore.ResourceManagement depends on OrchardCore.Abstractions is because of IOrchardHelper extension

If we removed the dependency, where would you relocate the ResourceUrl() extension to?

Also, where would be the best place to move ResourceDebugMode? Perhaps OrchardCore.Abstractions?

Originally posted by @CrestApps in https://github.com/OrchardCMS/OrchardCore/issues/11423#issuecomment-1104527904

sebastienros commented 2 years ago

I think we need to introduce a new project OrchardCore.ResourceManagement.Core that will contain the logic and is reusable in ASP.NET. Then the OrchardCore.ResourceManagement project is the module that will bind it to OrchardCore and the settings. The same way OrchardCore.Localization.Core is used by ASP.NET without a dependency on other things.

MikeAlhayek commented 2 years ago

I think we need to introduce a new project OrchardCore.ResourceManagement.Core that will contain the logic and is reusable in ASP.NET. Then the OrchardCore.ResourceManagement project is the module that will bind it to OrchardCore and the settings. The same way OrchardCore.Localization.Core is used by ASP.NET without a dependency on other things.

@sebastienros

Thanks for the feedback. Another issue is that ISite depends on ResourceDebugMode

Should we change the type of ResourceDebugMode property to string in ISite? Or, should we move ResourceDebugMode to the new OrchardCore.ResourceManagement.Core and then add reference for OrchardCore.ResourceManagement.Core to OrchardCore.Infrastructure.Abstractions? I am not sure adding more dependency to OrchardCore.Infrastructure.Abstractions is a good idea. Perhaps you have better idea for ISite.

Skrypt commented 2 years ago

Yes move it to OrchardCore.ResourceManagement.Core

MikeAlhayek commented 2 years ago

Yes move it to OrchardCore.ResourceManagement.Core

OrchardCore.ResourceManagement.Core was added into PR #11569