Skip to content
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

Default DotvvmPresenter should not be registered as IDotvvmPresenter #1688

Open
tomasherceg opened this issue Aug 11, 2023 · 0 comments
Open
Labels
Milestone

Comments

@tomasherceg
Copy link
Member

This is just nitpicking and I am not sure if it is even a thing, but we are registering the default DotvvmPresenter as IDotvvmPresenter:
https://github.com/riganti/dotvvm/blob/main/src/Framework/Framework/DependencyInjection/DotVVMServiceCollectionExtensions.cs#L65

I am not sure if someone would implement their own presenter for handling the pages, commands, and static commands. I think we should register it either as DotvvmPresenter (if someone wants to modify it, they'll probably inherit this class anyway). Alternatively, we can let the user specify the default presenter using some other way.

Using IDotvvmPresenter (which is implemented by every presenter) as the service key is confusing, and it breaks everything in case someone accidentally registers the presenter as IDotvvmPresenter without a meaningful error message.
I got reports it happened when someone registered all presenters using Scrutor with AsSelfAndImplementedInterfaces. It is clearly an error, but it is quite difficult to find.

@exyi exyi added this to the Version 5.0 milestone Aug 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants