0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-30 22:03:56 -05:00
astro/.changeset/clever-beds-notice.md
Bjorn Lu cdabf6ef02
Remove support for simple objects in endpoints (#9181)
* Deprecate simple object from endpoints

* Update changeset

* Add missing Response return

Co-authored-by: Happydev <81974850+MoustaphaDev@users.noreply.github.com>

* Update .changeset/clever-beds-notice.md

Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>

---------

Co-authored-by: Happydev <81974850+MoustaphaDev@users.noreply.github.com>
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
2023-11-27 12:51:57 -05:00

539 B

astro
major

Removes support for returning simple objects from endpoints (deprecated since Astro 3.0). You should return a Response instead.

ResponseWithEncoding is also removed. You can refactor the code to return a response with an array buffer instead, which is encoding agnostic.

The types for middlewares have also been revised. To type a middleware function, you should now use MiddlewareHandler instead of MiddlewareResponseHandler. If you used defineMiddleware() to type the function, no changes are needed.