Releases: venables/typed-route-handler
Releases · venables/typed-route-handler
v1.1.0
What's new
Recommended usage is as a type-only package. The package previously recommended wrapping your route handler in a
handler()
method, which evolved to be a no-op. Starting in v1.1.0
, the the documentation and exports have been updated to recommend usage as a type-only package. The handler method is still provided, but not recommended.
Because of this, typed-route-handler
can be installed as a devDependency
.
// app/api/[name]/route.ts
import { NextResponse } from "next/server"
import { type Handler, type NextRouteContext } from "typed-route-handler"
type ResponseData = {
name: string
}
type Context = NextRouteContext<{
name: string
}>
export const GET: Handler<ResponseData, Context> = async (req, context) => {
const { name } = await context.params
return NextResponse.json({
name
})
}
v1.0.0
What's Changed
Breaking changes in v1.0.0
- Removed all automatic error handling. This was confusing and potentially dangerous if it swallowed errors. Error handling is often project-specific and trivial to implement (try/catch).
- Removed all error helpers, such as
unauthorized()
which are included in Next v15.1 - Removed all route logging and timing. This is out of scope for the project
- Removed the client-side
typedFetch
method, as this was out of scope for the project and did not operate as the originalfetch
(it assume and parsed a JSON response and consumed the body, which was not ideal).
Full Changelog: v0.4.0...v1.0.0
v0.4.0
v0.3.0
What's Changed
- Fix bug in typed-fetch by @domleboss97 in #2
- Use biome, bun for linting, formatting, and testing instead of eslint, prettier, jest.
New Contributors
- @domleboss97 made their first contribution in #2
Full Changelog: v0.2.4...v0.3.0
v0.1.1
v0.0.5 - Initial Release
🎉 The initial release of typed-route-handler
!