Refactor: scope requestStore to dynamic renders only (#72312)#5
Refactor: scope requestStore to dynamic renders only (#72312)#5MitchLewis930 wants to merge 1 commit intopr_035_beforefrom
Conversation
This completes the refactor to eliminate a requestStore scoped around prerenders. Now we only scope requestStore around dynamic renders. If you are prerendering then the workUnitAsyncStorage will only have a prerneder store or undefined. While it is possible to shadow stores because you can enter a cache scope from a render or prerender it generally should never be the case that you enter a prerender from a request or enter a request from a prerender. These are effectively top level scopes. This should not change any program behavior stacked on vercel#72212
📝 WalkthroughWalkthroughPropagates request-scoped context through rendering and server action flows by introducing Changes
Sequence DiagramsequenceDiagram
participant Client
participant ActionHandler as Action Handler
participant AsyncStorage as workUnitAsyncStorage
participant RequestStore as RequestStore
participant FlightGen as Flight Generation
Client->>ActionHandler: invoke server action
ActionHandler->>AsyncStorage: run(requestStore, callback)
AsyncStorage->>RequestStore: establish request-scoped context
AsyncStorage->>ActionHandler: execute handler within context
ActionHandler->>FlightGen: finalizeAndGenerateFlight(req, ctx, requestStore, ...)
FlightGen->>RequestStore: read/write request-scoped data
FlightGen-->>ActionHandler: return flight payload
ActionHandler-->>Client: send response
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
🧰 Additional context used🧬 Code graph analysis (3)packages/next/src/server/app-render/action-handler.ts (6)
packages/next/src/server/async-storage/request-store.ts (2)
packages/next/src/server/app-render/app-render.tsx (7)
🔇 Additional comments (9)
✏️ Tip: You can disable this entire section by setting Comment |
|
@CodeRabbit full review |
✅ Actions performedFull review triggered. |
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
PR_035
Summary by CodeRabbit