Skip to content
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-next #1758

Closed
wants to merge 1 commit into from
Closed

chore: update-next #1758

wants to merge 1 commit into from

Conversation

Harman-singh-waraich
Copy link
Contributor

@Harman-singh-waraich Harman-singh-waraich commented Nov 25, 2024

PR-Codex overview

This PR primarily updates the configuration and dependencies for a web development project, particularly upgrading the next version and making various adjustments to the yarn.lock file, including adding new dependencies and updating existing ones.

Detailed summary

  • Updated target in tsconfig.json to ES2017.
  • Upgraded next from 14.2.14 to ^15.0.3 in package.json.
  • Added new dependencies related to @img/sharp for image processing in yarn.lock.
  • Updated styled-jsx from 5.1.1 to 5.1.6.
  • Added simple-swizzle and color-string dependencies with specific versions.
  • Enhanced peer dependencies for compatibility with react versions.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Summary by CodeRabbit

  • New Features
    • Updated the Next.js dependency to allow for newer features and fixes.
    • Specified ECMAScript target version to ES2017 for improved compatibility.

These changes enhance the project's ability to leverage the latest updates and maintain compatibility across environments.

Copy link
Contributor

coderabbitai bot commented Nov 25, 2024

Walkthrough

The changes in this pull request involve updates to the package.json and tsconfig.json files for the @kleros/kleros-v2-web-devtools project. The package.json file was modified to change the version specification of the next dependency from a fixed version to a caret version, allowing for more flexible updates. Additionally, the tsconfig.json file was updated to include a new property specifying the ECMAScript target version as ES2017.

Changes

File Change Summary
web-devtools/package.json Updated next dependency version from "14.2.14" to "^15.0.3"
web-devtools/tsconfig.json Added property "target": "ES2017" in compilerOptions

Possibly related PRs

  • chore(web): bump-ui-components-library-to-2.15.0 #1705: This PR updates the package.json file for the @kleros/kleros-v2-web project, which is related to dependency management similar to the changes made in the main PR for the @kleros/kleros-v2-web-devtools project.
  • feat: update versions across v2 apps #1706: This PR also involves updates to the package.json file, specifically changing dependency versions, which aligns with the version management focus of the main PR.
  • Patches and various version bumps #1728: This PR includes updates to dependencies in the contracts/package.json, which reflects a similar maintenance effort in managing versions as seen in the main PR's updates to package.json.

Suggested labels

Type: Maintenance :construction:, dependencies

Suggested reviewers

  • alcercu

🐰 In the code we hop and play,
With versions changing day by day.
From fourteen to fifteen, we leap with glee,
And set our targets, oh so free!
In the devtools, we find our way,
Hopping along, come what may! 🐇✨


🪧 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 or @coderabbitai title 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

netlify bot commented Nov 25, 2024

Deploy Preview for kleros-v2-testnet failed. Why did it fail? →

Name Link
🔨 Latest commit 5916a7b
🔍 Latest deploy log https://app.netlify.com/sites/kleros-v2-testnet/deploys/67449cce8020ff0008c96749

Copy link

netlify bot commented Nov 25, 2024

Deploy Preview for kleros-v2-testnet-devtools failed. Why did it fail? →

Name Link
🔨 Latest commit 5916a7b
🔍 Latest deploy log https://app.netlify.com/sites/kleros-v2-testnet-devtools/deploys/67449cce1346e10008e8d425

Copy link

netlify bot commented Nov 25, 2024

Deploy Preview for kleros-v2-university failed. Why did it fail? →

Name Link
🔨 Latest commit 5916a7b
🔍 Latest deploy log https://app.netlify.com/sites/kleros-v2-university/deploys/67449cce6593ac0008260c38

Copy link

codeclimate bot commented Nov 25, 2024

Code Climate has analyzed commit 5916a7b and detected 0 issues on this pull request.

View more on Code Climate.

Copy link

netlify bot commented Nov 25, 2024

Deploy Preview for kleros-v2-neo ready!

Name Link
🔨 Latest commit 5916a7b
🔍 Latest deploy log https://app.netlify.com/sites/kleros-v2-neo/deploys/67449ccee52ec600073fccef
😎 Deploy Preview https://deploy-preview-1758--kleros-v2-neo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

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

🧹 Outside diff range and nitpick comments (1)
web-devtools/package.json (1)

54-54: Consider using stricter version constraints

Using ^ for a major framework version could lead to unexpected breaking changes. Consider:

  1. Using a fixed version (15.0.3) for more controlled updates
  2. Or at minimum, using a tilde (~15.0.3) to only allow patch updates
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between f314504 and 5916a7b.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (2)
  • web-devtools/package.json (1 hunks)
  • web-devtools/tsconfig.json (1 hunks)
🔇 Additional comments (2)
web-devtools/tsconfig.json (2)

Line range hint 1-41: Verify TypeScript configuration for Next.js 15 compatibility

The TypeScript configuration appears compatible with Next.js 15, but let's verify there aren't any missing recommended settings.

✅ Verification successful

TypeScript configuration is compatible with Next.js 15

The TypeScript configuration in tsconfig.json is properly set up for Next.js 15:

  • Using correct moduleResolution: "bundler" for Next.js 15
  • Has the required Next.js plugin configured
  • Includes all necessary compiler options (strict, esModuleInterop, etc.)
  • TypeScript 5.5.3 is being used, which is compatible with Next.js 15.0.3

