Skip to content

feat: Change naming of the api exported from react.tsx (sync) vs server.tsx (async) #2063

Open
@chrisSpotlight

Description

@chrisSpotlight

Is your feature request related to a problem? Please describe.

I'm frustrated when I'm using intellisense to import either iteration of the api object for use with trpc. If you're not paying attention to the import path, you only find out when you start chaining properties whether or not you've imported the correct one. Plus, the file names aren't exactly clear either. One is exported from react.tsx and the other from server.tsx. The server one is pretty straightforward, but React runs on client and server so it's not immediately obvious which one you want to import.

To which an argument could be "just pay attention you cretin". But the whole point of this stack is supposed to be the seamless integrations between tools and convenience/ease of use. This is an inconvenience.

Describe the solution you'd like to see

Rename to something like:

  • apiAsync and apiSync
  • serverSideApi and clientSideApi

Bonus benefit: helps with understanding the server vs client dichotomy of Next.

Describe alternate solutions

Big red warnings and banners in the docs?

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions