Skip to content

docs: Add getting started for tanstack/start #973

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 2 commits into from
Sep 23, 2024
Merged

docs: Add getting started for tanstack/start #973

merged 2 commits into from
Sep 23, 2024

Conversation

juraj98
Copy link
Contributor

@juraj98 juraj98 commented Sep 21, 2024

Added getting started page for @tanstack/start. Most of the copy is copy-pasted from other pages with code snippet changes to reflect @tanstack/start. There are two changes to consider:

  • I changed the "If you don't already have a uploadthing secret key, sign up and create one from the dashboard!" warning to read "have a uploadthing token,". I believe this was forgotten when moving to v7. I'd be happy to create follow up PR to fix it at other pages as well.
  • I added warning "Make sure to configure API entry handler in app/api.ts. For more information, please refer to the @tanstack/start docs.". This is Tanstack/Start thing, unrelated to uploadthing. But I think it's useful to include this warning, as setting up API entry handler is not covered in most "getting started with Tanstack/Start" I've seen.

Example of Tanstack/Start with UT: GitHub, StackBlitz

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Introduced a comprehensive guide for setting up a Tanstack/Start project with UploadThing.
    • Added a new navigation entry for "Tanstack/Start" in the site configuration.
  • Documentation

    • Detailed instructions for package installations, API route creation, and UploadThing component integration.
    • Included guidance on creating FileRouter and UploadThing helper functions with code snippets.

Copy link

changeset-bot bot commented Sep 21, 2024

⚠️ No Changeset found

Latest commit: ef39677

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

Copy link
Contributor

coderabbitai bot commented Sep 21, 2024

Walkthrough

This pull request introduces a new guide for setting up a Tanstack/Start project with UploadThing, detailing necessary installations, configurations, and component usage. It includes the creation of a FileRouter for file management, an API route for uploads, and helper functions for generating upload components. Additionally, it updates the site configuration to include a navigation link for the new documentation.

Changes

File Path Change Summary
docs/src/app/(docs)/getting-started/tanstack-start/page.mdx Introduced a guide for Tanstack/Start setup with UploadThing, including metadata, FileRouter setup, API route creation, and component generation.
docs/src/site-config.ts Added a navigation entry for "Tanstack/Start" linking to the new guide.

Possibly related PRs

  • chore: Fix Remix get started guide #963: The changes in this PR involve updates to the UploadButton and UploadDropzone components, which are also referenced in the main PR's guide for setting up UploadThing, indicating a direct connection in terms of functionality and usage.

Suggested reviewers

  • juliusmarminge

Poem

In the garden where the code does bloom,
A new guide emerges, dispelling the gloom.
With UploadThing's magic, files take flight,
Tanstack/Start shines, oh what a delight!
So hop along, dear friends, and explore,
The wonders of uploads—there's so much in store! 🐇✨


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

Should we also have a minimal-tanstack-start example @markflorkowski ?

@markflorkowski
Copy link
Collaborator

LGTM

Should we also have a minimal-tanstack-start example @markflorkowski ?

Not a bad idea, wouldn’t block on it though!

@juliusmarminge
Copy link
Member

LGTM

Should we also have a minimal-tanstack-start example @markflorkowski ?

Not a bad idea, wouldn’t block on it though!

Yea can be its own thing for sure


