Skip to content

typesafe routing and querystring definitions #306

@airtonix

Description

@airtonix

What is the feature you are proposing?

like tanstack router has, it'd be great to have the same assurances in both hono and honox.

Just to clarify, I don't mean this alone:

https://github.com/honojs/middleware/tree/main/packages/zod-openapi

but also:

  • the ability to use them as routes for a tags.

app/routes/about.tsx

import { createRoute } from 'honox/factory'
import Counter from '../islands/counter'

export default createRoute((c) => {
  return c.render(
    <div>
      <h1>About</h1>
      <Counter />
    </div>
  )
})

app/routes/index.tsx

import { createRoute } from 'honox/factory'
import Counter from '../islands/counter'
import AboutRoute from './about.js';

export default createRoute((c) => {
  return c.render(
    <div>
      <h1>Hello</h1>
      <Counter />
      <a href={AboutRoute.href}>About</a>
    </div>
  )
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions