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

Decouple @trpc/server from node #1597

Closed
Tracked by #887
KATT opened this issue Mar 6, 2022 · 4 comments · Fixed by #1727, #1784 or #1852
Closed
Tracked by #887

Decouple @trpc/server from node #1597

KATT opened this issue Mar 6, 2022 · 4 comments · Fixed by #1727, #1784 or #1852
Assignees
Labels
💸 Get paid! I'll send you money through your GitHub sponsors for addressing this ⏭ major bump needed Requires a major version bump

Comments

@KATT
Copy link
Member

KATT commented Mar 6, 2022

Related to the next branch.


Currently, @trpc/server is using a lot of Node-based dependencies, i.e. url, http, etc.

It would be great to decouple @trpc/server completely from a node in order to easier deploy tRPC to i.e. CF workers (#1375).

Proposal

Please DM me on Discord before addressing this, there might be better implementations ideas, below are my first thoughts.

Rough steps:

  • Rename @trpc/server to @trpc/node (and update all examples, etc)
  • Create a new package, @trpc/core
  • Gradually extract all non-node-specific stuff into a package named @trpc/core or similar
    • This requires a lot of refactoring as there are a lot of functions that like resolveHTTPResponse should still exist as part of @trpc/core but with a slightly different signature.
  • For ease of installation, @trpc/node could have a hard dependency (rather than a peerDep) of @trpc/core and export * from '@trpc/core'
  • Make a CF example in the ./examples folder
  • Make deno.land-module
  • This should be done in the next-branch

Payment

I'll pay $200 if someone addresses it. If you think that isn't enough, feel free to contact me. Payment will be through GitHub sponsors - see #1599.

@KATT KATT added ✨ enhancement ⏭ major bump needed Requires a major version bump 💸 Get paid! I'll send you money through your GitHub sponsors for addressing this labels Mar 6, 2022
@KATT KATT added this to the v10 milestone Mar 6, 2022
@KATT
Copy link
Member Author

KATT commented Mar 6, 2022

cc @esamattis @icflorescu

@KATT
Copy link
Member Author

KATT commented Apr 1, 2022

Excited about this! Thanks for taking ownership, @sachinraja!

@sachinraja sachinraja linked a pull request Apr 3, 2022 that will close this issue
@KATT KATT mentioned this issue Apr 10, 2022
60 tasks
@KATT KATT removed this from the v10 milestone Apr 11, 2022
This was linked to pull requests May 13, 2022
@sachinraja
Copy link
Member

Closing this as we've now been able to deploy on CF Workers and Deno

@github-actions
Copy link

github-actions bot commented Oct 4, 2022

This issue has been locked because it had no new activity for 14 days. If you are running into a similar issue, please create a new issue. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
💸 Get paid! I'll send you money through your GitHub sponsors for addressing this ⏭ major bump needed Requires a major version bump
Projects
Archived in project
2 participants