Closed
Conversation
Contributor
size-limit report
|
197701b to
4b2082b
Compare
Contributor
Author
|
We are closing this PR as the bundle savings are low, and it doesn't necessarily justify the impact from removing a method from |
Member
|
Heh. You beat me to it. I agree that this is a good pattern for the other indirection changes we want to make, so let's bookmark it and we can come back to it then. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR removes the dynamic dispatch of
_invokeClientin favour of explicitly using client methods. We introduce a_withClienthelper that does this._withClientgrabs the client and scope from the stack of scopes on the hub, and executes a callback with those values. This allows the consumer of the function to directly access the client instance and call methods on it.There are a couple consequences of this change
Although the savings are low here (around
0.7 kbbundle improved), it also helps us see how we can address refactoringcallOnHub.It's important to note that this is a breaking change as we are removing the
_callOnClientpublic method exported from@sentry/minimal, so I'm going to apply a blocked label on this until we get consensus. One thing to note here is that is is both@hiddenand prefixed with_, so it clearly seems like an internal SDK api. In addition, it seems that with Electron v3, there are no external consumers of the_callOnClientfunction (no internal consumers either)