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

docs(digging-deeper:tuyau): first draft of documentation #194

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

RomainLanz
Copy link
Member

@RomainLanz RomainLanz commented Feb 10, 2025

Hey! 👋🏻

This PR adds the documentation for the Tuyau package.

The following are still missing:

  • InferRequest / InferResponse
  • $current, $has methods
  • Filtering of generated types/routes
  • Some notes or tips on improving type-safety (e.g., DTOs, presenters, viewmodels)

Additionally, the current Tuyau documentation includes a brief section on Next.js, which acts more like a tutorial for building a monorepo with Next.js, AdonisJS, and Tuyau for type-safe client-side development. I think this content would be better suited as an article for our blog, which we could link to from the documentation.

@Julien-R44
Copy link
Member

Thankssss

was wondering, what about adding a new "RPC" section in the sidebar that would include “Installation” / “Superjson” / “Inertia” / “RPC client” instead of putting everything on a single page?

"RPC" is probably not the best term, but I don’t have a better idea right now. The thing is, by trying to keep everything on a single page, I feel like we’re leaving out a lot of important information

Also, here are some other things i would love to keep in the docs:

Lemme know your opinions

In your frontend project, create the Tuyau client by importing the API definition:

```ts
import { createTuyau } from '@tuyau/client';
Copy link
Member

Choose a reason for hiding this comment

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

Small nitpick. But we shouldn't have semi-colons in the code examples.

@thetutlage
Copy link
Member

thetutlage commented Feb 11, 2025

A thought.

Instead of having the doc title as "Tayau Client", should we instead write the doc for "Type-safe client" or something similar? This is because, no one will look at the title Tayau and understand what it is. Whereas, seeing a Type-safe client is far more relatable.


### File uploads

When a File instance is passed, Tuyau automatically converts it to a ?`FormData` instance and sets the appropriate headers. The payload is serialized using the `object-to-formdata` package, ensuring that the file is correctly formatted for transmission.
Copy link
Member

Choose a reason for hiding this comment

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

There is a ? before FormData that seems like a typo.

Also, can we link to object-to-formdata package for easier navigation?

@Julien-R44
Copy link
Member

A thought.

Instead of having the doc title as "Tayau Client", should we instead write the doc for "Type-safe client" or something similar? This is because, no one will look at the title Tayau and understand what it is. Whereas, seeing a Type-safe client is far more relatable.

Yeah probably but I’m not sure if "Type-safe client" is the right fit since Tuyau does have a Type-safe RPC/E2E client part, but that’s not all. there’s also our ziggy-like system for frontend URL generation, helpers for Inertia...

But I don’t have a better name to suggest right now 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants