Skip to content

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

Merged
merged 4 commits into from
Sep 24, 2024
Merged

docs: Fixed SolidStart and slightly changed Tanstack/Start #988

merged 4 commits into from
Sep 24, 2024

Conversation

juraj98
Copy link
Contributor

@juraj98 juraj98 commented Sep 24, 2024

SolidStart getting started:

  • Following SolidStart getting started should now result in working UT
  • Removed extra informations about @uploadthing/react to align it with Next.js and Tanstack/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)
  • Changes some variable types to be consistent (No more type OurFileRouter = typeof uploadRouter)
  • Removed unnecessary (i hope) installation of solidjs-dropzone and attr-accept
  • Added You're Done! section

SolidStart minimal example:

  • Removed Uploader component from utils

Tanstack/Start getting started:

  • Changed some copy to be consistent with Next.js and SolidStart
  • Added link to @uploadthing/react api reference
  • Changed generic Error to UploadThingError

Summary by CodeRabbit

  • New Features

    • Updated documentation for "Getting Started with SolidStart" to enhance clarity and usability.
    • Introduced a new section showcasing the usage of the UploadButton component.
  • Bug Fixes

    • Improved error handling by replacing generic errors with specific UploadThingError.
  • Documentation

    • Simplified installation instructions and reorganized environment variable sections.
    • Emphasized availability of components for easier file uploads and updated notes for consistency.
    • Removed outdated examples and condensed advanced usage information.

Copy link

changeset-bot bot commented Sep 24, 2024

⚠️ No Changeset found

Latest commit: acaa2ae

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

Copy link

vercel bot commented Sep 24, 2024

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 Sep 24, 2024 7:25pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
legacy-docs-uploadthing ⬜️ Ignored (Inspect) Visit Preview Sep 24, 2024 7:25pm

Copy link
Contributor

coderabbitai bot commented Sep 24, 2024

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

Commits

Files that changed from the base of the PR and between 0c8d7bf and acaa2ae.

Walkthrough

The 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

File Path Change Summary
docs/src/app/(docs)/getting-started/solid/page.mdx Title changed to "Getting Started with SolidStart"; installation instructions simplified; environment variable section reorganized; uploadRouter renamed; examples removed and new section added.
docs/src/app/(docs)/getting-started/tanstack-start/page.mdx ourFileRouter renamed to uploadRouter; error handling updated to use UploadThingError; return values in upload callback adjusted; type references updated.
examples/minimal-solidstart/src/utils/uploadthing.ts Removed generateUploader function and its export; other exports remain unchanged.

Possibly related PRs

  • chore: Fix Remix get started guide #963: This PR involves updating the type references for the UploadButton and UploadDropzone components from OurFileRouter to UploadRouter, which aligns with the changes made in the main PR regarding the renaming of the router type.
  • docs: Add getting started for tanstack/start #973: This PR introduces a guide for setting up a Tanstack/Start project, which includes a warning about the UploadThing token and mentions the creation of a FileRouter. The changes in the main PR regarding the UploadRouter type and the setup process are relevant to this guide.
  • docs: Fixed component exports for tanstack/start #979: This PR modifies the export statements for the UploadButton and UploadDropzone components to named exports, which is directly related to the changes made in the main PR regarding the usage and export of these components.
  • chore: Update solidstart example #985: This PR updates the SolidStart example and mentions removing Tailwind CSS in favor of @uploadthing/solid/styles.css, which relates to the overall integration and usage of UploadThing components discussed in the main PR.

Suggested reviewers

  • juliusmarminge
  • markflorkowski

Poem

In the meadow where bunnies play,
Changes hop in, brightening the day.
Uploads now easier, a joyful cheer,
With clearer paths, the way is near.
Let's celebrate with a joyful dance,
For every change, a new chance! 🐇✨


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
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    -- I pushed a fix in commit <commit_id>, 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 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 for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 installation

The 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 clarity

The 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 consistency

The changes to the UploadThing components creation section are good:

  1. The emphasis on re-exporting components with assigned types promotes better type safety.
  2. 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 usage

The 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 in onUploadComplete 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

Commits

Files that changed from the base of the PR and between fbcf837 and a69b1a7.

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 clarity

The 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 setup

The 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 naming

Renaming 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 clarity

The changes to the API route creation section are good:

  1. Renaming 'handlers' to 'handler' is more appropriate as it's a single function.
  2. 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 documentation

The 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 instructions

The 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 steps

The 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).
Copy link
Member

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?

Copy link
Contributor Author

@juraj98 juraj98 Sep 24, 2024

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:

  1. 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.
  2. 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.

Copy link
Member

@juliusmarminge juliusmarminge left a comment

Choose a reason for hiding this comment

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

lgtm

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