H
Hono2mo ago
Whimsy

export Context class as value not as type

@yusukebe Hi, I’ve noticed multiple GitHub issues where developers request access to the Context class. This isn’t just a niche use case—many of us need it for testing, extending functionality, or building features that depend on consistent request handling. In my case, I specifically need Context to implement a unified handler for both WebSocket and HTTPS, and while it works, I literally had to download context.ts from the repo just to use it. That feels like a workaround that shouldn’t be necessary. I understand your concern that exposing Context might lead to confusion or unexpected usage. However, many other libraries solve this by making such internals available while clearly stating that they’re unsupported or may change without notice. That way, advanced users can build what they need without being blocked, while beginners remain unaffected. And what if someone raises an issue, just close it or someone from community can help. Given how many developers are requesting this, I strongly believe it should be treated as a necessity rather than a hidden implementation detail. Could you reconsider making Context officially accessible, even with a disclaimer attached?
4 Replies
yusukebe
yusukebe2mo ago
Okay. I’ll consider it
Whimsy
WhimsyOP3w ago
thanks let me know ig hey I was wondering is there any update on this, Im just now migrating to new architecture and i realized i have to again copy over raw context file i took from github instead of importing it 🥲
yusukebe
yusukebe3w ago
Thank you for pinging. Can you create another issue on GitHub? Let's discuss there

Did you find this page helpful?