Skip to content

Commit

Permalink
Remove deprecated APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
dahlia committed Jun 16, 2024
1 parent 6c2db22 commit d066fac
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 42 deletions.
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ To be released.
Instead, use the [x-forwarded-fetch] library to recognize the
`X-Forwarded-Host` and `X-Forwarded-Proto` headers.

- Removed the `Federation.handle()` method which was deprecated in version
0.6.0.

- Removed the `integrateHandlerOptions()` function from
`@fedify/fedify/x/fresh` which was deprecated in version 0.6.0.

- Ephemeral actors and inboxes that the `fedify inbox` command spawns are
now more interoperable with other ActivityPub implementations.

Expand Down
2 changes: 1 addition & 1 deletion docs/manual/actor.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ an actor dispatcher for the `/users/{handle}` path. This pattern syntax
follows the [URI Template] specification.

> [!TIP]
> By registering the actor dispatcher, `Federation.handle()` automatically
> By registering the actor dispatcher, `Federation.fetch()` automatically
> deals with [WebFinger] requests for the actor.
[actors]: https://www.w3.org/TR/activitystreams-core/#actors
Expand Down
2 changes: 1 addition & 1 deletion docs/manual/nodeinfo.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ see the [next section](#nodeinfo-schema).
> [!NOTE]
> Whether or not you expose a NodeInfo endpoint, */.well-known/nodeinfo* is
> automatically handled by `Federation.handle()` method. In case you don't
> automatically handled by `Federation.fetch()` method. In case you don't
> register a NodeInfo dispatcher, Fedify will respond with an empty `links`
> array, e.g.:
>
Expand Down
22 changes: 0 additions & 22 deletions federation/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1155,28 +1155,6 @@ export class Federation<TContextData> {
}
}

/**
* Handles a request related to federation. If a request is not related to
* federation, the `onNotFound` or `onNotAcceptable` callback is called.
*
* Usually, this method is called from a server's request handler or
* a web framework's middleware.
*
* @param request The request object.
* @param parameters The parameters for handling the request.
* @returns The response to the request.
* @deprecated Use {@link Federation.fetch} instead.
*/
handle(
request: Request,
options: FederationFetchOptions<TContextData>,
): Promise<Response> {
getLogger(["fedify", "federation"]).warn(
"Federation.handle() is deprecated. Use Federation.fetch() instead.",
);
return this.fetch(request, options);
}

/**
* Handles a request related to federation. If a request is not related to
* federation, the `onNotFound` or `onNotAcceptable` callback is called.
Expand Down
18 changes: 0 additions & 18 deletions x/fresh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
* @module
* @since 0.4.0
*/
import { getLogger } from "@logtape/logtape";
import type {
Federation,
FederationFetchOptions,
Expand Down Expand Up @@ -71,23 +70,6 @@ export function integrateFetchOptions(
};
}

/**
* Create options for the `federation` object to integrate with Fresh.
*
* @param context A Fresh context.
* @returns Options for the {@link Federation.handle} method.
* @deprecated Use {@link integrateFetchOptions} instead.
*/
export function integrateHandlerOptions(
context: FreshContext,
): Omit<FederationFetchOptions<void>, "contextData"> {
getLogger(["fedify", "x", "fresh"]).warn(
"The integrateHandlerOptions() is deprecated. " +
"Use the integrateFetchOptions() instead.",
);
return integrateFetchOptions(context);
}

/**
* Create a Fresh middleware handler to integrate with the {@link Federation}
* object.
Expand Down

0 comments on commit d066fac

Please sign in to comment.