-
Notifications
You must be signed in to change notification settings - Fork 620
[Nebula] Add permanent redirect to thirdweb.com/ai #8155
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
[Nebula] Add permanent redirect to thirdweb.com/ai #8155
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
4 Skipped Deployments
|
|
WalkthroughAdds an async redirects() to Next.js config in apps/nebula/next.config.ts to redirect all paths ("/:path*") to https://thirdweb.com/ai with permanent: true. Integrates alongside existing config (reactStrictMode, productionBrowserSourceMaps) and precedes rewrites. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant U as User Agent (Browser)
participant N as Next.js (nebula)
participant T as thirdweb.com/ai
U->>N: GET /any/path
Note over N: redirects() evaluates rules
N-->>U: 308 Permanent Redirect<br/>(Location: https://thirdweb.com/ai)
U->>T: GET https://thirdweb.com/ai
T-->>U: 200 OK (AI page)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8155 +/- ##
=======================================
Coverage 56.28% 56.28%
=======================================
Files 906 906
Lines 59208 59208
Branches 4180 4180
=======================================
Hits 33324 33324
Misses 25779 25779
Partials 105 105
🚀 New features to boost your workflow:
|
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: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
apps/nebula/next.config.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
**/*.{ts,tsx}: Write idiomatic TypeScript with explicit function declarations and return types
Limit each file to one stateless, single-responsibility function for clarity
Re-use shared types from@/typesor localtypes.tsbarrels
Prefer type aliases over interface except for nominal shapes
Avoidanyandunknownunless unavoidable; narrow generics when possible
Choose composition over inheritance; leverage utility types (Partial,Pick, etc.)
Comment only ambiguous logic; avoid restating TypeScript in prose
**/*.{ts,tsx}: Use explicit function declarations and explicit return types in TypeScript
Limit each file to one stateless, single‑responsibility function
Re‑use shared types from@/typeswhere applicable
Prefertypealiases overinterfaceexcept for nominal shapes
Avoidanyandunknownunless unavoidable; narrow generics when possible
Prefer composition over inheritance; use utility types (Partial, Pick, etc.)
Lazy‑import optional features and avoid top‑level side‑effects to reduce bundle size
Files:
apps/nebula/next.config.ts
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Load heavy dependencies inside async paths to keep initial bundle lean (lazy loading)
Files:
apps/nebula/next.config.ts
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{ts,tsx} : Redirect logic using `redirect()` from `next/navigation`.
Learnt from: MananTank
PR: thirdweb-dev/js#7285
File: apps/dashboard/src/app/(app)/(dashboard)/published-contract/components/uri-based-deploy.tsx:57-57
Timestamp: 2025-06-05T13:59:49.886Z
Learning: In the thirdweb dashboard Next.js app, when using loginRedirect() in server components, ensure to add a return statement after the redirect call to prevent further code execution and potential security issues.
📚 Learning: 2025-07-18T19:20:32.530Z
Learnt from: CR
PR: thirdweb-dev/js#0
File: .cursor/rules/dashboard.mdc:0-0
Timestamp: 2025-07-18T19:20:32.530Z
Learning: Applies to dashboard/**/*.{ts,tsx} : Redirect logic using `redirect()` from `next/navigation`.
Applied to files:
apps/nebula/next.config.ts
⏰ 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). (4)
- GitHub Check: Size
- GitHub Check: E2E Tests (pnpm, webpack)
- GitHub Check: Lint Packages
- GitHub Check: Analyze (javascript)
| async redirects() { | ||
| return [ | ||
| { | ||
| source: "/:path*", | ||
| destination: "https://thirdweb.com/ai", | ||
| permanent: true, | ||
| }, | ||
| ]; | ||
| }, |
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.
Exclude PostHog proxy paths from the global redirect.
This blanket /:path* redirect fires before rewrites(), so the _ph proxies you defined just below will never run—every analytics call (e.g., /_ph/static, /_ph/decide) now 308s to https://thirdweb.com/ai. That effectively breaks PostHog ingestion for the Nebula domain. Please carve out the analytics paths (and any other internal endpoints you still rely on) before landing the catch-all redirect.
[suggested fix]
async redirects() {
return [
{
- source: "/:path*",
+ source: "/:path((?!_ph(?:/|$)).*)",
destination: "https://thirdweb.com/ai",
permanent: true,
},
];
},🤖 Prompt for AI Agents
In apps/nebula/next.config.ts around lines 67 to 75, the catch-all redirect
source "/:path*" is swallowing your PostHog proxy endpoints (/_ph/*) before
rewrites run; update the redirect to exclude those internal paths by using a
negative-lookahead regex in the source (for example source: "/((?!_ph).*)") so
requests whose first segment is "_ph" will not match and will continue to
rewrites, and keep the rest of the redirect object (destination and permanent)
unchanged.
size-limit report 📦
|
PR-Codex overview
This PR introduces a new
redirectsfunction in thenext.config.tsfile to redirect all incoming traffic to a specified external URL.Detailed summary
async redirects()function.redirectsfunction returns an array containing a single redirect rule./:path*) tohttps://thirdweb.com/aiwith a permanent status.Summary by CodeRabbit