Releases: frandiox/vitedge
Releases · frandiox/vitedge
0.13.2
0.13.1
0.13.0
Features
- API endpoints can now return a Fetch Response (e.g.
return fetch('https://domain.com/resource')
orreturn new Response('...')
. This enables using the API as a proxy. The main way to return data is still using serializable objects such asreturn { data: { value: true } }
. - Props requests during SPA are now more intelligent. If a handler for the current route is not found in the filesystem (
<root>/functions/props/routeName.js
), the request will be skipped. Previously, you had to provideroute.meta.propsGetter: false
manually to skip requests but this is not needed anymore. - Added CORS utilities (see docs).
Fixes
- Worker types.
Breaking changes
- When deploying to Node environments (e.g. Vercel), the
request
passed to the backend handlers (API and Props) is now a Fetch Request to make it similar to the development environment. The original Node's request is provided asrawRequest
. --- CFW deployments are not affected.
0.12.1
0.12.0
0.11.0
- Props/API handlers can now return
status
andstatusText
at the top level (before they had to be wrapped inoptions
). - Support redirects from props handlers by just returning a 3xx status code and a
Location
header. - Errors thrown in props/API handlers are automatically parsed as JSON responses and passed to page components as props.
- Provided a set of common error constructors (e.g.
throw new BadRequestError('yikes', { inputs: ['email'] })
) and a way to extend them.