Closed kwhitley closed 1 year ago
Hey @kwhitley thanks for posting this here I wasn't aware of such update coming to itty-router (core), we will do tests to ensure everything will work on this newer version and update our documentation as soon as possible
Thanks 😃
Also, are you thinking in adding support for class-based endpoints in itty-router (core)? like what we got in here
import { OpenAPIRoute, Query, Int, Str } from '@cloudflare/itty-router-openapi'
export class ToDoList extends OpenAPIRoute {
static schema = {...}
async handle(request: Request, data: Record<string, any>) {
const { page } = data
return {
currentPage: page,
nextPage: page + 1,
results: ['lorem', 'ipsum'],
}
}
}
Nah, that's out of scope for itty (at least for right now), so definitely on you guys :)
I'd be happy to explore it down the road though!
I'm pretty confident I just nailed the re-typing of itty, so all the latest can be found here, and hopefully we'll be looking at a final release (and off the next
tag) in a day or two. Just finalizing the docs, and trying to get eyes/testers on it!
Main v4.x docs https://itty.dev/itty-router
Btw, I'd love a simple example demo/description for this project (using the v4 itty-router@next
) syntax - I'll add it to the docs with a link back to your full documentation :)
Hey @kwhitley the upgrade to itty-router 4.x will take a while from our library, we are planning to bundle it with a lot of changes
I submitted a PR just now (#60) with the minimal impact inclusion if you're interested :)
Closing this issue, has we have now fully migrated to itty-router 4.x Thanks @kwhitley 😄
Just a heads up...
This shouldn't break anything on your end, but there are a bunch of quality of life enhancements coming to itty-router (core) very soon that you may want to include in your documentation. The more boilerplate we can remove, the easier all these libs are for folks to adopt! :)
https://github.com/kwhitley/itty-router/pull/148