-
Notifications
You must be signed in to change notification settings - Fork 160
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 nextjs v15, react v19 and eslint v9 #420
Conversation
🦋 Changeset detectedLatest commit: 6e7792f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughThis pull request introduces a patch named "create-llama" that updates multiple dependencies across several configuration files. Key updates include upgrading ESLint to version 9, Next.js to version 15, and React to version 19. Additionally, the Changes
Possibly related PRs
Suggested reviewers
Warning Rate limit exceeded@thucpn has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 15 minutes and 17 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. 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
Documentation and Community
|
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 (1)
templates/types/streaming/nextjs/next.config.json (1)
1-13
: Consider adding Next.js 15 specific optimizationsThe configuration could benefit from new Next.js 15 features and optimizations.
Consider adding these Next.js 15 specific configurations:
{ "outputFileTracingIncludes": { "/*": ["./cache/**/*"] }, "outputFileTracingExcludes": { "/api/files/*": [ ".next/**/*", "node_modules/**/*", "public/**/*", "app/**/*" ] }, - "transpilePackages": ["highlight.js"] + "transpilePackages": ["highlight.js"], + "logging": { + "fetches": { + "fullUrl": true + } + }, + "typedRoutes": true }These additions will:
- Enable better debugging with full URL logging for fetch requests
- Enable type safety for routes (new in Next.js 15)
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (5)
.changeset/swift-donuts-own.md
(1 hunks)templates/types/streaming/express/package.json
(1 hunks)templates/types/streaming/nextjs/next.config.json
(1 hunks)templates/types/streaming/nextjs/package.json
(2 hunks)templates/types/streaming/nextjs/tsconfig.json
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- templates/types/streaming/express/package.json
🧰 Additional context used
📓 Path-based instructions (3)
templates/types/streaming/nextjs/next.config.json (1)
Pattern templates/**
: For files under the templates
folder, do not report 'Missing Dependencies Detected' errors.
templates/types/streaming/nextjs/package.json (1)
Pattern templates/**
: For files under the templates
folder, do not report 'Missing Dependencies Detected' errors.
templates/types/streaming/nextjs/tsconfig.json (1)
Pattern templates/**
: For files under the templates
folder, do not report 'Missing Dependencies Detected' errors.
🪛 LanguageTool
.changeset/swift-donuts-own.md
[uncategorized] ~5-~5: The official spelling of this programming framework is “Next.js”.
Context: ...ma": patch --- chore: update eslint 9, nextjs 15, react 19
(NODE_JS)
🔇 Additional comments (4)
templates/types/streaming/nextjs/next.config.json (1)
2-11
: Verify file tracing paths for Next.js 15 compatibility
The file tracing configuration has been moved out of the "experimental" key, which is correct as these features are now stable in Next.js 15. However, we should verify that all the excluded paths are still necessary and working as expected with the new version.
Let's verify the existence and usage of these paths:
templates/types/streaming/nextjs/package.json (3)
31-31
: Verify compatibility between Next.js 15 and ESLint 9
The major version upgrades of both Next.js (15.0.3) and ESLint (9.14.0) require careful verification of compatibility, especially with eslint-config-next
.
Run this verification:
#!/bin/bash
# Check for any Next.js 15 specific lint rules or breaking changes
rg -l "next/core-web-vitals|next/babel|next/recommended"
# Look for any .eslintrc files that might need updates
fd -e json -e js -e yml -e yaml '.eslintrc'
Also applies to: 50-50
49-51
: ESLint Configuration Updates Required
Major version upgrades in ESLint and its configs might introduce breaking changes in linting rules.
Run this verification:
Consider documenting any required updates to ESLint configuration in the migration guide.
32-33
:
Caution: Using React Release Candidate in Production
The update includes a specific React RC build (19.0.0-rc-5c56b873-20241107
). While this allows early access to React 19 features, using RC versions in production templates could lead to stability issues.
Consider either:
- Staying on stable React 18 until React 19 is officially released
- Adding a warning in the template documentation about the experimental nature of React 19 RC
✅ Verification successful
Verified: No Production Code Uses React 19-specific Features
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check if any production code relies on React 19-specific features
rg -l "use(Optimizer|Cache|FormStatus|FormState)"
Length of output: 149
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: 2
🧹 Outside diff range and nitpick comments (2)
templates/types/streaming/express/eslint.config.mjs (2)
26-28
: Consider documenting disabled TypeScript rulesWhile disabling these TypeScript rules might be necessary for your use case, it's recommended to document why these rules are disabled to help maintain the codebase in the future.
rules: { - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/ban-ts-comment": "off", - "@typescript-eslint/no-unused-vars": "off", + // Disabled to allow flexibility in template code + "@typescript-eslint/no-explicit-any": "off", + // Disabled to allow necessary type assertions in template code + "@typescript-eslint/ban-ts-comment": "off", + // Disabled as template code might contain example variables + "@typescript-eslint/no-unused-vars": "off",
24-24
: Consider increasing the max-params limitA limit of 4 parameters might be too restrictive for some use cases. Consider increasing this limit or using object parameters for functions that need more parameters.
- "max-params": ["error", 4], + "max-params": ["error", 5],
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (4)
templates/types/streaming/express/eslint.config.mjs
(1 hunks)templates/types/streaming/express/eslintrc.json
(0 hunks)templates/types/streaming/express/index.ts
(0 hunks)templates/types/streaming/express/package.json
(2 hunks)
💤 Files with no reviewable changes (2)
- templates/types/streaming/express/eslintrc.json
- templates/types/streaming/express/index.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- templates/types/streaming/express/package.json
🧰 Additional context used
📓 Path-based instructions (1)
templates/types/streaming/express/eslint.config.mjs (1)
Pattern templates/**
: For files under the templates
folder, do not report 'Missing Dependencies Detected' errors.
🔇 Additional comments (3)
templates/types/streaming/express/eslint.config.mjs (3)
1-5
: LGTM! Proper usage of ESLint v9's flat config system
The imports are correctly structured using ESLint v9's new flat configuration format, with proper usage of the node:
prefix for built-in modules.
7-8
: LGTM! Correct ES module path handling
The code properly sets up __filename
and __dirname
for ES modules, which is necessary since these variables aren't available by default in ESM.
9-13
: LGTM! Proper FlatCompat initialization
The FlatCompat initialization is correctly configured with the necessary base directory and recommended configurations for ESLint v9.
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 (1)
templates/types/streaming/nextjs/app/api/files/[...slug]/route.ts (1)
24-24
: Consider adding type safety for array destructuringWhile the destructuring works correctly, consider adding runtime validation for the expected array structure to prevent potential undefined values.
- const [folder, ...pathTofile] = slug; // data, file.pdf + if (slug.length === 0) { + return NextResponse.json({ detail: "Invalid file path format" }, { status: 400 }); + } + const [folder, ...pathTofile] = slug; // data, file.pdf
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (4)
helpers/typescript.ts
(1 hunks)templates/types/streaming/express/package.json
(2 hunks)templates/types/streaming/nextjs/app/api/files/[...slug]/route.ts
(2 hunks)templates/types/streaming/nextjs/package.json
(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
- helpers/typescript.ts
- templates/types/streaming/express/package.json
- templates/types/streaming/nextjs/package.json
🧰 Additional context used
📓 Path-based instructions (1)
templates/types/streaming/nextjs/app/api/files/[...slug]/route.ts (1)
Pattern templates/**
: For files under the templates
folder, do not report 'Missing Dependencies Detected' errors.
🔇 Additional comments (1)
templates/types/streaming/nextjs/app/api/files/[...slug]/route.ts (1)
12-14
: Verify Next.js 15 route handler changes
The change to make params
a Promise type aligns with Next.js 15's API changes for dynamic route parameters. The implementation correctly awaits the params before accessing the slug.
Let's verify other route handlers for consistency:
✅ Verification successful
Let me gather more information to verify if there are any other route handlers that might need updates.
Based on the search results, I can now generate the final response:
Next.js 15 route handler implementation is correct
The implementation in [...slug]/route.ts
is the only dynamic route handler in the codebase that requires the Promise-based params type. The change correctly handles the Next.js 15 API requirements by:
- Using the correct Promise type annotation for params
- Properly awaiting the params before accessing the slug property
- Maintaining consistent error handling and response patterns
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check if all route handlers are updated for Next.js 15
# Expected: All dynamic route handlers should use Promise<{ params }> type
# Search for other route handlers with dynamic parameters
ast-grep --pattern 'export async function $_(
$_: NextRequest,
{ params }: { params: { $$$} }
)'
# Search for potential missed updates
rg -l "params.*slug.*string\[\]" --type ts
Length of output: 213
Script:
#!/bin/bash
# Search for all route handlers in the codebase
ast-grep --pattern 'export async function $_(
$_,
{ params }: $_
) {
$$$
}'
# Also search for any other files that might be using params
rg -l "export.*function.*params.*:" --type ts
Length of output: 4760
Summary by CodeRabbit
New Features
Bug Fixes
Chores