The Next.js configuration in next.config.mjs is also properly configured with TypeScript support and doesn't override any critical TypeScript settings.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for Next.js 15 TypeScript configuration recommendations
# Look for Next.js specific configuration files
rg -l 'next\.config\.(js|ts)' .

# Check if there are any TypeScript-related warnings in the Next.js configuration
rg -A 5 'typescript|compilerOptions' next.config.* 2>/dev/null

Length of output: 88


Script:

#!/bin/bash
# Let's try a different approach to verify Next.js and TypeScript configuration

# Check for Next.js version in package.json
rg -A 2 '"next":' package.json

# Look for any Next.js specific TypeScript configuration files
fd -e json -e js -e ts -x grep -l "next" {}

# Check for any TypeScript configuration files
fd tsconfig

# Check if there are any TypeScript errors or warnings in the build output
fd -e log build-error

Length of output: 4514


Script:

#!/bin/bash
# Let's check the package.json for Next.js version and TypeScript dependencies
cat web-devtools/package.json | jq '.dependencies.next, .dependencies.typescript, .devDependencies.typescript'

# Let's also check for any Next.js specific configuration
fd next.config -e js -e ts -e mjs web-devtools/

# And verify the content of any Next.js config file if found
fd next.config -e js -e ts -e mjs web-devtools/ -x cat {}

Length of output: 1540


40-41: Consider using a more modern TypeScript target.

While ES2017 is a valid target and includes important features like async/await, you might want to consider using a more modern target (like ES2020 or ES2022) since:

  • Next.js 15 supports modern JavaScript features
  • Most modern browsers support ES2020+ features
  • You're already using "esnext" for module and lib settings

Let's verify the browser requirements for your project:

✅ Verification successful

ES2017 target is appropriate for the project's browser compatibility requirements.

The browserslist configuration in web-devtools/package.json ("> 0.5%, not dead") indicates support for modern browsers, and ES2017 target is compatible with this requirement. The target setting aligns well with:

  • The project's browser compatibility needs
  • Next.js 15's requirements
  • The browserslist configuration
  • Usage of modern features in dependencies like viem, wagmi, etc.
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check browser targets configuration
# Look for browserslist config in package.json or .browserslistrc
rg -l 'browserslist|"targets"' package.json .browserslistrc

Length of output: 117


Script:

#!/bin/bash
# Let's check package.json for browser targets and other relevant configurations
fd -t f "package.json" -x cat {}

# Also check for any babel config that might define targets
fd -t f "^\.babelrc|babel\.config\.(js|json)$" -x cat {}

# Check for any Next.js config files that might define browser targets
fd -t f "^next\.config\.(js|ts|mjs)$" -x cat {}

Length of output: 28323

@@ -51,7 +51,7 @@
"@web3modal/wagmi": "^5.1.11",
"graphql": "^16.9.0",
"graphql-request": "^7.1.0",
"next": "14.2.14",
"next": "^15.0.3",
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Version mismatch with eslint-config-next

The project is using eslint-config-next@^14.2.15 but upgrading to next@^15.0.3. These versions should match to ensure proper linting rules.

Apply this change:

-    "eslint-config-next": "^14.2.15",
+    "eslint-config-next": "^15.0.3",

Committable suggestion skipped: line range outside the PR's diff.


💡 Codebase verification

⚠️ Potential issue

⚠️ Version mismatch between Next.js and eslint-config-next

The project is using Next.js 15.0.3 but eslint-config-next is still on 14.2.15. This version mismatch could lead to linting issues. However, the project is already using the App Router pattern which is compatible with Next.js 15. Please:

  1. Update eslint-config-next to version 15:
"eslint-config-next": "^15.0.3"
  1. Keep the caret (^) version constraint for Next.js as it's appropriate for framework dependencies within the same major version.
🔗 Analysis chain

⚠️ Major version upgrade requires careful review

This is a major version upgrade from Next.js 14 to 15, which introduces breaking changes. Please ensure:

  1. Review of the Next.js 15 migration guide
  2. Testing of all application features
  3. CI pipeline passes with the new version

Let me gather more information about the Next.js configuration and dependencies to provide a more comprehensive verification.


Let me check the Next.js configuration and app structure to verify potential breaking changes.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for Next.js specific patterns that might need updates in v15
echo "Checking for potential breaking changes..."

# Check for usage of deprecated features
rg -l "getInitialProps|getServerSideProps|getStaticProps|getStaticPaths" 

# Check for custom server implementations
fd "server.js|server.ts"

# Check for custom webpack config
fd "next.config.js|next.config.ts"

Length of output: 233


Script:

#!/bin/bash
# Check package.json for Next.js related dependencies and configurations
cat web-devtools/package.json

# Look for any Next.js specific files and components
fd -e tsx -e jsx -e js -e ts

# Check for app directory structure (Next.js 13+ feature)
fd -t d "app"

# Look for pages directory (traditional Next.js structure)
fd -t d "pages"

Length of output: 26687


Script:

#!/bin/bash
# Check Next.js configuration
cat web-devtools/next.config.js 2>/dev/null || echo "No next.config.js found"

# Check for app directory usage
fd -t f . web-devtools/src/app/

# Check package.json for Next.js related dependencies
grep -A 5 -B 5 "next\":" web-devtools/package.json

Length of output: 1773

@Harman-singh-waraich
Copy link
Contributor Author

Issue found, v14 to v15 update for next breaks the deploy flow

@Harman-singh-waraich Harman-singh-waraich deleted the test/web-devtools branch November 25, 2024 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant