-
Notifications
You must be signed in to change notification settings - Fork 313
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
chore: Update SolidStart example #984
Conversation
|
WalkthroughThis pull request introduces several updates across multiple files in the project. Key changes include updates to the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Recent review detailsConfiguration used: CodeRabbit UI Files ignored due to path filters (1)
Files selected for processing (12)
Files not reviewed due to no reviewable changes (3)
Files skipped from review as they are similar to previous changes (9)
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 (
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
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: 0
Outside diff range and nitpick comments (5)
examples/minimal-solidstart/src/routes/api/uploadthing.ts (1)
11-12
: Approve: Improved export implementation with a minor suggestionThe new GET and POST exports are well-implemented, providing explicit typing and allowing for potential method-specific logic in the future. This change enhances the clarity and maintainability of the code.
For consistency with the rest of the file, consider using regular function declarations instead of arrow functions. This is a minor stylistic suggestion:
-export const GET = (event: APIEvent) => handler(event.request); -export const POST = (event: APIEvent) => handler(event.request); +export function GET(event: APIEvent) { return handler(event.request); } +export function POST(event: APIEvent) { return handler(event.request); }This change would align with the style used for the
createRouteHandler
function above.examples/minimal-solidstart/src/app.tsx (1)
Application title is not being set: The removal of the
Title
component fromapp.tsx
means that the document title is no longer being set within the application routes. Please ensure that the title is set appropriately elsewhere to maintain functionality and SEO benefits.Analysis chain
Line range hint
1-23
: LGTM! The changes look good and align with the PR objectives.The updates to the imports and component structure are consistent with the described changes in the PR. The removal of the
Title
component and its import simplifies theApp
component. The addition of the CSS import for@uploadthing/solid
is a good practice for including component-specific styles.To ensure that the application title is still set correctly, please run the following script:
This will help verify if the title is being set in any of the route files, which is a common practice in SolidStart applications.
[/run_scripts]
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check if the document title is set in any of the route files # Search for title setting in route files rg --type tsx 'Title|document\.title' src/routesLength of output: 78
Script:
#!/bin/bash # Description: Check if the document title is set in any of the .tsx route files # Find all .tsx files in src/routes and search for Title or document.title fd --extension tsx src/routes | xargs rg 'Title|document\.title'Length of output: 3048
examples/minimal-solidstart/src/routes/index.tsx (3)
28-36
: LGTM: Enhanced event handlers forUploadButton
The additions and modifications to the
UploadButton
event handlers are good improvements:
- The new
onUploadBegin
handler provides consistent logging with thecreateUploadThing
implementation.- The
onUploadAborted
handler adds valuable user feedback for aborted uploads.- The
onClientUploadComplete
handler now logs the entire response object, enhancing debugging capabilities.These changes align well with the PR objectives of modifying
console.log
statements andalert
calls for consistency.Consider using template literals for the
console.log
statements to maintain consistency across the codebase. For example:-console.log("onUploadBegin", fileName); +console.log(`onUploadBegin: ${fileName}`);
44-54
: LGTM: Enhanced event handlers forUploadDropzone
The additions and modifications to the
UploadDropzone
event handlers mirror those made to theUploadButton
, which is excellent for maintaining consistency:
- The new
onUploadBegin
handler provides consistent logging.- The
onUploadAborted
handler adds valuable user feedback for aborted uploads.- The
onClientUploadComplete
handler now logs the entire response object, enhancing debugging capabilities.These changes align well with the PR objectives and maintain consistency across different upload components.
As suggested for the
UploadButton
, consider using template literals for theconsole.log
statements:-console.log("onUploadBegin", fileName); +console.log(`onUploadBegin: ${fileName}`);
Line range hint
1-70
: Summary: Improved upload handling and consistencyThe changes made to this file significantly enhance the upload handling capabilities of the
Home
component:
- Consistent
onUploadBegin
handlers have been added acrosscreateUploadThing
,UploadButton
, andUploadDropzone
, improving debugging capabilities.- New
onUploadAborted
handlers inUploadButton
andUploadDropzone
provide better user feedback for aborted uploads.- The
onClientUploadComplete
handlers now log the entire response object, offering more comprehensive debugging information.These modifications align well with the PR objectives of updating
console.log
statements andalert
calls for consistency. They also improve the overall user experience and debugging process for file uploads.Consider extracting the common event handling logic into a separate utility function or hook to reduce code duplication and improve maintainability. This would make it easier to update all upload-related components consistently in the future.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
Files selected for processing (12)
- examples/minimal-solidstart/package.json (1 hunks)
- examples/minimal-solidstart/postcss.config.cjs (0 hunks)
- examples/minimal-solidstart/src/app.tsx (1 hunks)
- examples/minimal-solidstart/src/entry-client.tsx (1 hunks)
- examples/minimal-solidstart/src/entry-server.tsx (1 hunks)
- examples/minimal-solidstart/src/global.css (0 hunks)
- examples/minimal-solidstart/src/routes/api/uploadthing.ts (1 hunks)
- examples/minimal-solidstart/src/routes/index.tsx (2 hunks)
- examples/minimal-solidstart/src/server/uploadthing.ts (1 hunks)
- examples/minimal-solidstart/src/utils/uploadthing.ts (2 hunks)
- examples/minimal-solidstart/tailwind.config.ts (0 hunks)
- examples/minimal-solidstart/tsconfig.json (1 hunks)
Files not reviewed due to no reviewable changes (3)
- examples/minimal-solidstart/postcss.config.cjs
- examples/minimal-solidstart/src/global.css
- examples/minimal-solidstart/tailwind.config.ts
Files skipped from review due to trivial changes (1)
- examples/minimal-solidstart/src/server/uploadthing.ts
Additional comments not posted (13)
examples/minimal-solidstart/src/entry-client.tsx (1)
1-1
: LGTM! Improved development experience with hot reloading.The addition of the
// @refresh reload
comment directive is a positive change. This directive enables hot reloading in development environments, allowing for automatic updates to the UI without a full page refresh. This improvement aligns well with the PR's objective of updating the SolidStart example and enhances the developer experience.examples/minimal-solidstart/src/routes/api/uploadthing.ts (2)
1-1
: LGTM: Appropriate type import addedThe import of
APIEvent
from "@solidjs/start/server" is correct and necessary for typing the event parameters in the new GET and POST functions. This change enhances type safety without affecting runtime performance.
1-12
: Summary: Improved type safety and API structureThe changes in this file successfully update the SolidStart example by improving type safety and clarifying the API structure. The explicit GET and POST exports with proper typing enhance the maintainability of the code and align well with modern TypeScript and SolidStart practices. These modifications contribute positively to the overall objective of updating the SolidStart example and resolving CI lint issues.
examples/minimal-solidstart/tsconfig.json (1)
5-5
: LGTM! TypeScript configuration updates look good.The changes to
moduleResolution
andtypes
are appropriate updates that align with modern web development practices and the project's dependencies. These modifications should help resolve the CI lint issues mentioned in the PR objectives.To ensure these changes don't negatively impact other parts of the project, please run the following verification:
This script will help identify any potential TypeScript errors introduced by the configuration changes and highlight any
vinxi
imports that might need attention due to the updated type definitions.Also applies to: 13-13
examples/minimal-solidstart/src/entry-server.tsx (2)
1-1
: LGTM: Added refresh directive for improved development experience.The addition of
// @refresh reload
is a good practice for enabling hot module replacement or live reloading in development environments. This will help developers see changes in real-time without manual page refreshes.
Line range hint
8-13
: Verify the removal of the favicon link.The favicon link (
<link rel="icon" href="/favicon.ico" />
) has been removed from the<head>
section. While this doesn't affect functionality, it may impact the user experience as browsers typically use favicons to represent the site in tabs and bookmarks.Could you please confirm if:
- The favicon is being set through another method (e.g., in a different component or using a meta tag)?
- This removal was intentional and aligns with the project's design decisions?
If the removal was unintended, consider re-adding the favicon link:
<head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> + <link rel="icon" href="/favicon.ico" /> {assets} </head>
examples/minimal-solidstart/src/utils/uploadthing.ts (3)
16-17
: LGTM! Type parameters updated consistently.The type parameters for
UploadButton
andUploadDropzone
have been correctly updated to use the newUploadRouter
type. This change maintains type safety and consistency with the import statement modification.
7-7
: LGTM! Verify the import path.The change from
OurFileRouter
toUploadRouter
is consistent with the modifications in the exported entities. This suggests an improvement in naming conventions or project structure.To ensure the import path is correct, run the following script:
#!/bin/bash # Description: Verify the existence of the UploadRouter in the specified path # Test: Check if the file exists and contains the UploadRouter export rg --type typescript -e "export.*UploadRouter" "server/uploadthing.ts"
19-19
: LGTM! Verify usage of createUploadThing in the codebase.The type parameter for
generateSolidHelpers
has been correctly updated to use the newUploadRouter
type, maintaining consistency with the other changes.To ensure that all usages of
createUploadThing
are compatible with this change, run the following script:This will help identify any potential areas that might need updates due to the type change.
Verification successful
Action Required: Update the shell script to correctly target TypeScript files.
The previous script encountered an error because
rg
does not recognize thetypescript
type. Please update the script to search for.ts
files instead.
Verified:
createUploadThing
is used only within internal implementation files. No further action required.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check usages of createUploadThing in the codebase # Test: Find all occurrences of createUploadThing rg --type typescript -e "createUploadThing" -g '!**/uploadthing.ts'Length of output: 105
Script:
#!/bin/bash # Description: Check usages of createUploadThing in the codebase # Test: Find all occurrences of createUploadThing in TypeScript files rg -g '*.ts' -e "createUploadThing" --glob '!uploadthing.ts'Length of output: 645
examples/minimal-solidstart/package.json (2)
8-10
: LGTM: Script updates align with dependency changesThe updates to the scripts section are consistent with the dependency updates mentioned in the PR objectives. The addition of the "version" script suggests improved version management capabilities with vinxi.
13-19
: Dependency updates look good, but verify @uploadthing versionsThe updates to @solidjs packages and vinxi align with the PR objectives and should resolve the CI lint issue. However, please verify if the versions for @uploadthing/solid (7.0.2) and uploadthing (7.0.2) are the latest available, as they remain unchanged.
To verify the latest versions of @uploadthing packages, run:
examples/minimal-solidstart/src/routes/index.tsx (2)
12-14
: LGTM: AddedonUploadBegin
handlerThe new
onUploadBegin
handler is a good addition. It provides useful debugging information by logging the filename when an upload begins, which aligns with the PR objectives of modifyingconsole.log
statements for consistency.
15-18
: LGTM: EnhancedonClientUploadComplete
handlerThe modification to the
onClientUploadComplete
handler is an improvement. By logging the entire response object, it provides more comprehensive debugging information. This change aligns with the PR objectives of modifyingconsole.log
statements for consistency while maintaining the existing user feedback through the alert.
Broke |
When working on example for
tanstack/start
I ran into CI lint issue because of different versions ofvinxi
forSolidStart
andtanstack/start
. I decided to update the solidstart example first. Full list of changes:@uploadthing/solid/styles.css
instead.console.log
s andalert
s in index route to be consistent.I'll update solid start getting started docs next and link the PR here.
@juliusmarminge, this might conflict with #980.
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Chores