Skip to content
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(server): delete the @trpc/core-package #5355

Merged
merged 50 commits into from
Jan 19, 2024
Merged

Conversation

KATT
Copy link
Member

@KATT KATT commented Jan 18, 2024

@trpc/core was a nice idea but the ecosystem doesn't seem ready for it.

Especially with the combination of pnpm monorepos + TypeScript where it's tough not to get "The inferred type of 'xxxx' cannot be named without a reference to '.pnpm/@trpc+core@[.....]'. This is likely not portable. A type annotation is necessary"-style errors.

🎯 Changes

  • Move @trpc/core back into the server-package
  • Move @trpc/server/observable out of core again since it's so isolated it could even be its own dedicated package
  • Add new @trpc/server/unstable-core-do-not-import-export which should dissuade people not to use things from that entry point

References

Copy link

vercel bot commented Jan 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
next-prisma-starter ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 19, 2024 2:08pm
og-image ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 19, 2024 2:08pm
trpc-next-app-dir ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 19, 2024 2:08pm
www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 19, 2024 2:08pm

Copy link

github-actions bot commented Jan 18, 2024

Diagnostics Comparison

Numbers

Metric PR next
Files 773 775 (🔽🟢 -2)
Lines of Library 40,241 40,241 (➖ 0)
Lines of Definitions 119,734 119,736 (🔽🟢 -2)
Lines of TypeScript 4,867 4,867 (➖ 0)
Lines of JavaScript 0 0 (➖ 0)
Lines of JSON 0 0 (➖ 0)
Lines of Other 0 0 (➖ 0)
Identifiers 175,860 175,852 (🔺 8)
Symbols 109,508 109,497 (🔺 11)
Types 89 89 (➖ 0)
Instantiations 0 0 (➖ 0)
Memory used 173,744 176,290 (🔽🟢 -2,546)
Assignability cache size 0 0 (➖ 0)
Identity cache size 0 0 (➖ 0)
Subtype cache size 0 0 (➖ 0)
Strict subtype cache size 0 0 (➖ 0)

Timings and averages

Metric PR next
max (s) 4.773 4.529 (🔺 0.24)
min (s) 4.773 4.529 (🔺 0.24)
avg (s) 4.773 4.529 (🔺 0.24)
median (s) 4.773 4.529 (🔺 0.24)
length 1 1 (➖ 0)
unstable timings

Unstable

Timings are not reliable in here

Metric PR next
I/O Read time 0.04 0.04 (➖ 0)
Parse time 0.73 0.72 (🔺 0.01)
ResolveTypeReference time 0.03 0.03 (➖ 0)
ResolveModule time 0.1 0.12 (🔽🟢 -0.02)
ResolveLibrary time 0.02 0.02 (➖ 0)
Program time 1.06 1.06 (➖ 0)
Bind time 0.44 0.48 (🔽🟢 -0.04)
Total time 1.5 1.54 (🔽🟢 -0.04)

This reverts commit 7a08201.
Maybe,
TRPCErrorResponse,
TRPCInferrable,
} from '@trpc/server/unstable-core-do-not-import';
import {
getCauseFromUnknown,
isObject,
type DefaultErrorShape,
Copy link
Member

Choose a reason for hiding this comment

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

thy is this not getting moved by the linter to the type imports?

Copy link
Member Author

Choose a reason for hiding this comment

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

unsure, but it'll get fixed automatically once prettier updates :D

"pipeline": {
"codegen-entrypoints": { "outputs": ["package.json", "links/**"] }
}
"pipeline": { "codegen-entrypoints": { "outputs": ["package.json"] } }
Copy link
Member

Choose a reason for hiding this comment

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

why was this changed?

Copy link
Member

Choose a reason for hiding this comment

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

should there not be a /links sub-entrypoint anymore?

Copy link
Member Author

Choose a reason for hiding this comment

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

We don't need it - you can just import from @trpc/client instead

Copy link
Member

Choose a reason for hiding this comment

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

these file paths looks very strange..
CleanShot 2024-01-19 at 13 13 48

Copy link
Member Author

Choose a reason for hiding this comment

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

I just want them to be clear to guide adapters -- people generally look at the adapters for reference. Maybe I overdid it here?

Copy link
Member

Choose a reason for hiding this comment

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

I’d lean that way and just use the index route. As long as we have named exports in /index.ts we can make sure to only use publically available stuff anyways

Copy link
Member Author

Choose a reason for hiding this comment

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

Alright, I'll just merge this for now so we can draw a line in the sand, but let us do that in a follow-up

Copy link
Member

Choose a reason for hiding this comment

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

Or maybe even make new packages for each? @trpc/adapter-fetch etc?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, that'd be even nicer - so much boilerplate though 😅

Copy link

This pull request has been locked because we are very unlikely to see comments on closed issues. If you think, this PR is still necessary, create a new one with the same branch. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants