pingdotgg / uploadthing

File uploads for modern web devs
https://uploadthing.com
MIT License
4.26k stars 315 forks source link

docs: add link to FileRoute API in copy-pasteable code block #1060

Closed juliusmarminge closed 4 days ago

juliusmarminge commented 5 days ago

Since we've concluded people don't read the docs and just copy-paste the snippets (the link to the API referncce is literally the last word before the code block), including it in the actual code seems like a good shout to perhaps increase the chance they'll click it when they wanna make some changes - who knows...

Summary by CodeRabbit

Release Notes

changeset-bot[bot] commented 5 days ago

⚠️ No Changeset found

Latest commit: 00c1d8167c12dba8e5566c1311838d534961adbd

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

coderabbitai[bot] commented 5 days ago

Walkthrough

The changes involve extensive updates to the documentation for the UTApi TypeScript SDK and various backend adapters. Key modifications include enhancements to the UTApi constructor, clarifications on configuration options, and the introduction of a maxFileCount property across multiple documentation files. These updates aim to improve the clarity and usability of the documentation for developers integrating UploadThing into their applications.

Changes

File Path Change Summary
docs/src/app/(docs)/api-reference/ut-api/page.mdx Updated UTApi constructor to accept options; clarified configuration process; expanded properties section with detailed descriptions; documented methods and deprecations.
docs/src/app/(docs)/backend-adapters/express/page.mdx Updated maxFileCount from 4 to 1; added comments for FileRoutes configuration; clarified input validation options.
docs/src/app/(docs)/backend-adapters/fastify/page.mdx Updated maxFileCount from 4 to 1; added comments for FileRoutes configuration; highlighted input validation and middleware options.
docs/src/app/(docs)/backend-adapters/fetch/page.mdx Updated maxFileCount from 4 to 1; added comments for FileRoutes configuration; expanded section on Cloudflare Workers compatibility.
docs/src/app/(docs)/backend-adapters/h3/page.mdx Updated maxFileCount from 4 to 1; added comments for FileRoutes configuration; emphasized unique route slugs and options reference.
docs/src/app/(docs)/getting-started/appdir/page.mdx Added maxFileCount to imageUploader; emphasized onUploadComplete callback; expanded setup instructions and SSR guidance.
docs/src/app/(docs)/getting-started/astro/page.mdx Added maxFileCount to imageUploader; emphasized client-side validation; refined documentation structure.
docs/src/app/(docs)/getting-started/expo/page.mdx Added maxFileCount to imageUploader; updated route slug; clarified FileRoute options.
docs/src/app/(docs)/getting-started/nuxt/page.mdx Introduced maxFileCount for imageUploader; emphasized exporting the router; clarified input validation and middleware sections.
docs/src/app/(docs)/getting-started/pagedir/page.mdx Added maxFileCount and input validation to imageUploader; emphasized middleware function and upload completion callback.
docs/src/app/(docs)/getting-started/remix/page.mdx Added maxFileCount to imageUploader; emphasized optional input validation; updated code snippets for clarity.
docs/src/app/(docs)/getting-started/solid/page.mdx Added maxFileCount to imageUploader; emphasized input validation and middleware; refined documentation structure.
docs/src/app/(docs)/getting-started/svelte/page.mdx Added maxFileCount to imageUploader; emphasized onUploadComplete callback and middleware; enhanced clarity in setup instructions.
docs/src/app/(docs)/getting-started/tanstack-start/page.mdx Added maxFileCount to imageUploader; included optional input validation; improved formatting and organization of content.

Possibly related PRs

Suggested labels

examples

🐰 In the meadow, where the code does play,
New options sprout, brightening the way.
With maxFileCount now set to one,
Documentation shines, oh what fun!
Hop along, dear devs, to explore and delight,
With clearer paths, your projects take flight! 🌼✨


📜 Recent review details **Configuration used: CodeRabbit UI** **Review profile: CHILL**
📥 Commits Reviewing files that changed from the base of the PR and between d3899fe4f66518c87dd10723144607859eb9d739 and 00c1d8167c12dba8e5566c1311838d534961adbd.
📒 Files selected for processing (1) * `docs/src/app/(docs)/api-reference/ut-api/page.mdx` (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1) * docs/src/app/(docs)/api-reference/ut-api/page.mdx

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?

❤️ Share - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)
🪧 Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit , please review it.` - `Generate unit testing code for this file.` - `Open a follow-up GitHub issue for this discussion.` - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit testing code for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.` - `@coderabbitai read src/utils.ts and generate unit testing code.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` - `@coderabbitai help me debug CodeRabbit configuration file.` 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) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai full review` to do a full review from scratch and review all the files again. - `@coderabbitai summary` to regenerate the summary of the PR. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository. - `@coderabbitai help` to get help. ### Other keywords and placeholders - Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. - Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description. - Add `@coderabbitai` anywhere in the PR title to generate the title automatically. ### CodeRabbit Configuration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information. - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json` ### Documentation and Community - Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit. - Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.
vercel[bot] commented 5 days ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs-uploadthing ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 20, 2024 3:32pm
1 Skipped Deployment | Name | Status | Preview | Comments | Updated (UTC) | | :--- | :----- | :------ | :------- | :------ | | **legacy-docs-uploadthing** | ⬜️ Ignored ([Inspect](https://vercel.com/pinglabs/legacy-docs-uploadthing/EHNeiT1HoDcLEq2q8Yb7VxF3gcZD)) | [Visit Preview](https://legacy-docs-uploadthing-git-filecount-in-gettin-e700f0-pinglabs.vercel.app) | | Nov 20, 2024 3:32pm |
github-actions[bot] commented 5 days ago

📦 Bundle size comparison

Bundle Size (gzip) Visualization
Main 27.59KB See Treemap 📊
PR (828493c4105ad0385edb73c4b93349928dc523d5) 27.59KB See Treemap 📊
Diff No change
pkg-pr-new[bot] commented 4 days ago

Open in Stackblitz

More templates

- [@example/minimal-appdir](https://pkg.pr.new/template/4bdc1867-b117-4dc9-b74b-e6c37af05305) - [@example/minimal-astro-react](https://pkg.pr.new/template/ea5c1792-fe04-4801-8e09-8864d3d39051) - [@example/minimal-expo](https://pkg.pr.new/template/a3345495-3277-4b68-a506-98eb3f088fe7) - [@example/minimal-nuxt](https://pkg.pr.new/template/1ea33680-16e3-495f-9166-0506c5ff3aa9) - [@example/minimal-pagedir](https://pkg.pr.new/template/a134041a-d360-4017-9dd7-f9bb0f7efefd) - [@example/minimal-solidstart](https://pkg.pr.new/template/edf081ee-73cf-4fc1-89b5-937f0c8417ae) - [@example/minimal-tanstack-start](https://pkg.pr.new/template/59236a44-8fd4-400a-8eb3-f95a7ab26205) - [@example/minimal-sveltekit](https://pkg.pr.new/template/a8591634-c46b-4dc3-bd03-2f10e648ec4c)

pnpm add https://pkg.pr.new/pingdotgg/uploadthing@1060

commit: 00c1d81