-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
fix: ignore missing @opentelemetry/api (#14774) #14848
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
Closed
Closed
Changes from 7 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
d7561a9
fix: ignore missing @opentelemetry/api (#14774)
james-pre 6dfa754
Added changeset
james-pre ee52ffc
Actually added changeset
james-pre cf731f4
Update .changeset/fuzzy-lies-begin.md
james-pre 4e32ec0
Bare minimum type stubs
james-pre 2f5aff0
Automatic formatting
james-pre aba4122
Fix missing @opentelemetry/api types, for real this time
james-pre e47e9d6
Automatic prepublishOnly
james-pre d40b81a
Ignore augmentation issues with otel
james-pre b1d2e87
Hopefully fix missing property errors
james-pre 02ee92a
Fix where otel is ignored
james-pre c83f9f3
Automatic prepublishOnly
james-pre File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@sveltejs/kit': patch | ||
| --- | ||
|
|
||
| fix: ignore TypeScript errors when `@opentelemetry/api` is not installed |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| /* Users may not have this package installed, this prevents errors when using `tsc` without it. */ | ||
| /* eslint-disable @typescript-eslint/no-empty-object-type */ | ||
|
|
||
| export interface Span {} | ||
|
|
||
| export interface Tracer {} | ||
|
|
||
| export interface SpanContext {} | ||
|
|
||
| export interface PropagationAPI {} | ||
|
|
||
| export interface ContextAPI {} |
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
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
I've tried this but I think it removes the autocomplete for users when they do have
@opentelemetry/apiinstalled since these types then override the actual package.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.
It's a trade off. The alternative is that more users can't build at all unless they completely disable type-checking libraries. If there is a way to get autocomplete when it is installed without breaking dependents missing OTEL, I'm all for it.
I've created floating point airthmatic within the type system, yet this somehow is a harder problem...
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.
I wonder if we should conditionally generate the stub by checking if
@opentelemetry/apiis installed 😆 otherwise, getting sveltejs/dts-buddy#110 merged would let us use// @ts-ignoreeven if it's frowned upon in that threadThere 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.
I think that being able to use
@ts-ignorewould be a better and easier solution.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.
@teemingc do you have any plans to merge the dts-buddy PR soon? If not I'd like to get this PR merged since it would fix the bug. We could look into using ts-ignore after your PR is merged.
Uh oh!
There was an error while loading. Please reload this page.
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.
I'd need another maintainer to approve the dts-buddy PR to merge it. Even then, it seems like all the tests are failing after I've merged the
mainbranch. I'll need to take a look at those. cc: @Rich-HarrisEDIT: we can't merge this PR as is because the stubs here will break the TypeScript autocomplete for users who do have otel installed