docs(overview): Describe AsyncLocalStorage wrapping and global context#2060
Conversation
✅ Deploy Preview for cedarjs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Greptile SummaryThis PR documents how ALS wrapping and global context population work. The main changes are:
Confidence Score: 4/5This is close, but the serverless GraphQL row should be corrected before merging.
docs/implementation-docs/2026-03-26-cedarjs-project-overview.md Important Files Changed
Reviews (2): Last reviewed commit: "Add "why"" | Re-trigger Greptile |
| | **Non-UD dev** — Functions | Fastify `onRequest` hook | ✅ | ❌ | ❌ `undefined` | | ||
| | **Non-UD serve/deploy** (baremetal/docker) — GraphQL | Fastify `onRequest` hook | ✅ | ✅ plugin chain | ✅ | | ||
| | **Non-UD serve/deploy** (baremetal/docker) — Functions | Fastify `onRequest` hook | ✅ | ❌ | ❌ `undefined` | | ||
| | **Non-UD deploy** (Netlify/Vercel serverless) — GraphQL | Babel safety net in output | ✅ | ✅ plugin chain | ✅ | |
There was a problem hiding this comment.
Serverless GraphQL path This row still points readers to only the Babel safety net for Netlify/Vercel GraphQL wrapping. Standard GraphQL handlers are also wrapped inside
createGraphQLHandler with getAsyncStoreInstance().run(new Map(), ...), so a reader debugging context.currentUser can still inspect the wrong boundary if the outer transform is absent or skipped. Please include the internal GraphQL handler wrapping in this mechanism.
| | **Non-UD deploy** (Netlify/Vercel serverless) — GraphQL | Babel safety net in output | ✅ | ✅ plugin chain | ✅ | | |
| | **Non-UD deploy** (Netlify/Vercel serverless) — GraphQL | `createGraphQLHandler` internal `store.run()` + Babel safety net in output | ✅ | ✅ plugin chain | ✅ | |
Context Used: Make sure everything in docs/implementation-docs/2... (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
There was a problem hiding this comment.
For an overview doc targeted towards framework developers, not Cedar App developers, this is fine.
Explain how and where asl wrapping is applied. Plus how and where the global context is populated