Benno
Explore posts from serversSolidJS renderToString with Hono: Undefined or 'React not defined' error
Hi everyone,
I'm trying to use SolidJS's
renderToString
function within a Hono server to generate SVG components, but I'm running into issues. The renderToString
call always returns undefined, or I get a "React is not defined" error (if I change tsconfig.json
to "jsxImportSource": "solid-js"
). Has anyone successfully integrated SolidJS's JSX rendering with Hono or has ideas how to do so? If so, could you share how you resolved the JSX compilation for SolidJS?
Thanks 🙂
Here's a snippet of my code for context:
1 replies
Enforcing strict types for Hono's c.json() responses?
Is it possible to enforce strict typing for Hono's
c.json()
responses at a top level (hono.Handler<..>
)?
Currently, I can define expected response types like this:
This provides suggestions in c.json({...})
, but doesn't raise a type error for mismatched types:
Hono's internal types for quick reference:
Example: https://github.com/builder-group/community/blob/develop/examples/openapi-router/express/petstore/src/router.ts
Code: https://github.com/builder-group/community/blob/develop/packages/openapi-router/src/types/features/hono.ts5 replies
Enforce OpenAPI types
Hey there,
I'm currently working on a
openapi-router
package, which aims to enforce types (generated from an OpenAPI document using openapi-typescript
) in the routers of web frameworks like Hono or ExpressJs.
I've successfully added support for ExpressJs, as its typings are relatively straightforward. However, I'm finding the Hono types more complex, and I could use some assistance in creating the appropriate Hono types for the openapi-router
package.
Is it even feasible to integrate Hono's advanced typing system with openapi-router
? Any guidance or tips would be appreciated.
Thanks 🙂
Context:
- Hono Types: https://github.com/honojs/hono/blob/main/src/types.ts
- Express types for openapi-router
: https://github.com/inbeta-group/monorepo/blob/develop/packages/openapi-router/src/types/features/express.ts
- Express example for openapi-router
: https://github.com/inbeta-group/monorepo/tree/develop/examples/openapi-router/express/petstore4 replies