[Request] Allow self-registration of handlers, etc.
See original GitHub issueDescription
Imagine a library with a big amount of handlers, effects, etc.
- If a client-dev wants to use the components - he needs to put a lot of code in the CreateMauiApp() method. If the client-dev uses a NuGet - it will not be obvious that there is an additional step he needs to do to get the components working.
- We can implement a single
UseLibrary()
extension method, but there are huge consequences for using such an approach. The problem is as follows - in the UseLibrary() method, we need to register everything - all handlers, renderers, effects, everything. Now the linker will not be able to strip away unused code - even if the client-dev uses only a couple of our controls. - It will be very useful if we can introduce a property in the MauiApp class that will allow to dynamically register a handler. For example, the static constructor of a Component1 can execute a call like MauiApp.Current.TryAddHandler(Component1, Component1Handler). This way if a client-dev uses Component1 - the handler will be registered automatically. If the client-dev does not use it - the linker would be able to properly strip away the component and the handler. Note that the name of the method is TryAddHandler() - so it can check if a handler was already registered for this type and not overwrite it.
Public API Changes
We have to analyze possibilities to allow this.
Intended Use-Case
MauiApp.Current.TryAddHandler(Component1, Component1Handler)
Issue Analytics
- State:
- Created a year ago
- Reactions:15
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Self Registration Configuration
Self registration in midPoint provides possibility for unauthenticated user to enroll to midPoint and request assignments. By default, self ...
Read more >Pattern: Self Registration
A service instance that is running yet unable to handle requests will often lack the self-awareness to unregister itself from the service registry....
Read more >Authentication FAQ
General Questions. What is an authentication plugin? An authentication plugin is a method of handling user authentication to Moodle when ...
Read more >Configure Your Self-Registration Page
Under Registration Page Configuration, select Allow customers and partners to self-register. If users attempt to register with a duplicate username, they ...
Read more >Self registration does not work - Installation Issues
self-registration was working for us, but it suddenly stopped. ... [WARN] The passbolt config file is missing in /etc/passbolt/
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I support this 1000%. I’m already time after time again seeing people not understanding why our controls don’t work, simply because they didn’t know they needed to call some obscure UseXxx() method in the builder. While I get the technical reason for it, it is incredibly developer unfriendly for 3rd party component customers.
We’ve added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.