Skip to content

Use remote patterns over domains in next config images#1620

Merged
prxt6529 merged 1 commit intomainfrom
next-images-remote-patterns
Nov 28, 2025
Merged

Use remote patterns over domains in next config images#1620
prxt6529 merged 1 commit intomainfrom
next-images-remote-patterns

Conversation

@prxt6529
Copy link
Copy Markdown
Collaborator

@prxt6529 prxt6529 commented Nov 28, 2025

Summary by CodeRabbit

  • Chores
    • Enhanced image loading configuration to support additional content delivery services, enabling the application to retrieve images from expanded external sources.

✏️ Tip: You can customize this high-level summary in your review settings.

Signed-off-by: prxt6529 <prxt@6529.io>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Nov 28, 2025

Walkthrough

Next.js image configuration updated from deprecated domains array to pattern-based remotePatterns approach. Preserves existing image host access and adds support for additional remote image sources including seadn.io and Cloudinary.

Changes

Cohort / File(s) Change Summary
Next.js Image Configuration
next.config.mjs
Replaced images.domains with images.remotePatterns; migrated existing domain whitelist (6529.io, staging.6529.io, arweave.net, localhost, media.generator.seize.io, d3lqz0a4bldqgf.cloudfront.net, ipfs.6529.io) to pattern-based format; added new remotePatterns for i.seadn.io, i2.seadn.io, i2c.seadn.io, res.cloudinary.com, and ipfs.io with specified protocols

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Configuration-only change with straightforward migration from deprecated to current Next.js API
  • Single file affected with repetitive pattern entries
  • No behavioral or logic changes to review

Poem

🐰 Hops with glee, the config's bright,
Domains old now patterns new—
Images dance from hosts worldwide,
Seadn, Cloudinary too,
More faces shown, our NFTs flew!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: migrating from the deprecated images.domains to images.remotePatterns in the Next.js configuration, which is the core focus of the changeset.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch next-images-remote-patterns

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown

@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

🧹 Nitpick comments (2)
next.config.mjs (2)

149-149: Consider restricting localhost to development environments.

The localhost pattern with http protocol is included in all environments. While this is common for local development, it's unnecessary in production builds.

Consider conditionally including this pattern only in development:

     images: {
       loader: "default",
       remotePatterns: [
         { protocol: "https", hostname: "6529.io" },
         { protocol: "https", hostname: "staging.6529.io" },
         { protocol: "https", hostname: "arweave.net" },
-        { protocol: "http", hostname: "localhost" },
+        ...(process.env.NODE_ENV === "development" 
+          ? [{ protocol: "http", hostname: "localhost" }] 
+          : []),
         { protocol: "https", hostname: "media.generator.seize.io" },

152-157: New remote patterns added correctly.

The new image sources (OpenSea CDN, Cloudinary, and IPFS gateway) are correctly configured with HTTPS. These are legitimate CDN providers commonly used for NFT and user-generated content.

For enhanced security, you could optionally add pathname restrictions to limit which paths are accessible:

{ 
  protocol: "https", 
  hostname: "res.cloudinary.com",
  pathname: "/your-cloud-name/**"  // Restrict to your Cloudinary account
},
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8a570ac and 0a268f8.

📒 Files selected for processing (1)
  • next.config.mjs (1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:14.939Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `<Image>` from `next/image` instead of HTML `<img>` elements
📚 Learning: 2025-11-25T08:37:14.939Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T08:37:14.939Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use `<Image>` from `next/image` instead of HTML `<img>` elements

Applied to files:

  • next.config.mjs
📚 Learning: 2025-11-25T08:35:58.721Z
Learnt from: CR
Repo: 6529-Collections/6529seize-frontend PR: 0
File: .cursorrules:0-0
Timestamp: 2025-11-25T08:35:58.721Z
Learning: Applies to **/*.{ts,tsx,js,jsx} : Use NextJS features that match the current version

Applied to files:

  • next.config.mjs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
next.config.mjs (1)

145-158: Good migration to remotePatterns.

The migration from the deprecated domains array to remotePatterns follows Next.js best practices and provides more granular control over remote image sources.

Verified:

  • Next.js version 16.0.0 fully supports remotePatterns (introduced in Next.js 12.3.0)
  • Configuration is syntactically correct with 12 properly formatted patterns
  • The deprecated domains array has been fully removed
  • <Image> components throughout the codebase actively load from these remote sources (IPFS, Arweave, Cloudinary, Seadn, etc.)

@prxt6529 prxt6529 merged commit aea1847 into main Nov 28, 2025
9 checks passed
This was referenced Mar 2, 2026
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.

2 participants