-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
chore(gatsby): jaeger-local to TypeScript #23656
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
3a3223c
chore(gatsby): jaeger-local to TypeScript
chooban d5ebb4e
Add interface extension and reason
chooban ae04f78
Remove apparently unused ts-ignore, inlined interface extension
chooban 47adc64
Upgrade types package, and remove interface extension
chooban 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
Add interface extension and reason
- Loading branch information
commit d5ebb4e5e49d00be76313ebc7a5994330d205208
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.
Why there is
// @ts-ignore
?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.
Apologies for the lack of comment. This is because we don't have a dependency on
jaeger-client
as this is an example to be used in other projects. No dependency means we get theCannot find module
error.Thinking about how the file is to be used, it might be a candidate for a
@ts-nocheck
, but if we do migrate it, and types are added, at least we'll get warnings if a jaeger change breaks it. I am now arguing myself in circles!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 could try making
jaeger-client
optional peer dependency ( https://medium.com/@noamgjacobsonknzi/what-is-peerdependenciesmeta-acea887c32dd )This is supported by
yarn@^1.13.0
andnpm@^6.11.0
- worry here is thatnpm@^6.11.0
started shipping with Node.js inNode.js 12.11.0
, so there would be quite a bit of not resolver peer deps warnings if user didn't upgrade npm if they are on earlier node versionsBut also - I removed this
@ts-ignore
locally for testing and didn't see complaints when tryingeslint
andtypecheck
- what am I missing?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.
Do you have
jaeger-client
installed at all? If I doyarn why jaeger-client
I get theWe couldn't find a match
that's expected, thenyarn typecheck
throws an error when I run it. I also get the warning in VS Code, but it's probably safer to just check the official scripts.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 also don't have it installed:
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 am now in the same position as you! I noticed the last push failed typecheck on CI, which surprised me as there'd been no issues locally, so I did
yarn bootstrap; yarn typecheck
just to make sure I wasn't missing anything, and the CI error appeared. Fixed it, removed the ts-ignore in question, and now everything is perfectly happy.I wish I had a longer history set in my terminal so that I could screenshot 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.
Let's see what CI says after last commit you pushed. There just be more to it (or maybe it wasn't
typecheck
that failed?)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 last CI failure was
typecheck
, but was to do with the extended interface I added. BecauseinitTracer
returns aJaegerTracer
object, it was complaining that it didn't match my new interface. Obvious, really, but for some reason I didn't get the failure in VS Code. Thelint-staged
task doesn't trigger on changes to TypeScript files so it wasn't caught by husky.