Skip to content

fix(node): Make fastify types more broad #11544

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

Merged
merged 3 commits into from
Apr 12, 2024
Merged

Conversation

AbhiPrasad
Copy link
Member

As per #4784 (comment)

make sure fastify types use any is that we don't collide with what fastify types expect.

Also convert e2e tests to use typescript to validate build.

@AbhiPrasad AbhiPrasad requested review from a team, stephanie-anderson and Lms24 and removed request for a team April 10, 2024 21:24
@AbhiPrasad AbhiPrasad self-assigned this Apr 10, 2024
Copy link
Contributor

github-actions bot commented Apr 10, 2024

size-limit report 📦

Path Size
@sentry/browser 22.13 KB (0%)
@sentry/browser (incl. Tracing) 31.7 KB (0%)
@sentry/browser (incl. Tracing, Replay) 67.02 KB (0%)
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 60.43 KB (0%)
@sentry/browser (incl. Tracing, Replay with Canvas) 70.86 KB (0%)
@sentry/browser (incl. Tracing, Replay, Feedback) 80.75 KB (0%)
@sentry/browser (incl. Feedback) 35.69 KB (0%)
@sentry/browser (incl. Feedback, Feedback Modal) 35.69 KB (0%)
@sentry/browser (incl. Feedback, Feedback Modal, Feedback Screenshot) 37.72 KB (0%)
@sentry/browser (incl. sendFeedback) 26.93 KB (0%)
@sentry/react 24.81 KB (0%)
@sentry/react (incl. Tracing) 34.6 KB (0%)
@sentry/vue 25.68 KB (0%)
@sentry/vue (incl. Tracing) 33.41 KB (0%)
@sentry/svelte 22.26 KB (0%)
CDN Bundle 24.27 KB (0%)
CDN Bundle (incl. Tracing) 32.74 KB (0%)
CDN Bundle (incl. Tracing, Replay) 66.39 KB (0%)
CDN Bundle (incl. Tracing, Replay, Feedback) 82.56 KB (0%)
CDN Bundle - uncompressed 72.22 KB (0%)
CDN Bundle (incl. Tracing) - uncompressed 98.2 KB (0%)
CDN Bundle (incl. Tracing, Replay) - uncompressed 207.86 KB (0%)
@sentry/nextjs (client) 33.98 KB (0%)
@sentry/sveltekit (client) 32.21 KB (0%)
@sentry/node 120.19 KB (0%)

register: (plugin: unknown) => void;
addHook: (hook: string, handler: (request: unknown, reply: unknown, error: Error) => void) => void;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
register: (plugin: any) => void;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make these unknown instead? That forces us to check the things, which I guess is the safer approach? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we use unknown the types don't line up, that's why we switched to any

see:
image

@AbhiPrasad AbhiPrasad force-pushed the abhi-fastify-ts-types branch from 8bf28cf to 01c4ff8 Compare April 11, 2024 19:22
@stephanie-anderson stephanie-anderson removed their request for review April 12, 2024 10:15
@AbhiPrasad AbhiPrasad merged commit 20706b8 into develop Apr 12, 2024
78 checks passed
@AbhiPrasad AbhiPrasad deleted the abhi-fastify-ts-types branch April 12, 2024 13:42
cadesalaberry pushed a commit to cadesalaberry/sentry-javascript that referenced this pull request Apr 19, 2024
As per
getsentry#4784 (comment)

make sure fastify types use any is that we don't collide with what
fastify types expect.

Also convert e2e tests to use typescript to validate build.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants