feat(next): App Router marketing home + proxy rewrites#118
Open
feat(next): App Router marketing home + proxy rewrites#118
Conversation
…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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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/pageandpages/indexfor/, sopages/index.tsxwas removed and public URLs are handled viasrc/proxy.tsrewrites.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 correctx-dstruct-app-localeheader when the first segment is a locale./api/configEdge Config handler is merged into the sameproxy.ts(Next.js 16:middleware.tscannot coexist withproxy.ts).Implementation notes
app/layout.tsx: minimal<html lang dir>fromheaders().get(x-dstruct-app-locale)(set in proxy).app/internal-marketing/[locale]/layout.tsx:generateMetadata+generateStaticParams,getServerSession,loadI18nForLocale,AppRootLayoutClient(MUIAppRouterCacheProvider, tRPC, Redux, Session, Apollo, i18n, ProjectBrowser, etc.).createTRPCReact+ sharedTrpcProviderin_appand App shell; removed@trpc/next/withTRPC.MarketingHomeView(renamed path from formerpages/index.tsxfor clearer history).Verification
pnpm lint(warnings only, pre-existing)pnpm test(250 tests)SKIP_ENV_VALIDATION=true pnpm exec next buildFollow-ups (optional)
next.configi18nis still unsupported for App Router paths; consider migrating remaining Pages to App or a single i18n strategy.src/pages/index.tsx(i18n strings, internal docs) could be updated toMarketingHomeView/ App Router.