Skip to content

Commit

Permalink
Add deprecations to json/defer jsdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
brophdawg11 committed Oct 17, 2024
1 parent 293649e commit 4a71bcb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/remix-server-runtime/responses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ export type TypedResponse<T = unknown> = Omit<Response, "json"> & {
* This is a shortcut for creating `application/json` responses. Converts `data`
* to JSON and sets the `Content-Type` header.
*
* @deprecated This utility is deprecated in favor of opting into Single Fetch
* via `future.v3_singleFetch` and returning raw objects. This method will be
* removed in React Router v7. If you need to return a JSON Response, you can
* use `Response.json()`.
*
* @see https://remix.run/utils/json
*/
export const json: JsonFunction = (data, init = {}) => {
Expand All @@ -50,6 +55,10 @@ export const json: JsonFunction = (data, init = {}) => {
/**
* This is a shortcut for creating Remix deferred responses
*
* @deprecated This utility is deprecated in favor of opting into Single Fetch
* via `future.v3_singleFetch` and returning raw objects. This method will be
* removed in React Router v7.
*
* @see https://remix.run/utils/defer
*/
export const defer: DeferFunction = (data, init = {}) => {
Expand Down

0 comments on commit 4a71bcb

Please sign in to comment.