-
-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(hono): enable context storage #891
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
When testing this, I receive the "Context is not available" error when trying to access the hono context within a server component. I was able to figure out a way to update the dev server plugin to work with the hono context. It is available there. I'm not so sure about this solution with the waku middleware... I have to reconstruct the hono app to pass the updated env and ctx to the fetch handler. The hono context is immutable once created. https://gist.github.com/rmarscher/9bb6ed54dc9535f4b81bed147204c7e9 Hono has an adapter system for their vite plugin. The cloudflare adapter returns the env and executionContext and they mix that in when invoking fetch: https://github.com/honojs/vite-plugins/blob/main/packages/dev-server/src/dev-server.ts#L124-L137 I created a new PR with a new fetch adapter option for the dev server. I think this will be much more user-friendly for cloudflare devs than copy and pasting a custom plugin. #892 |
Assuming this PR itself is fine, let's merge. |
at least for now. this reverts #891 and re-introduce #852 and #884. #911 (comment)
Instead of #852 and #884, let's use Hono's
getContext
instead.