-
Notifications
You must be signed in to change notification settings - Fork 74
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
fix: drop ts type inference for event source #706
fix: drop ts type inference for event source #706
Conversation
e383081
to
f6dde47
Compare
f6dde47
to
cdc379e
Compare
@@ -97,7 +97,7 @@ export default class Metrics extends EventEmitter { | |||
|
|||
private url: string; | |||
|
|||
private timer: NodeJS.Timer | undefined; |
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.
how did you find that this needs to change?
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 had to update Node.js types to fix other error
../node_modules/@types/node/module.d.ts:121:13 - error TS2386: Overload signatures must all be optional or required.
121 resolve?(specified: string, parent?: string | URL): Promise<string>;
~~~~~~~
And new types where complaining about NodeJS.Timer
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.
BTW, we should add Node v22 to our test array.
https://nodejs.org/en/about/previous-releases
echo -e "import { Unleash } from 'unleash-client';\nvoid Unleash;\nconsole.log('Hello world');" > src/index.ts | ||
./node_modules/.bin/tsc -b tsconfig.json | ||
|
||
if [ "$(node . 2>&1)" = "Hello world" ]; then |
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 do we need those checks? Isn't checking exit code from tsc to be 0 enough?
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 way we can extend tests, and check if Unleash is reporting errors.
@@ -5105,6 +5107,11 @@ undici-types@~5.26.4: | |||
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" | |||
integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== | |||
|
|||
undici-types@~6.19.2: |
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.
is it from the upgraded @types/node
transitive deps?
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.
yes
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.
IMO, everything in a test-package required a README explaining why it exists, what problem is solves and what we're checking (since we can't add inline comments in JSON files).
About the changes
Closes #705
Internal ticket: issue/1-3339/node-sdk-missing-dependency-for-types