Skip to content

Invoke configOptions callback directly to derive event binders during Maui init #4216

Closed

Description

@jamescrosswell

For context see:

We can address all of Allan's concerns by using the second method from the benchmark fork:

case RegisterEventBinderMethod.InvokeConfigOptions:
var options = new SentryMauiOptions();
configureOptions?.Invoke(options);
services.TryAddSingleton<SentryOptions>(options); // Ensure this doesn't get resolved again in AddSentry
foreach (var eventBinder in options.DefaultEventBinders)
{
eventBinder.Register(services);
}
break;

That way people still setup the new integration as an extension on SentryOptions (i.e. from within the call to UseSentry) and we don't build a service provider to resolve the options. The time required to do this would be absolutely trivial, regardless of the container technology that people have chosen... and we can do this without creating any extra benchmarks.

Activity

  1. added a commit that references this issue on May 24, 2025
    01c74e0
  2. added a commit that references this issue on May 25, 2025
    b97aec8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions