-
Notifications
You must be signed in to change notification settings - Fork 733
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
feat(api): Optionally suppress warning about logger being overwritten #3366
Merged
dyladan
merged 18 commits into
open-telemetry:main
from
SimenB:optionally-suppress-diag-override-warning
Nov 8, 2022
Merged
Changes from 2 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
566e3ec
feat(api): Optionally suppress warning about logger being overwritten
SimenB 170458a
options bag
SimenB c2b8ae2
update types
SimenB f1d3529
changelog
SimenB dc094f0
changelog heading
SimenB f3c52a5
document in api
SimenB ea86043
overload
SimenB 50fed69
move impl
SimenB 0c41666
Revert "move impl"
SimenB aa36510
Merge branch 'main' into optionally-suppress-diag-override-warning
SimenB bb6df0a
no overload
SimenB 2e37304
lint
SimenB 4a4628f
use interface to provide overload
SimenB 598bc1e
Merge branch 'main' into optionally-suppress-diag-override-warning
dyladan 22fe3c4
Update typedoc comments
dyladan 56500bd
Update api/src/diag/types.ts
SimenB f6bec3a
Merge branch 'main' into optionally-suppress-diag-override-warning
dyladan 455e948
Remove optional text
dyladan File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You also need to update the types https://github.com/open-telemetry/opentelemetry-js/pull/3366/files#diff-27d843b1252efc09aad875a53b4b2bb9a4b98180667b1669d46067af08662bedR125
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonder if we want to add a third parameter or make the second parameter an overload?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated the type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
happy to make it an overload if you want? 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are avoiding overloading API methods that need to be implemented in SDK libraries. However, this method is not part of an interface that needs to be implemented in SDKs.
So I believe it would be intuitive to be overloaded as an option bag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the self.logger use is done there intentionally to aid with code minification. what help do you need?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you revert the last commit, you can see the typescript errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The compilation errors can be suppressed if the two method declarations are merged into a single one, e.g.
As for why those methods need to be defined in this non-conventional way, I traced back to #1880 and didn't find an explanation. Maybe @MSNev can chime in and share more about it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I've blocked this PR as we should NOT convert the property into a function as this becomes less compressible through minification.
And then will cause me to re-implement this original change again in the sandbox to have it contributed back here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pattern has major implications on the overall browser bundle sizes (depending on the module format and ES level being targetted). And this is one of the techniques that I WILL be investigating the viability and performing across the entire JS and Contrib codebases in the sandbox (when I get it going -- HOPEFULLY shortly)