Skip to content

Decouple @trpc/server from node #1597

Closed
Closed

Description

@KATT

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.

Activity

  1. added this to the milestone on Mar 6, 2022
  2. KATT commented on Mar 6, 2022

    @KATT
    MemberAuthor
  3. self-assigned this
    on Mar 31, 2022
  4. KATT commented on Apr 1, 2022

    @KATT
    MemberAuthor

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

  5. removed this from the milestone on Apr 11, 2022
  6. linked a pull request that will close this issuerewrite subscriptions with observables #1784on May 13, 2022
  7. linked a pull request that will close this issueadd fetch adapter #1852on May 13, 2022
  8. sachinraja commented on May 16, 2022

    @sachinraja
    Member

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

  9. Repository owner moved this from 🤔 Maybe / Nice to have to ✅ Done in Roadmap and prioritieson May 16, 2022
  10. github-actions commented on Oct 4, 2022

    @github-actions
    Contributor

    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.

  11. locked as resolved and limited conversation to collaborators on Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

⏭ major bump needed

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions