-
Notifications
You must be signed in to change notification settings - Fork 319
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: Improve documentation of callbackUrl #1073
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
WalkthroughThe changes in this pull request primarily focus on enhancing the documentation for the UploadThing server API. Key updates include the introduction of the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (3)
packages/uploadthing/src/types.ts (1)
49-54
: LGTM! Consider enhancing the documentation with validation guidance.The documentation for
callbackUrl
is clear and well-structured. To make it even more helpful, consider adding:
- Common scenarios where automatic detection might fail (e.g., reverse proxies, serverless environments)
- Validation requirements for the URL (e.g., must be HTTPS, no query parameters)
/** * The full, absolute URL to where your route handler is hosted. UploadThing * attempts to automatically detect this value based on the request URL and * headers. You can override this if the automatic detection fails. + * + * Common scenarios where you might need to set this: + * - When behind a reverse proxy + * - In serverless environments with custom routing + * - When using custom domains + * + * The URL must be: + * - A complete, absolute URL + * - Using HTTPS in production + * - Without query parameters + * * @example URL { https://www.example.com/api/uploadthing } */docs/src/app/(docs)/api-reference/server/page.mdx (2)
225-228
: Enhance the callbackUrl documentation with examples and edge cases.While the current documentation explains the basic purpose, it would be more helpful to include:
- An example of a valid callbackUrl (e.g.,
https://your-domain.com/api/uploadthing
)- Common scenarios where automatic detection might fail (e.g., when behind a proxy)
- Format requirements for the URL (e.g., must be HTTPS in production)
225-228
: Consider reorganizing config parameters by importance.The config parameters section could be better organized by:
- Grouping related parameters (e.g., logging-related parameters together)
- Highlighting required vs optional parameters
- Adding a "Commonly Used" section at the top
This would make it easier for users to find the most relevant configuration options for their use case.
Also applies to: 229-236, 237-244, 245-252, 253-259, 260-266, 267-273
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
docs/src/app/(docs)/api-reference/server/page.mdx
(1 hunks)packages/uploadthing/src/types.ts
(1 hunks)
🔇 Additional comments (2)
packages/uploadthing/src/types.ts (1)
Line range hint 155-164
: LGTM! Well-documented deprecation notice.
The deprecation notice for skipPolling
is clear and helpful:
- Provides clear migration path to
awaitServerData
- Includes example code
- Links to documentation for more details
docs/src/app/(docs)/api-reference/server/page.mdx (1)
Line range hint 1-273
: Documentation changes align well with PR objectives.
The improvements to the callbackUrl documentation and overall structure of the API reference are well done. The documentation is clear, comprehensive, and includes appropriate framework-specific examples.
📦 Bundle size comparison
|
More templates
commit: |
Summary by CodeRabbit
New Features
createUploadthing
andcreateRouteHandler
functions with framework-specific middleware examples.callbackUrl
for route handler configuration.Bug Fixes
skipPolling
property inUploadFilesOptions
with updated guidance for implementation.Documentation
UTApi
andUTFile
classes, including example usage and detailed property descriptions.