Skip to content

feat(site): next-config#7750

Merged
mhartington merged 1 commit intomainfrom
next-config-for-deploy
Apr 2, 2026
Merged

feat(site): next-config#7750
mhartington merged 1 commit intomainfrom
next-config-for-deploy

Conversation

@mhartington
Copy link
Copy Markdown
Member

@mhartington mhartington commented Apr 2, 2026

Summary by CodeRabbit

  • New Features
    • Implemented comprehensive redirect rules for legacy domain migrations
    • Added documentation and blog content proxying through environment-based configuration
    • Enabled production-time configuration validation for origin endpoints

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
blog Ready Ready Preview, Comment Apr 2, 2026 2:19pm
docs Ready Ready Preview, Comment Apr 2, 2026 2:19pm
eclipse Ready Ready Preview, Comment Apr 2, 2026 2:19pm
site Ready Ready Preview, Comment Apr 2, 2026 2:19pm

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 2, 2026

Walkthrough

The next.config.mjs file was significantly enhanced to add environment-derived proxy origin configuration, production-time validation for required environment variables, comprehensive redirect rules for legacy subdomains and paths, and advanced rewrite logic for docs and blog proxying.

Changes

Cohort / File(s) Summary
Configuration & Redirects & Rewrites
apps/site/next.config.mjs
Added environment-derived configuration for NEXT_DOCS_ORIGIN and NEXT_BLOG_ORIGIN with fallback defaults and hostname extraction. Introduced production-time validation that throws errors if origins are missing. Replaced empty redirects array with extensive redirect rules covering legacy subdomains (prisma.studio, prismagraphql.com, jobs.prisma.io, etc.) and path-based migrations for blog, docs, and forum content. Replaced simple MDX rewrite with a full rewrites object containing beforeFiles rules for proxying /docs, /blog, and static assets to their respective origins using host-based constraints, plus fallback rules for selected assets.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'feat(site): next-config' is vague and generic, using non-descriptive terms that don't convey the meaningful changes (environment-derived configuration, production validation, redirects/rewrites implementation). Consider a more descriptive title such as 'feat(site): add environment-driven proxy rewrites and redirect rules for docs/blog' to better reflect the substantial configuration changes.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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.

@argos-ci
Copy link
Copy Markdown

argos-ci bot commented Apr 2, 2026

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Apr 2, 2026, 2:19 PM

Copy link
Copy Markdown
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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/site/next.config.mjs (1)

245-255: ⚠️ Potential issue | 🟠 Major

Duplicate object properties create dead code.

The config object defines redirects() here (returning []) and rewrites() (returning the MDX rewrite), but both are overwritten by the later definitions at lines 269 and 745 respectively. In JavaScript, when an object literal has duplicate keys, the last value wins—so this entire block is unreachable dead code.

Two concerns:

  1. The MDX rewrite (/:path*.mdx/llms.mdx/:path*) is silently removed since it's not in the new rewrites(). Verify this is intentional.
  2. The empty redirects() here is pointless.
