Skip to content

Conversation

@juraj98
Copy link
Contributor

@juraj98 juraj98 commented Oct 16, 2024

Docs:

Other:

  • Updated TSS minimal example according to latest TSS guide.

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features
    • Introduced a comprehensive guide for setting up a Tanstack/Start project with UploadThing.
    • Added instructions for installing UploadThing packages and configuring environment variables, including the UPLOADTHING_TOKEN.
    • Expanded example for creating a FileRouter to handle file uploads, including authentication and file type specifications.
    • Included code snippets for generating upload components and integrating styles with Tailwind CSS.
  • Documentation
    • Enhanced documentation with detailed steps and examples for users to effectively utilize UploadThing, including customization options and additional resources.
    • Updated TypeScript references and improved error handling in example files for better compatibility.
  • Chores
    • Updated dependencies in package.json for improved compatibility and features.
    • Added stricter null checking in TypeScript configuration for enhanced type safety.

@changeset-bot
Copy link

changeset-bot bot commented Oct 16, 2024

⚠️ No Changeset found

Latest commit: 2d109ec

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

@vercel
Copy link

vercel bot commented Oct 16, 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 Oct 16, 2024 8:14am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
legacy-docs-uploadthing ⬜️ Ignored (Inspect) Visit Preview Oct 16, 2024 8:14am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 16, 2024

Walkthrough

This pull request introduces a comprehensive guide for setting up a Tanstack/Start project with UploadThing. It covers the installation of necessary packages, configuration of environment variables, and creation of a FileRouter for file uploads. The documentation includes metadata exports, warnings about obtaining an UploadThing token, and detailed examples for implementing UploadThing components and styles, including Tailwind CSS integration.

Changes

File Path Change Summary
docs/src/app/(docs)/getting-started/tanstack-start/page.mdx Enhanced documentation for setting up a Tanstack/Start project with UploadThing, including installation instructions, environment variable setup, and FileRouter creation. Added metadata export and UploadRouter type.
examples/minimal-tanstack-start/app/client.tsx Added TypeScript reference directive for Vinxi types.
examples/minimal-tanstack-start/app/routes/__root.tsx Modified CSS import statement for @uploadthing/react to resolve TypeScript error suppression.
examples/minimal-tanstack-start/app/routes/api/uploadthing.ts Updated Route export to wrap handlers in an arrow function, allowing explicit request handling.
examples/minimal-tanstack-start/app/ssr.tsx Introduced TypeScript reference directive for vinxi/types/server and modified export statement.
examples/minimal-tanstack-start/package.json Updated versions of several dependencies and added a new dependency for @vitejs/plugin-react.
examples/minimal-tanstack-start/tsconfig.json Added "strictNullChecks": true to enhance type safety in TypeScript.

Possibly related PRs

Suggested reviewers

  • juliusmarminge

