Skip to content

Conversation

@joaquim-verges
Copy link
Member

@joaquim-verges joaquim-verges commented Sep 30, 2025


PR-Codex overview

This PR introduces a new redirects function in the next.config.ts file to redirect all incoming traffic to a specified external URL.

Detailed summary

  • Added an async redirects() function.
  • The redirects function returns an array containing a single redirect rule.
  • The rule redirects all paths (/:path*) to https://thirdweb.com/ai with a permanent status.

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

Summary by CodeRabbit

  • New Features
    • Implemented a global, permanent redirect: all app routes now forward to https://thirdweb.com/ai. Users visiting any path will be automatically redirected to the new destination, ensuring a consistent entry point to the AI experience across the site.

@vercel
Copy link

vercel bot commented Sep 30, 2025

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

Project Deployment Preview Comments Updated (UTC)
nebula Ready Ready Preview Comment Sep 30, 2025 2:00am
4 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
docs-v2 Skipped Skipped Sep 30, 2025 2:00am
thirdweb_playground Skipped Skipped Sep 30, 2025 2:00am
thirdweb-www Skipped Skipped Sep 30, 2025 2:00am
wallet-ui Skipped Skipped Sep 30, 2025 2:00am

@vercel vercel bot temporarily deployed to Preview – docs-v2 September 30, 2025 01:58 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui September 30, 2025 01:58 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb-www September 30, 2025 01:58 Inactive
@changeset-bot
Copy link

changeset-bot bot commented Sep 30, 2025

⚠️ No Changeset found

Latest commit: b627e4a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel vercel bot temporarily deployed to Preview – thirdweb_playground September 30, 2025 01:59 Inactive
@joaquim-verges joaquim-verges marked this pull request as ready for review September 30, 2025 01:59
@joaquim-verges joaquim-verges requested review from a team as code owners September 30, 2025 01:59
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 30, 2025

Walkthrough

Adds 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

Cohort / File(s) Summary
Next.js config update
apps/nebula/next.config.ts
Introduces async redirects() returning one permanent redirect from "/:path*" to "https://thirdweb.com/ai"; retains existing rewrites and top-level settings.

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)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request description only includes the unpopulated template comments and an autogenerated PR-Codex summary but does not fill in any of the required template sections such as the formatted title, issue tag reference, notes for the reviewer, or instructions for how to test the changes, so it does not meet the repository’s description requirements. Please populate the description template by providing a proper PR title in the required “[SDK/Dashboard/Portal] Feature/Fix: …” format, include an issue tag if applicable, add notes for the reviewer explaining key considerations or context, and specify clear instructions for how to test the redirect functionality.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title “[Nebula] Add permanent redirect to thirdweb.com/ai” clearly and concisely summarizes the primary change by indicating the addition of a redirect in the Nebula app, avoiding extraneous details and reflecting the core functionality being introduced.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch _Nebula_Add_permanent_redirect_to_thirdweb.com/ai

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (1)
  • TEAM-0000: Entity not found: Issue - Could not find referenced Issue.

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

@codecov
Copy link

codecov bot commented Sep 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.28%. Comparing base (ca701a4) to head (b627e4a).
⚠️ Report is 2 commits behind head on main.

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           
Flag Coverage Δ
packages 56.28% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

📥 Commits

Reviewing files that changed from the base of the PR and between ca701a4 and b627e4a.

📒 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 @/types or local types.ts barrels
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless 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 @/types where applicable
Prefer type aliases over interface except for nominal shapes
Avoid any and unknown unless 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)

Comment on lines +67 to +75
async redirects() {
return [
{
source: "/:path*",
destination: "https://thirdweb.com/ai",
permanent: true,
},
];
},
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 | 🟠 Major

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.

@github-actions
Copy link
Contributor

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 64.69 KB (0%) 1.3 s (0%) 363 ms (+148.56% 🔺) 1.7 s
thirdweb (cjs) 361.52 KB (0%) 7.3 s (0%) 1.3 s (-2.95% 🔽) 8.5 s
thirdweb (minimal + tree-shaking) 5.73 KB (0%) 115 ms (0%) 138 ms (+1179.32% 🔺) 252 ms
thirdweb/chains (tree-shaking) 526 B (0%) 11 ms (0%) 41 ms (+412.37% 🔺) 52 ms
thirdweb/react (minimal + tree-shaking) 19.14 KB (0%) 383 ms (0%) 96 ms (+1181.4% 🔺) 479 ms

@joaquim-verges joaquim-verges merged commit 21d5d0b into main Sep 30, 2025
27 checks passed
@joaquim-verges joaquim-verges deleted the _Nebula_Add_permanent_redirect_to_thirdweb.com/ai branch September 30, 2025 18:42
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