Enable the initialization using argument passing style in addition to the callback style configuration.#282
Conversation
the callback style configuration.
2a8b12e to
5cb71c7
Compare
|
@metlos if we do this there's no way anymore to run code on the object before we give the user a chance to change things. So to know in what is framework config vs user config becomes more complicated. |
So basically you need to distinguish between Sentry framework config vs user config? So what about just using 2 different objects for that? |
|
@metlos everything gets set to an instance of So if the frameworks read a JSON config and binding the values to |
|
Ok, let's keep this PR open and I'll try to come up with a reasonably "natural" of doing things in Spring that would not require this change. If I am not able to come with something similar to what we have in |
bruno-garcia
left a comment
There was a problem hiding this comment.
Leave a review until we make a decision on this.
As per @metlos last comment
📢 Type of change
📜 Description
Currently, Sentry only allows for callback-style initialization using
OptionsConfigurationinterface passed into theSentry.init()methods. This PR makes available to users also the initialization method that merely accepts theSentryOptionsinstance.Additionally, I've removed the unnecessary generic parameter on the
initmethod that was made public, because it naturally accepts any subclass ofSentryOptionsjust by inheritance rules.💡 Motivation and Context
The callback-based initialization is limiting in the injection-based environments like Spring or CDI where instances are produced and injected rather than modified through a callback.
💚 How did you test it?
N/A
📝 Checklist