🔧 Remove the dead code
 /** `@type` {import('next').NextConfig} */
 const config = {
   reactCompiler: true,
-  async redirects() {
-    return [];
-  },
-  async rewrites() {
-    return [
-      {
-        source: "/:path*.mdx",
-        destination: "/llms.mdx/:path*",
-      },
-    ];
-  },
   assetPrefix: "/site-static",

If the MDX rewrite is still needed, add it to the new rewrites() object (e.g., in the beforeFiles or afterFiles array).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/site/next.config.mjs` around lines 245 - 255, The object literal defines
redirects() and rewrites() twice so the earlier definitions (the empty async
redirects() and the async rewrites() that returns the MDX rule
source:"/:path*.mdx" → destination:"/llms.mdx/:path*") are dead — remove the
first redirects() or make it consistent with the final redirects(), and if the
MDX rewrite is required, move its rule into the final async rewrites() (placing
it in the appropriate array such as beforeFiles or afterFiles) so the MDX
mapping is preserved; update or delete the empty redirects() definition
accordingly and keep only the final redirects() and rewrites() implementations.
🧹 Nitpick comments (1)
apps/site/next.config.mjs (1)

795-818: Commented-out code and TODO indicate incomplete cleanup.

Line 807 has a TODO questioning whether the /jobs rewrite should be removed since there's already a redirect to /careers. Line 814-817 has commented-out RSS rewrite code.

Consider resolving these before merging:

  • Remove the TODO comment once you verify the /jobs path isn't needed in fallback rewrites (the redirect at line 599-602 handles it)
  • Either remove or uncomment the RSS rewrite based on requirements
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/site/next.config.mjs` around lines 795 - 818, The fallback rewrites
contain a TODO about the /jobs path and commented-out RSS rewrite; verify
whether the existing redirect for "/jobs" -> "/careers" is relied upon (search
for the redirect that points "/jobs" to "/careers") and if so remove the TODO
and any redundant "/jobs" entry from the fallback array, and then either remove
the commented RSS block entirely or restore it (uncomment and point to the
correct feed) based on whether the RSS feed is required; update the fallback
array accordingly to keep only active rewrites (e.g., entries like the "/ga.js",
"/gastats.js", and "/dataguide/:any*" objects) and remove stale comments.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/site/next.config.mjs`:
- Around line 23-35: The thrown Error in the production-env check uses incorrect
variable names in its messages; update the message strings constructed in the
Error (inside the if block that checks process.env.NODE_ENV and
process.env.NEXT_DOCS_ORIGIN / process.env.NEXT_BLOG_ORIGIN) to reference
NEXT_DOCS_ORIGIN and NEXT_BLOG_ORIGIN respectively so the error reads e.g.
"NEXT_DOCS_ORIGIN is required in production" and "NEXT_BLOG_ORIGIN is required
in production".
- Around line 700-704: Remove the duplicated redirect entry that has permanent:
true and source: "/blog/increased-security-static-ip-support-prisma-pulse"
pointing to "https://www.prisma.io/docs/postgres"; locate the redirects array
where that source appears and delete the second/duplicate object so only one
redirect object for that source/destination remains.

---

Outside diff comments:
In `@apps/site/next.config.mjs`:
- Around line 245-255: The object literal defines redirects() and rewrites()
twice so the earlier definitions (the empty async redirects() and the async
rewrites() that returns the MDX rule source:"/:path*.mdx" →
destination:"/llms.mdx/:path*") are dead — remove the first redirects() or make
it consistent with the final redirects(), and if the MDX rewrite is required,
move its rule into the final async rewrites() (placing it in the appropriate
array such as beforeFiles or afterFiles) so the MDX mapping is preserved; update
or delete the empty redirects() definition accordingly and keep only the final
redirects() and rewrites() implementations.

---

Nitpick comments:
In `@apps/site/next.config.mjs`:
- Around line 795-818: The fallback rewrites contain a TODO about the /jobs path
and commented-out RSS rewrite; verify whether the existing redirect for "/jobs"
-> "/careers" is relied upon (search for the redirect that points "/jobs" to
"/careers") and if so remove the TODO and any redundant "/jobs" entry from the
fallback array, and then either remove the commented RSS block entirely or
restore it (uncomment and point to the correct feed) based on whether the RSS
feed is required; update the fallback array accordingly to keep only active
rewrites (e.g., entries like the "/ga.js", "/gastats.js", and "/dataguide/:any*"
objects) and remove stale comments.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 256c6ff8-0aaf-4bd5-8a2c-fe29f1e89f57

📥 Commits

Reviewing files that changed from the base of the PR and between 3b6c3f8 and f23e181.

📒 Files selected for processing (1)
  • apps/site/next.config.mjs

@mhartington mhartington merged commit 89a4c9a into main Apr 2, 2026
18 checks passed
@mhartington mhartington deleted the next-config-for-deploy branch April 2, 2026 14:26
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