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

Add additional JSDoc comments to commonly used APIs for better API reference and in-editor documentation. #12975

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

alexanderson1993
Copy link
Contributor

Many of the comments were pulled from the Remix documentation, adjusted as I thought was necessary. There might be some nuance that I missed, but I think I got it all right.

Copy link
Contributor

@brophdawg11 brophdawg11 left a comment

Choose a reason for hiding this comment

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

Thank you for this!

@@ -109,11 +114,31 @@ type _CreateActionData<ServerActionData, ClientActionData> = Awaited<
>

type ClientDataFunctionArgs<T extends RouteInfo> = {
/** A {@link https://developer.mozilla.org/en-US/docs/Web/API/Request Fetch Request instance} which you can use to read headers (like cookies, and {@link https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams URLSearchParams} from the request. */
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is a request created on the client it won't have the same headers/cookie access the server request has. We should either call that out or just don't specifically mention those and instead refer to the commonly used client-side aspects like request.url

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm... This type is used as the basis for ServerDataFunctionArgs. Does it make sense to define request separately on both of them so the docs can be specific to each?

Also, do you know what properties would be available on request for client data functions? I can't seem to find the place where the request object is generated for client data functions.

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

Successfully merging this pull request may close these issues.

2 participants