-
Notifications
You must be signed in to change notification settings - Fork 387
docs: Fixed SolidStart and slightly changed Tanstack/Start #988
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
Warning Rate limit exceeded@juraj98 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 1 minutes and 8 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThe pull request introduces several modifications to the documentation and code related to the SolidStart setup and UploadThing integration. Key changes include renaming types and variables for clarity, updating error handling, and refining installation instructions. The documentation has been reorganized to enhance usability, and examples have been streamlined to better guide users in implementing file upload functionality. Changes
Possibly related PRs
Suggested reviewers
Poem
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: 1
Outside diff range and nitpick comments (5)
docs/src/app/(docs)/getting-started/solid/page.mdx (4)
16-16
: LGTM: Simplified package installationThe removal of 'solidjs-dropzone' from the installation command simplifies the setup process, which is great. This change aligns well with the PR objectives to streamline the documentation.
Consider adding a brief comment explaining why 'solidjs-dropzone' is no longer needed, to provide context for users who might be familiar with older versions of the documentation.
Line range hint
56-69
: LGTM: Improved route naming and middleware clarityThe renaming of 'profileImage' to 'imageUploader' makes the route more generic and potentially more versatile. The adjustments to the middleware function improve readability without altering functionality.
Consider adding a brief comment above the
imageUploader
route to explain its purpose and any restrictions (e.g., "General-purpose image upload route, max 4MB per file").
110-131
: LGTM: Improved component creation guidance and type consistencyThe changes to the UploadThing components creation section are good:
- The emphasis on re-exporting components with assigned types promotes better type safety.
- The updates to use the 'UploadRouter' type are consistent with earlier changes.
These modifications improve the overall quality and consistency of the documentation.
Consider adding a brief example of how to use the
createUploadThing
function, as it's exported but not demonstrated in the current code snippet.
167-175
: LGTM: Helpful example of UploadButton usageThe new "Mount A Button And Upload!" section is a great addition. It provides a clear, practical example of how to use the UploadButton component, which is consistent with the PR objectives to enhance documentation and provide functional examples.
Consider adding a brief explanation of what the 'endpoint' prop does and how it relates to the FileRouter defined earlier in the document. This would help users understand the connection between the router and the component.
docs/src/app/(docs)/getting-started/tanstack-start/page.mdx (1)
Line range hint
48-81
: LGTM! Consider adding a comment for the auth function.The changes improve error handling and consistency. The use of
UploadThingError
provides more specific error typing, and the return value change inonUploadComplete
adds useful metadata.Consider adding a comment above the
auth
function to clarify that it's a placeholder for actual authentication logic:-const auth = (req: Request) => ({ id: "fakeId" }); // Fake auth function +// TODO: Replace with actual authentication logic +const auth = (req: Request) => ({ id: "fakeId" }); // Placeholder auth function
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- docs/src/app/(docs)/getting-started/solid/page.mdx (6 hunks)
- docs/src/app/(docs)/getting-started/tanstack-start/page.mdx (5 hunks)
- examples/minimal-solidstart/src/utils/uploadthing.ts (0 hunks)
Files not reviewed due to no reviewable changes (1)
- examples/minimal-solidstart/src/utils/uploadthing.ts
Additional comments not posted (12)
docs/src/app/(docs)/getting-started/solid/page.mdx (7)
9-9
: LGTM: Improved title for better clarityThe new title "Getting Started with SolidStart" is more descriptive and aligns better with the content of the document. It follows a common pattern for introductory documentation, which should help users find and understand the purpose of this guide more easily.
21-28
: LGTM: Improved clarity for environment variable setupThe presentation of the UPLOADTHING_TOKEN environment variable is now clearer, and the updated note provides more specific guidance on how to obtain the token. These changes enhance the overall clarity of the setup process.
80-80
: LGTM: Improved type namingRenaming the type export from 'OurFileRouter' to 'UploadRouter' is a good change. The new name is more descriptive and aligns better with its purpose, improving overall clarity of the code.
97-102
: LGTM: Improved handler naming and export clarityThe changes to the API route creation section are good:
- Renaming 'handlers' to 'handler' is more appropriate as it's a single function.
- The new export statements are more explicit about how the handler is used with the APIEvent.
These changes improve the overall clarity and correctness of the code.
134-137
: LGTM: Helpful reference to API documentationThe addition of the note directing users to the Solid API Reference is a valuable improvement. It provides users with a clear path to more detailed information, which is consistent with the PR objectives to enhance documentation.
160-162
: LGTM: Clearer CSS inclusion instructionsThe updated instructions for including UploadThing's styles are clearer and provide a specific file path for including the CSS. This change aligns well with the PR objectives to improve clarity and consistency in the documentation.
179-185
: LGTM: Helpful conclusion with next stepsThe new "You're Done!" section is an excellent addition to the documentation. It provides clear next steps for users who want to customize or extend their implementation, with links to further resources on theming and creating custom components. This is consistent with the PR objectives to enhance documentation and provide comprehensive guidance.
docs/src/app/(docs)/getting-started/tanstack-start/page.mdx (5)
102-104
: LGTM! Consistent router naming.The changes correctly update the import and usage of
uploadRouter
, maintaining consistency with the earlier renaming.
115-119
: LGTM! Clear component usage guidance.The added documentation provides clear guidance on UploadThing component usage, recommending re-export with assigned types. This aligns well with the PR objective of enhancing documentation.
135-139
: LGTM! Helpful reference link added.The added note provides a useful link to the React API reference, enhancing the documentation as per the PR objectives.
76-76
: LGTM! Informative comment added.The added comment clearly explains the purpose of the return value in
onUploadComplete
, enhancing code understanding.
77-77
: LGTM! Enhanced return value.The updated return value now includes more specific metadata (
uploadedBy
), improving the information passed to the client-side callback.
``` | ||
|
||
<Note> | ||
To learn more about the components, check out the [solid API | ||
Reference](/api-reference/solid). |
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.
this page doesn't contain anything other than a redirect to React docs. did you mean to continue here or is that intentinoal?
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.
No, as you can see from the PR description:
Plus added link to @uploadthing/solid api reference. (Which right now points to @uploadthing/react. I think it would be also okay to say directly in getting started that @uploadthing/solid reference is not available, but you can check out @uploadthing/react)
I guess there are two options:
- Leave reference to solid's api and if people click it, they will need to navigate to
api-reference/react
. I guess this way whenever solid api is added, this will work with no change. - Add something like "To learn more about the components, check you API reference. The docs for
@uploadthing/solid
are currently not available, however the@uploadthing/react
package is almost identical so so we recommend following those docs for now.". This is quite wordy and also would have to be changed in future.
Don't know which is better. But I'm happy to change it.
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.
lgtm
SolidStart getting started:
@uploadthing/react
to align it withNext.js
andTanstack/Start
. Plus added link to@uploadthing/solid
api reference. (Which right now points to@uploadthing/react
. I think it would be also okay to say directly in getting started that@uploadthing/solid
reference is not avilivable, but you can check out@uploadthing/react
)type OurFileRouter = typeof uploadRouter
)solidjs-dropzone
andattr-accept
You're Done!
sectionSolidStart minimal example:
Uploader
component from utilsTanstack/Start getting started:
Next.js
andSolidStart
@uploadthing/react
api referenceError
toUploadThingError
Summary by CodeRabbit
New Features
UploadButton
component.Bug Fixes
UploadThingError
.Documentation