-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make ResourcesTagHelper extensible #16033
Comments
Please show us an example of a custom resource in which the built-in APIs don't fit nicely |
Earlier I've implemented JS module support for which I introduced Note that I know it works because I've already implemented a simplified version of this in a client project using a dirty workaround. If you are interested, the trick is that I create a new class with the same |
Do you think we'll have to remove the ResourceType enum to use a string instead? The only drawback would be the loss of intellisense. |
No, the |
Is your feature request related to a problem? Please describe.
Right now you can define any custom resource type in the resource manager and this is pretty cool. For example in Lombiq.VueJs we use it to define Vue SFC resources and JS module resources. But there is a huge pain point: the
<resources />
tag helper doesn't support any other resource type besides the built-in ones, so if you add a custom resource type you can require it but it won't be rendered.This leads to a lot of added complexity and additional failure points, because you have to display the resources in weird ways, such as using widgets, custom themes or by injecting the render into the Content zone (since other zones are not guaranteed to exist depending on the theme).
Describe the solution you'd like
To avoid the above mentioned complexity, I propose adding the following interface:
This would be invoked for each implementation at the end of
ResourcesTagHelper.ProcessAsync
. This way anyone can add a custom resource types and render logic without having to do workarounds and it will seamlessly work with all existing styles that use the<resources />
tag helper.The text was updated successfully, but these errors were encountered: