Skip to content

feat(next): App Router marketing home + proxy rewrites#118

Open
mkayander wants to merge 2 commits intomainfrom
cursor/-bc-997053c1-a554-45bb-879b-f5651bae211c-9feb
Open

feat(next): App Router marketing home + proxy rewrites#118
mkayander wants to merge 2 commits intomainfrom
cursor/-bc-997053c1-a554-45bb-879b-f5651bae211c-9feb

Conversation

@mkayander
Copy link
Copy Markdown
Owner

Summary

Serves the marketing home from the App Router while keeping Pages Router for the rest of the app. Next.js 16 does not allow both app/page and pages/index for /, so pages/index.tsx was removed and public URLs are handled via src/proxy.ts rewrites.

Behavior

  • / rewrites internally to /internal-marketing/en (browser URL stays /).
  • /{locale} (configured locale segment) rewrites to /internal-marketing/{locale} so App routes do not shadow Pages (/daily, /playground, etc.).
  • /internal-marketing/* is only used as an internal target; direct access gets the correct x-dstruct-app-locale header when the first segment is a locale.
  • /api/config Edge Config handler is merged into the same proxy.ts (Next.js 16: middleware.ts cannot coexist with proxy.ts).

Implementation notes

  • Root app/layout.tsx: minimal <html lang dir> from headers().get(x-dstruct-app-locale) (set in proxy).
  • app/internal-marketing/[locale]/layout.tsx: generateMetadata + generateStaticParams, getServerSession, loadI18nForLocale, AppRootLayoutClient (MUI AppRouterCacheProvider, tRPC, Redux, Session, Apollo, i18n, ProjectBrowser, etc.).
  • tRPC: createTRPCReact + shared TrpcProvider in _app and App shell; removed @trpc/next / withTRPC.
  • Landing UI: MarketingHomeView (renamed path from former pages/index.tsx for clearer history).

Verification

  • pnpm lint (warnings only, pre-existing)
  • pnpm test (250 tests)
  • SKIP_ENV_VALIDATION=true pnpm exec next build

Follow-ups (optional)

  • next.config i18n is still unsupported for App Router paths; consider migrating remaining Pages to App or a single i18n strategy.
  • Docs that still mention src/pages/index.tsx (i18n strings, internal docs) could be updated to MarketingHomeView / App Router.
Open in Web Open in Cursor 

cursoragent and others added 2 commits April 6, 2026 21:32
…imization

Align next.config with bundled Next.js 16 docs: reactCompiler + babel-plugin-react-compiler, bundlePagesRouterDependencies for the Pages router, and experimental.optimizePackageImports for additional @mui/* packages beyond the defaults. Extend AGENTS.md to point agents at 02-pages/ for this codebase.

Co-authored-by: Max Kayander <mkayander@users.noreply.github.com>
…avatar Image

- Disable X-Powered-By per bundled Pages Router config docs.
- Extend experimental.optimizePackageImports for dnd, Monaco, overlayscrollbars.
- SessionWidget: next/image for avatars with GitHub/Google remotePatterns; unoptimized fallback for other hosts.

Co-authored-by: Max Kayander <mkayander@users.noreply.github.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 6, 2026

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

Project Deployment Actions Updated (UTC)
dstruct Ready Ready Preview, Comment Apr 6, 2026 10:30pm

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