Unverified Commit 3b9de327 authored by Hong Minhee's avatar Hong Minhee
Browse files

@fedify/fedify/x/fresh module

parent 5312d9a3
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -13,6 +13,14 @@ Version 0.4.0

To be released.

 -  Added `@fedify/fedify/x/fresh` module for integrating with [Fresh]
    middleware.

     -  Added `integrateHandler()` function.
     -  Added `integrateHandlerOptions()` function.

[Fresh]: https://fresh.deno.dev/


Version 0.3.0
-------------
+2 −1
Original line number Diff line number Diff line
@@ -8,7 +8,8 @@
    "./nodeinfo": "./nodeinfo/mod.ts",
    "./runtime": "./runtime/mod.ts",
    "./vocab": "./vocab/mod.ts",
    "./webfinger": "./webfinger/mod.ts"
    "./webfinger": "./webfinger/mod.ts",
    "./x/fresh": "./x/fresh.ts"
  },
  "imports": {
    "@cfworker/json-schema": "npm:@cfworker/json-schema@^1.12.8",
+13 −0
Original line number Diff line number Diff line
@@ -142,6 +142,19 @@ as [`Request`] and [`Response`] objects. In that case, you need to convert
the request and response objects to the appropriate types that the `Federation`
object can handle.

> [!NOTE]
> The above example artificially shows a verbose way to integrate
> the `Federation` object with Fresh, so that a user of other web frameworks
> can understand the concept.  In practice, you can define a middleware
> using `integrateHandler()` function from `@fedify/fedify/x/fresh` module:
>
> ~~~~ typescript
> import { federation } from "../federation.ts"; // Import the `Federation` object
> import { integrateHandler } from "jsr:@fedify/fedify/x/fresh";
>
> export const handler = integrateHandler(federation, () => undefined);
> ~~~~

> [!TIP]
> In theory, you can directly pass `Federation.handle()` to the [`Deno.serve()`]
> function, but you probably wouldn't want to do that because you want to handle
+1 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@
    "@fedify/fedify/runtime": "../../runtime/mod.ts",
    "@fedify/fedify/vocab": "../../vocab/mod.ts",
    "@fedify/fedify/webfinger": "../../webfinger/mod.ts",
    "@fedify/fedify/x/fresh": "../../x/fresh.ts",
    "markdown-it": "npm:markdown-it@^14.0.0",
    "preact": "https://esm.sh/preact@10.19.2",
    "preact/": "https://esm.sh/preact@10.19.2/",
+1 −0
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@
    "@fedify/fedify/runtime": "../../runtime/mod.ts",
    "@fedify/fedify/vocab": "../../vocab/mod.ts",
    "@fedify/fedify/webfinger": "../../webfinger/mod.ts",
    "@fedify/fedify/x/fresh": "../../x/fresh.ts",
    "markdown-it": "npm:markdown-it@^14.0.0",
    "preact": "https://esm.sh/preact@10.19.2",
    "preact/": "https://esm.sh/preact@10.19.2/",
Loading