Skip to content

RSC-first architecture: Apollo scoping, server prefetch, playground cleanup - #187

Merged
mkayander merged 19 commits into
mainfrom
cursor/rsc-improvements-b999
Sep 7, 2026
Merged

mkayander merged 19 commits into
mainfrom
cursor/rsc-improvements-b999

Conversation

@mkayander

@mkayander mkayander commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Code review follow-ups (2316847)

Fixed

  1. Desktop bare /playgroundusePlaygroundPanelsReady no longer blocks forever; useBarePlaygroundBrowseLanding auto-opens project browser on indexable landing.
  2. Cache stalenessrevalidatePublicPlaygroundProject busts playground-public-projects-brief tag alongside per-project SEO on create/update/delete.
  3. Mobile client canonical redirect — Shared appendPlaygroundMobileViewQuery used by server + client; adds ?view=code when canonicalizing on mobile without an existing view param.
  4. redirectingRef wedge — Cleared on pathname change in useClientCanonicalPlaygroundRedirect.
  5. Daily app bar scrollAppChromeLayoutClient in daily layout; removed per-page MainLayout from DailyPageView.

Tests added

  • appendPlaygroundMobileViewQuery.test.ts
  • playgroundProjectSeoCache.test.ts
  • Desktop bare /playground case in usePlaygroundPanelsReady.test.tsx

Verification

  • pnpm lint
  • pnpm test:ci
  • E2E: app-locale-routes, instant-playground-nav
Open in Web Open in Cursor 

…fetch

- Route groups: (marketing) vs (app) with Apollo-only InteractiveDataProviders
- Privacy page: server-rendered PrivacyPageContent inside client PrivacyPageShell
- Playground: server-prefetch via getPlaygroundInitialData + tRPC initialData hydration
- LocaleAppPageShell is a Server Component; ProjectBrowser loads via dynamic import
- Add loading.tsx skeletons for playground and profile instant routes
- Fix stale layout comments about session streaming

Co-authored-by: maxim.kayander1 <maxim.kayander1@gmail.com>
@vercel

vercel Bot commented Sep 5, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
dstruct Ready Ready Preview Sep 7, 2026 6:50am UTC

…ions

- Add vibe-docs/RSC-First-Refactor-Plan.md with phases 2–5
- Cache public project SEO fields with use cache + cacheTag per slug
- Use loadI18nForLocale in resolvePlaygroundPageSeo (reuse cached i18n)
- Wrap playground navigateTo in startTransition for Instant Nav UX

Co-authored-by: maxim.kayander1 <maxim.kayander1@gmail.com>
- getCaseBySlug: map Prisma P2025 to TRPC NOT_FOUND (parity with getBySlug)
- getPlaygroundInitialData: keep project prefetch when case lookup fails
- Add regression test for invalid case slug

Co-authored-by: maxim.kayander1 <maxim.kayander1@gmail.com>
cursoragent and others added 2 commits September 6, 2026 13:08
…tests

- revalidatePlaygroundProjectSeo on project create/update/delete/deleteAll
- Session-aware loadProjectSeoFieldsForSession for owner/admin private SEO
- Remove redundant playground Suspense; rely on loading.tsx
- Add daily loading.tsx skeletons
- Split queryPublicProjectSeoFields for testability; fix revalidateTag profile arg
- Add unit tests for SEO helpers and invalid project slug prefetch

Co-authored-by: maxim.kayander1 <maxim.kayander1@gmail.com>
Co-authored-by: maxim.kayander1 <maxim.kayander1@gmail.com>
…cker

- PlaygroundPageLoading/PlaygroundPageShell share chrome with live page (header + bg)
- Route loading.tsx uses full shell instead of bare SplitPanelsLayoutSkeleton
- Replace useHasMounted gate with SplitPanelsLayoutClient (dynamic, ssr: false)
- usePlaygroundMobileLayout uses SSR device hint to avoid mobile/desktop flash
- Align split layout height with PLAYGROUND_DESKTOP_APP_BAR_HEIGHT (56px)

Co-authored-by: maxim.kayander1 <maxim.kayander1@gmail.com>
Move PlaygroundPageShell to a persistent playground layout so loading.tsx
only swaps the panel skeleton while chrome stays mounted. Prefetch the
split layout chunk and drop the dynamic loading fallback to avoid a
second skeleton pass.

Warm Pyodide from the layout segment instead of CodePanel mount so init
and the progress snackbar are not restarted when the route loading UI
hands off to the page.

Co-authored-by: maxim.kayander1 <maxim.kayander1@gmail.com>
cursoragent and others added 2 commits September 6, 2026 14:47
Add PlaygroundPanelsGate to keep one continuous skeleton from route
loading through split-layout hydration and editor init. Reset project
loading state on playground layout entry, and skip loadStart on the
initial auto-project redirect so panel overlays do not flash back on.

