Use WebRootFileProvider to load in package manifests - reducing boilder plate code for RCL packages #12423
KevinJump
started this conversation in
Features and ideas
Replies: 1 comment
-
I think the reasonable thing to do here is to:
Edit: Alternatively separate out the parsing from the IO, have an additional interface for Edit 2: I think I like both ideas combined a ManifestParser and a ManifestLoader both in |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Similar to #12313
If you are using a Razor Class Library (RCL) for your package, the
package.manifest
file is not automatically loaded by Umbraco, and you have to load it via code in your library.If we could use a
IFileProvider
when loading the packages in theapp_plugins
folder, there wouldn't be the requirement for people to have to write boiler plate code to initialize their package manifests.At the moment you had to either define a
IManifestFilter
in code and add it via a composeror embed the package.manifest as a resource in your project, load it and parse it again in a composer.
if the
package.manifest
could be read directly from RCL 'app_plugins' folders this would make this step redundant. and mean we could have 'no-code' packages using the RCL pattern.Change required:
I think the the only change required is to the
GetManifestFiles
method in the Manifest parser.https://github.com/umbraco/Umbraco-CMS/blob/v10/dev/src/Umbraco.Infrastructure/Manifest/ManifestParser.cs#L201-L209
Something similar to the code used in the Lang file PR (not this isn't tested just example of change)
Only issue is like with the Lang files, the Manifest parser is currently in the Infrastructure project and we can't inject
IWebHostEnvironment
into the parser where it is.Not sure what the options should be here, but happy to do the PR if someone can tell me what if anything should be done/moved.
Beta Was this translation helpful? Give feedback.
All reactions