🐰 In the garden where the uploads flow,
A guide was crafted, now we know!
With UploadThing, our files take flight,
Setting up is now a delight!
So hop along, and join the fun,
With every upload, we’ve just begun! 🌼


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between bcb34df and 56c751d.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • examples/minimal-tanstack-start/package.json (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • examples/minimal-tanstack-start/package.json

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.

@juraj98 juraj98 changed the title docs: Remove unnecessary @ts-expect-error from TSS docs: Update TSS docs and example Oct 16, 2024
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

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between c9e8df5 and d30fd00.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (6)
  • examples/minimal-tanstack-start/app/client.tsx (1 hunks)
  • examples/minimal-tanstack-start/app/routes/__root.tsx (0 hunks)
  • examples/minimal-tanstack-start/app/routes/api/uploadthing.ts (1 hunks)
  • examples/minimal-tanstack-start/app/ssr.tsx (1 hunks)
  • examples/minimal-tanstack-start/package.json (1 hunks)
  • examples/minimal-tanstack-start/tsconfig.json (1 hunks)
💤 Files with no reviewable changes (1)
  • examples/minimal-tanstack-start/app/routes/__root.tsx
🧰 Additional context used
🔇 Additional comments (9)
examples/minimal-tanstack-start/tsconfig.json (1)

7-8: Approve the addition of strictNullChecks and verify its impact.

The addition of "strictNullChecks": true is a positive change that enhances type safety in the project. This aligns with the PR's objective of removing unnecessary @ts-expect-error directives, as it may help catch and resolve type issues that previously required suppression.

However, enabling this option might uncover existing type issues in the codebase.

To ensure this change doesn't introduce unexpected issues, please run the following verification:

This script will compile the project without emitting files and capture any TypeScript errors. Review the output to ensure no unexpected issues are introduced by this change.

examples/minimal-tanstack-start/app/client.tsx (1)

1-1: Approved: Type reference added for Vinxi client types.

The addition of the type reference /// <reference types="vinxi/types/client" /> is a good practice. It ensures that TypeScript can properly recognize and check types from the Vinxi framework in this file.

However, I noticed that this change doesn't directly align with the PR description, which mentions removing unnecessary @ts-expect-error directives related to ?url imports. Could you please clarify how this change relates to the PR objectives?

To ensure consistency across the project, let's check if similar type references have been added to other relevant files:

✅ Verification successful

Verified: Vinxi type reference is appropriate and consistent.

The addition of /// <reference types="vinxi/types/client" /> in examples/minimal-tanstack-start/app/client.tsx has been verified and is consistent with the project's type definitions. No additional files require similar references.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for Vinxi type references in TypeScript and TSX files
rg --type-add 'ts:*.{ts,tsx}' --type ts '/// <reference types="vinxi/types/client" />'

Length of output: 180

examples/minimal-tanstack-start/app/ssr.tsx (3)

1-1: LGTM: TypeScript reference directive added.

The addition of the TypeScript reference directive for "vinxi/types/server" is appropriate. It ensures that the necessary type definitions are available for the server-side code, which is in line with best practices for TypeScript development.


Line range hint 9-13: LGTM: Export statement updated for clarity and type safety.

The modification of the export statement to explicitly use createRouter and getRouterManifest as parameters for createStartHandler is a positive change. It improves code clarity and type safety without altering the module's public API. This update aligns well with the PR's objective of working with the latest version of Tanstack/Start.


Line range hint 1-13: Summary: Positive updates enhancing TypeScript integration.

The changes in this file, while minimal, significantly improve the TypeScript integration and code clarity. The addition of the TypeScript reference directive and the explicit use of createRouter and getRouterManifest in the export statement align well with the PR's objective of updating the code to work with the latest version of Tanstack/Start. These modifications support the removal of unnecessary @ts-expect-error directives by ensuring proper type definitions and usage.

examples/minimal-tanstack-start/app/routes/api/uploadthing.ts (1)

9-10: Improved request handling implementation. LGTM!

The changes to the GET and POST methods in the Route constant are well-implemented. By wrapping the handlers in arrow functions that explicitly take a request parameter, you've enhanced the flexibility and clarity of the request handling process. This approach allows for more granular control over incoming requests and aligns with modern practices in API route handling.

While this change doesn't directly address the PR objective of removing @ts-expect-error directives (as there were none in this file), it does improve the overall code structure and maintainability.

examples/minimal-tanstack-start/package.json (3)

11-11: LGTM: @tanstack/react-router version update

The update to @tanstack/react-router from ^1.58.7 to ^1.69.1 is a minor version bump, which should introduce new features or improvements without breaking changes. This update aligns with the PR objectives and should help resolve the TypeScript errors mentioned.


12-12: LGTM: @tanstack/start version update

The update to @tanstack/start from ^1.58.7 to ^1.69.3 is a minor version bump, which should introduce new features or improvements without breaking changes. This update is in line with the PR objectives and should contribute to resolving the TypeScript errors mentioned.


13-13: LGTM: @uploadthing/react version flexibility

The change from 7.0.3 to ^7.0.3 for @uploadthing/react introduces version flexibility. This allows for automatic updates to minor versions, which can include bug fixes and non-breaking new features. While not directly related to the PR objectives, this change follows good practices for dependency management.

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