Accessing CallContext from handlers
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- backend-api-design
Research direction
Start by reading the referenced unenv src/runtime/fetch/call.ts createCall implementation and the linked Nitro Cloudflare entry to understand how CallContext is currently used. Compare the proposed request-property approaches and check existing handler behavior; done means the context properties are accessible from the actual handler without breaking current requests.
Written by the indexing model from the issue text.
Description
CallContext, which is the argument of the handler created by createCall, can have additional properties, but those properties are not passed to the actual handler (such as h3 app) and are not accessible.
Cloudflare Workers, for example, may need access to event and I want a way to access this.
https://github.com/unjs/nitro/blob/v0.4.4/src/runtime/entries/cloudflare.ts#L26
One suggested solution is to add context prop to req.
(req as any)._callContext = context, or (req as any)[symCallContext] = context (using symbol)
- Dominant language
- TypeScript
- Stars
- 17
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from unjs/node-mock-http
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
unjs/node-mock-http#38 ·
-
Dependency Dashboard Open
Difficulty 3/5 1-2 days Newbie friendliness 15/100
unjs/node-mock-http#2 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
unjs/node-mock-http#6 · 1 comment ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
unjs/node-mock-http#5 · 7 comments ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 42/100
unjs/node-mock-http#9 · 2 comments · 3 reactions ·
All issues in unjs/node-mock-http
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
danielmiessler/LifeOS#2218 ·