Co-authored-by: maxim.kayander1 <maxim.kayander1@gmail.com>
Co-authored-by: maxim.kayander1 <maxim.kayander1@gmail.com>
…llelization

- Reset panel loading gate when playground URL segments change (back/forward,
  Link navigations) via usePlaygroundSlugLoadingSync
- Consolidate split-layout prefetch into prefetchSplitPanelsLayout helper
- Parallelize allBrief + getBySlug in getPlaygroundInitialData
- Unblock loading gate when project has no cases or no solutions
- Add use client directives to playground runtime hooks
- Fix locale-aware home link on privacy page
- Add tests for slug loading sync

Co-authored-by: maxim.kayander1 <maxim.kayander1@gmail.com>
Resolve incomplete playground URLs on the server (project/case/solution
defaults plus last-visit cookie restore) before prefetching, instead of
chaining three client-side navigations from TestCaseSelectBar and
SolutionSelectBar.

- Add buildCanonicalPlaygroundSlug and resolveCanonicalPlaygroundRedirect
- Mirror lastPlaygroundPath to a cookie for server-side restore
- Extend getPlaygroundInitialData with solution prefetch
- Remove client auto-select effects for project/case/solution defaults
- Map getSolutionBySlug NOT_FOUND like getCaseBySlug

Co-authored-by: maxim.kayander1 <maxim.kayander1@gmail.com>
cursoragent and others added 3 commits September 6, 2026 15:48
Extract createApolloClient factory and ApolloHydrationProvider for
route-scoped cache hydration. Daily and profile pages prefetch LeetCode
GraphQL on the server; playground no longer mounts Apollo globally.

Co-authored-by: maxim.kayander1 <maxim.kayander1@gmail.com>
Move ProjectBrowserProvider to playground layout only; add optional context
for MainAppBar on other routes. Cache anonymous allBrief for server prefetch
and canonical redirects. Skip redundant loadStart when server prefetch matches
URL; append mobile ?view=code in canonical redirect. Update e2e for full slug paths.

Co-authored-by: maxim.kayander1 <maxim.kayander1@gmail.com>
Instant-nav skeletons for home and privacy routes. Document completed
Phase 2 architecture items in vibe-docs.

Co-authored-by: maxim.kayander1 <maxim.kayander1@gmail.com>
@cursor cursor Bot changed the title Adopt RSC-first App Router patterns (provider split, privacy SSR, playground prefetch) RSC-first architecture: Apollo scoping, server prefetch, playground cleanup Sep 6, 2026
…ollo for ProjectModal

- Revert getPlaygroundInitialData to live tRPC allBrief (not use cache) for client hydration
- Add serializePlaygroundInitialData to strip cache metadata before client boundary
- JSON-serialize loadCachedPublicProjectsBrief for server-only redirect cache
- Add useClientCanonicalPlaygroundRedirect for soft-nav canonical URL updates
- Mount ApolloHydrationProvider on playground for ProjectModal LeetCode import
- Update E2E specs to wait for canonical invert-binary-tree path

Co-authored-by: maxim.kayander1 <maxim.kayander1@gmail.com>
cursoragent and others added 2 commits September 6, 2026 20:53
- Skip server/client canonical redirect on bare /playground without last-visit cookie
- Keep /de/playground indexable with Playground SEO title and canonical URL
- Wait for visible app bar home link before clicking in E2E helpers
- Only assert WebGL context-lost console messages after returning to home

Co-authored-by: maxim.kayander1 <maxim.kayander1@gmail.com>
Co-authored-by: maxim.kayander1 <maxim.kayander1@gmail.com>
- Add MarketingLayoutClient with shared MainLayout/PageScrollContainer for home and privacy
- Home hero reads scroll viewport from MarketingScrollContext
- Remove per-page PrivacyPageShell that remounted scroll container on instant nav
- Bail setIsScrolled reducer when value unchanged; simplify scroll handler

Co-authored-by: maxim.kayander1 <maxim.kayander1@gmail.com>
…y chrome

- Desktop bare /playground: panels ready + auto-open project browser
- Revalidate PUBLIC_PROJECTS_BRIEF_CACHE_TAG on public project mutations
- Share appendPlaygroundMobileViewQuery for server + client canonical redirects
- Reset redirectingRef on pathname change; append ?view=code on mobile client nav
- Persistent AppChromeLayoutClient for daily (app bar scroll on instant nav)
- Tests for mobile view query, cache revalidation, desktop bare panels ready

Co-authored-by: maxim.kayander1 <maxim.kayander1@gmail.com>
@mkayander
mkayander merged commit 8546c22 into main Sep 7, 2026
7 checks passed
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 1.392.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants