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

[TRP-62] Kitchen Sink Wishlist #1254

Closed
10 of 25 tasks
KATT opened this issue Nov 12, 2021 · 16 comments
Closed
10 of 25 tasks

[TRP-62] Kitchen Sink Wishlist #1254

KATT opened this issue Nov 12, 2021 · 16 comments
Assignees
Labels
📚 documentation / examples Improvements or additions to documentation 💸 Get paid! I'll send you money through your GitHub sponsors for addressing this 👉 good first issue Good for newcomers 🙋‍♂️ help wanted Extra attention is needed

Comments

@KATT
Copy link
Member

KATT commented Nov 12, 2021

Kitchen Sink

The goal of the Kitchen Sink is to provide a good collection of useful design patterns when working with tRPC. It should be easy to navigate kitchen-sink.trpc.io and have it as a reference site — the northern star would be the Tailwind Docs.

I will probably replace the main website with this site & I want to experiment with monetization. Maybe this could be the "tailwindui" of trpc.

Wishlist

Overall site improvements

  • Nicer home page
  • Nicer code example pages
  • Interactive code examples with Monaco or similar
  • Implement code syntax highlighter for source code
  • Copy to clipboard
  • Nicer view, sort of (preview/code tab bar?)
  • Link / embed / generate codesandbox on each example?
  • Maybe some nicer way of handling features? Some code generation to make it easier to work on one feature in isolation?
  • Login with GitHub

Features

  • getStaticProps 🎉 Implemented
    • Basic examples
    • Improve with splitting up into a "list" page and a [id].tsx page
  • getServerSideProps
  • Infinite queries
  • Paginated pages
  • Optimistic prefetching
  • Good patterns with Suspense
  • Error handling
  • Integration with react-hook-form - 🎉 Implemented
    • Reusing validation schema server/client
    • Invalidate queries
  • API response caching
  • QueryCell pattern - (add query cell pattern #1734)
  • Integration testing
  • User auth
  • ... + 🙏 ideas welcome!

Stretch goals

  • Make this into the actual trpc.io main site?
  • Potentially I'll limit view of examples to contributors & sponsors - maybe it's possible to make money off OSS?

How to contribute

Clone and start the Kitchen sink:

git clone [email protected]:trpc/trpc.git
cd trpc/examples/kitchen-sink
yarn && yarn dx

Adding an example

  1. Create a new folder in src/feature/X by duplicating some of the existing ones
  2. Update meta.tsx
  3. Create a new page in src/pages/X and import the file
  4. Import the router from your example in src/server/routers/_app.ts

TRP-62

@KATT KATT added 📚 documentation / examples Improvements or additions to documentation 👉 good first issue Good for newcomers labels Nov 12, 2021
@KATT KATT self-assigned this Nov 12, 2021
@KATT KATT pinned this issue Nov 13, 2021
@KATT KATT added the 🙋‍♂️ help wanted Extra attention is needed label Nov 13, 2021
@waptik

This comment has been minimized.

@KATT

This comment has been minimized.

@waptik

This comment has been minimized.

@G3root

This comment has been minimized.

@KATT

This comment has been minimized.

@G3root

This comment has been minimized.

@KATT
Copy link
Member Author

KATT commented Nov 16, 2021

i like to work on home page redesign, is there any mockup or a design ?

Hey @G3root! Thanks so much for the offer -- I'll try to make a mockup this week :)

Do you have any example sites in mind ?

Sites I think are nice -- shows code and are quite interactive and clear

@merelinguist
Copy link

Copy to clipboard closed by trpc/examples-kitchen-sink#3

I’m working on codesandbox links and almost done.

@alpacaaa

This comment has been minimized.

@KATT

This comment has been minimized.

@ShiftySlothe
Copy link

I'm working on basic examples of:

  • User auth with next-auth
  • Suspense examples
  • Error handling

@KATT
Copy link
Member Author

KATT commented Jan 25, 2022

I'm working on basic examples of:

  • User auth with next-auth
  • Suspense examples
  • Error handling

Wow, thanks! Note that Suspense have a bug in combo with @trpc/next right now that I noticed yesterday (#1448)

@trpc trpc deleted a comment from allcontributors bot Jan 25, 2022
@KATT KATT added the 💸 Get paid! I'll send you money through your GitHub sponsors for addressing this label Mar 6, 2022
@KATT KATT unpinned this issue Apr 7, 2022
@mrcampbell
Copy link

I'd love to contribute! I'm afk, but will check tonight.

But is there a way to do websockets with rooms/wildcard routes?

Like have a chatroom example where there are trpc routes like

chat.room.*.comments
Where this resolver would return the data based on specific rooms, like chat.room.room42.comments, where only those who can see room42 can pub/sub to that room, and concurrently, there could be room73, room99, etc.?

@KATT
Copy link
Member Author

KATT commented Jun 18, 2022

@mrcampbell

I'd love to contribute! I'm afk, but will check tonight.

🙏

But is there a way to do websockets with rooms/wildcard routes?

Please post these in the discussions or in discord as it's off-topic here, but I'll answer anyway :)

Like have a chatroom example where there are trpc routes like

chat.room.*.comments Where this resolver would return the data based on specific rooms, like chat.room.room42.comments, where only those who can see room42 can pub/sub to that room, and concurrently, there could be room73, room99, etc.?

You can do:

  • chat.room.byId({ id: 1 }) for the room, and
  • chat.comments.byRoomId({ id: 1 }) for the room comments
  • chat.stream({ ....... }) if it's my own stream of whatever stuff I'm subscribed to

@mrcampbell
Copy link

mrcampbell commented Jun 18, 2022 via email

@KATT KATT added the ❄️ icebox features / PRs that might be pick up in the future and can be handy to keep track of label Aug 11, 2022
@KATT KATT closed this as not planned Won't fix, can't repro, duplicate, stale Aug 11, 2022
@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
@KATT KATT reopened this Dec 16, 2022
@KATT KATT removed the ❄️ icebox features / PRs that might be pick up in the future and can be handy to keep track of label Dec 16, 2022
@KATT KATT added the linear label May 25, 2023
@KATT KATT changed the title Kitchen Sink Wishlist [TRP-62] Kitchen Sink Wishlist May 25, 2023
@KATT KATT added linear and removed linear labels May 25, 2023
@KATT KATT closed this as not planned Won't fix, can't repro, duplicate, stale May 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
📚 documentation / examples Improvements or additions to documentation 💸 Get paid! I'll send you money through your GitHub sponsors for addressing this 👉 good first issue Good for newcomers 🙋‍♂️ help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

7 participants