fix(nextjs): Fix faulty import in Next.js .d.ts#7175
Conversation
Replay SDK metrics 🚀
develop |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Revision | LCP | CLS | CPU | JS heap avg | JS heap max | netTx | netRx | netCount | netTime |
|---|---|---|---|---|---|---|---|---|---|
| e9eec27 | +61.38 ms | -0.00 ms | +6.04 pp | +927.84 kB | +1.05 MB | +2.21 kB | +41 B | +1 | +88.58 ms |
| d604022 | +58.83 ms | -0.00 ms | +7.65 pp | +930.16 kB | +1.05 MB | +2.21 kB | +41 B | +1 | +109.63 ms |
| a961e57 | +54.75 ms | -0.00 ms | +6.50 pp | +929.18 kB | +1.07 MB | +2.21 kB | +41 B | +1 | +92.73 ms |
| f7c0a2f | +46.14 ms | +0.00 ms | +6.37 pp | +921.47 kB | +1.06 MB | +2.23 kB | +41 B | +1 | +207.30 ms |
| cb19818 | +57.16 ms | +0.00 ms | +11.95 pp | +1.07 MB | +2.21 MB | +2.52 kB | +41 B | +1 | +111.50 ms |
| ee301c3 | +71.07 ms | -0.00 ms | +12.64 pp | +1.07 MB | +2.22 MB | +2.55 kB | +41 B | +1 | +94.67 ms |
| 93c4759 | +61.10 ms | -0.00 ms | +12.72 pp | +1.08 MB | +2.19 MB | +2.57 kB | +41 B | +1 | +116.75 ms |
| 274f489 | +63.60 ms | -0.00 ms | +11.56 pp | +1.08 MB | +2.2 MB | +2.56 kB | +41 B | +1 | +116.60 ms |
| 4827b60 | +58.67 ms | +0.00 ms | +18.38 pp | +1.07 MB | +2.22 MB | +2.6 kB | +41 B | +1 | +91.21 ms |
| c3806eb | +79.85 ms | -0.00 ms | +12.10 pp | +1.05 MB | +2.16 MB | +2.54 kB | +41 B | +1 | +93.58 ms |
Last updated: Tue, 14 Feb 2023 13:16:46 GMT
size-limit report 📦
|
|
This is all just a big learning process. Will come in handy when tackling more full-stack frameworks. |
packages/nextjs/src/server/index.ts
Outdated
| import { isBuild } from './utils/isBuild'; | ||
|
|
||
| export * from '@sentry/node'; | ||
| export { Integrations }; |
There was a problem hiding this comment.
why do we have to explicitly export, doesn't the wildcard above take care of this?
There was a problem hiding this comment.
Ah wait I think this is a leftover from messing around... Lemme check if I can remove it or if it breaks again.
There was a problem hiding this comment.
Ok, wasn't needed --> I removed it.
packages/e2e-tests/test-applications/create-next-app/sentry.server.config.ts
Outdated
Show resolved
Hide resolved
…rver.config.ts Co-authored-by: Abhijeet Prasad <aprasad@sentry.io>
AbhiPrasad
left a comment
There was a problem hiding this comment.
Makes sense. I wonder if we should lint for this 🤔
Linting is already pretty strong here - ts does a somewhat good job. The weird thing was just the build output... One thing I had in mind once was having snapshot tests for our type definitions. Every time they change, we should have to sign off in order to ensure no unintended breakage. |
Co-authored-by: Abhijeet Prasad <aprasad@sentry.io>
|
I like the idea of snapshot tests! Let's open a ticket? |
This came up in discord: https://discord.com/channels/621778831602221064/621786575591702529/1074841610753413261
Our Next.js types currently have references to the Node package but the paths in the reference contain our internal build structure which leads to mismatches when you use the package outside of our monorepo.
https://unpkg.com/browse/@sentry/nextjs@7.37.2/types/index.types.d.ts
I didn't know how to fix this properly via settings and stuff but slightly changing how we import things seemed to get rid of these
import()statements.Also added an import that would have failed to our E2E tests.