const handlers = createRouteHandler({
router: ourFileRouter,
config: { token: process.env.UPLOADTHING_TOKEN },
Copy link
Member

Choose a reason for hiding this comment

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

this should not be required? Or do Vinxi treeshake it away if you don't reference it explicitely? if so a comment regarding that might be good info

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, just checked, not required. Mb, removed it in f3ba60a.

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: 0

Outside diff range and nitpick comments (3)
docs/src/app/(docs)/getting-started/tanstack-start/page.mdx (3)

25-29: Update warning message for consistency

The PR objectives mention updating the warning to refer to an UploadThing token instead of a secret key. However, the current warning still uses the term "token". Consider updating the warning message to explicitly mention the transition from "secret key" to "token" for clarity.

For example:

<Warning>
  If you don't already have an UploadThing token (previously known as secret key), [sign
  up](https://uploadthing.com/sign-in) and create one from the
  [dashboard!](https://uploadthing.com/dashboard)
</Warning>

This change would align with the PR objectives and provide context for users familiar with the previous terminology.


125-129: Consider exporting both UploadButton and UploadDropzone

The current code only exports the UploadButton component. Consider exporting both UploadButton and UploadDropzone to provide users with more flexibility. You can achieve this by using a named export:

export { UploadButton, UploadDropzone };

This change would allow users to import either or both components as needed.


131-157: Styles section is comprehensive, with a minor suggestion

The instructions for adding UploadThing's styles are clear and cover both Tailwind and non-Tailwind setups effectively. The use of tabs for different setups is user-friendly.

Minor suggestion:
In line 39, consider adding a period after "etc" to follow American English conventions: "Permitted types ["image", "video", etc.]"

Tools
LanguageTool

[duplication] ~133-~133: Possible typo: you repeated a word
Context: ...on; ``` ### Add UploadThing's Styles <Tabs tabs={["Tailwind", "Not Tailwind"]}> ...

(ENGLISH_WORD_REPEAT_RULE)

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f3ba60a and ef39677.

Files selected for processing (1)
  • docs/src/app/(docs)/getting-started/tanstack-start/page.mdx (1 hunks)
Additional context used
LanguageTool
docs/src/app/(docs)/getting-started/tanstack-start/page.mdx

[style] ~39-~39: In American English, abbreviations like “etc.” require a period.
Context: ...: - Permitted types ["image", "video", etc] - Max file size - (Optional) `middlewa...

(ETC_PERIOD)


[duplication] ~133-~133: Possible typo: you repeated a word
Context: ...on; ``` ### Add UploadThing's Styles <Tabs tabs={["Tailwind", "Not Tailwind"]}> ...

(ENGLISH_WORD_REPEAT_RULE)

Additional comments not posted (5)
docs/src/app/(docs)/getting-started/tanstack-start/page.mdx (5)

1-7: Metadata looks good!

The metadata for this documentation page is well-structured and provides clear information about the content.


31-79: FileRouter setup looks great!

The explanation of the FileRoute concept and the code example for creating a FileRouter are clear and comprehensive. The export of the FileRouter type is a good practice for type safety.

Tools
LanguageTool

[style] ~39-~39: In American English, abbreviations like “etc.” require a period.
Context: ...: - Permitted types ["image", "video", etc] - Max file size - (Optional) `middlewa...

(ETC_PERIOD)


81-111: API route creation is well-documented

The instructions and code example for creating an API route are clear and concise. The warning about configuring the API entry handler (lines 88-92) is a valuable addition, as it addresses a common oversight in other "getting started" guides for Tanstack/Start. This aligns well with the PR objectives.


159-183: Final section provides a clear example and next steps

The code example for mounting an UploadButton in a Home component is concise and easy to understand. The conclusion with links to further customization and component creation provides valuable next steps for users.


1-183: Overall, excellent documentation for Tanstack/Start setup with UploadThing

This documentation provides a comprehensive guide for setting up a Tanstack/Start project with UploadThing. It covers all necessary steps from package installation to mounting a functional upload button. The content is well-structured, easy to follow, and includes valuable warnings and tips.

Key strengths:

  1. Clear instructions for each step of the setup process.
  2. Inclusion of code examples for better understanding.
  3. Coverage of both Tailwind and non-Tailwind setups.
  4. Addition of the warning about configuring the API entry handler, which addresses a common oversight.

The minor suggestions provided in the review comments will further enhance the quality and consistency of the documentation. Great job on creating this "getting started" guide!

Tools
LanguageTool

[style] ~39-~39: In American English, abbreviations like “etc.” require a period.
Context: ...: - Permitted types ["image", "video", etc] - Max file size - (Optional) `middlewa...

(ETC_PERIOD)


[duplication] ~133-~133: Possible typo: you repeated a word
Context: ...on; ``` ### Add UploadThing's Styles <Tabs tabs={["Tailwind", "Not Tailwind"]}> ...

(ENGLISH_WORD_REPEAT_RULE)

@juliusmarminge
Copy link
Member

LGTM. Do you wanna follow up with adding an example? No pressure ofc

@juliusmarminge juliusmarminge merged commit 3980c88 into pingdotgg:main Sep 23, 2024
18 checks passed
@juraj98
Copy link
Contributor Author

juraj98 commented Sep 23, 2024

LGTM. Do you wanna follow up with adding an example? No pressure ofc

I'll take a look at the examples tomorrow.

@juraj98
Copy link
Contributor Author

juraj98 commented Sep 23, 2024

One more minor thing I noticed to late: #979

@coderabbitai coderabbitai bot mentioned this pull request Jan 30, 2025
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.

3 participants