-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
docs: update Next.js middleware description #6155
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughA documentation file was updated to replace a reference from Changes
Estimated code review effortπ― 1 (Trivial) | β±οΈ ~2 minutes Suggested labels
Poem
Pre-merge checks and finishing touchesβ Passed checks (3 passed)
β¨ Finishing touchesπ§ͺ Generate unit tests (beta)
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. Comment |
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
π Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
π Files selected for processing (1)
docs/start/framework/react/comparison.md(1 hunks)
π§° Additional context used
π Path-based instructions (1)
docs/**/*.{md,mdx}
π CodeRabbit inference engine (AGENTS.md)
Use relative links to
docs/folder format (e.g.,./guide/data-loading) for internal documentation references
Files:
docs/start/framework/react/comparison.md
| ``` | ||
|
|
||
| **Next.js** has a single middleware.ts file that runs on the Edge Runtime for all requests. It cannot access server-only resources like databases and has limitations compared to Node.js runtime. | ||
| **Next.js** has a single proxy.ts file that runs on the Edge Runtime for all requests. It cannot access server-only resources like databases and has limitations compared to Node.js runtime. |
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.
Inaccuracy: proxy.ts runs on Node.js runtime, not Edge Runtime.
The proxy runtime is Node.js, and it cannot be configured; the edge runtime is NOT supported in proxy. The documentation currently claims proxy.ts "runs on the Edge Runtime," which contradicts the official Next.js 16 documentation. Please correct this to accurately reflect that proxy.ts runs on the Node.js runtime.
π Proposed fix
-**Next.js** has a single proxy.ts file that runs on the Edge Runtime for all requests. It cannot access server-only resources like databases and has limitations compared to Node.js runtime.
+**Next.js** has a single proxy.ts file that runs on the Node.js runtime. Unlike the deprecated middleware.ts (which ran on Edge Runtime), proxy.ts has full access to server-side resources like databases.π Committable suggestion
βΌοΈ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| **Next.js** has a single proxy.ts file that runs on the Edge Runtime for all requests. It cannot access server-only resources like databases and has limitations compared to Node.js runtime. | |
| **Next.js** has a single proxy.ts file that runs on the Node.js runtime. Unlike the deprecated middleware.ts (which ran on Edge Runtime), proxy.ts has full access to server-side resources like databases. |
π€ Prompt for AI Agents
docs/start/framework/react/comparison.md around line 245: the doc incorrectly
states that Next.js proxy.ts runs on the Edge Runtime; update the sentence to
state that proxy.ts runs on the Node.js runtime (cannot be configured to Edge)
and clarify that it therefore can access server-only resources like databases
while edge runtime is not supported for proxy.
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.
@kostyniuk what about this comment here? we also should probably mention both, next 15 and next 16
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.
Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!
π― Changes
Update Next.js middleware description to match the Next.js 16 syntax.
β Checklist
π Release Impact
Summary by CodeRabbit
βοΈ Tip: You can customize this high-level summary in your review settings.