Unverified Commit a3d15523 authored by Hong Minhee (洪 民憙)'s avatar Hong Minhee (洪 民憙) Committed by GitHub
Browse files

Merge pull request #431 from dahlia/commonjs

parents c18aec2b e7cab6d3
Loading
Loading
Loading
Loading
+53 −0
Original line number Diff line number Diff line
@@ -61,6 +61,11 @@ To be released.
 -  Added `Federatable.setWebFingerLinksDispatcher()` method to set additional
    links to WebFinger.  [[#119], [#407] by HyeonseoKim]

 -  Added CommonJS support alongside ESM for better NestJS integration and
    broader Node.js ecosystem compatibility.  This eliminates the need for
    Node.js's `--experimental-require-module` flag and resolves dual package
    hazard issues.  [[#429], [#431]]

[FEP-5711]: https://w3id.org/fep/5711
[OStatus 1.0 Draft 2]: https://www.w3.org/community/ostatus/wiki/images/9/93/OStatus_1.0_Draft_2.pdf
[RFC 7033 Section 4.4.4.3]: https://datatracker.ietf.org/doc/html/rfc7033#section-4.4.4.3
@@ -73,6 +78,7 @@ To be released.
[#402]: https://github.com/fedify-dev/fedify/issues/402
[#404]: https://github.com/fedify-dev/fedify/pull/404
[#407]: https://github.com/fedify-dev/fedify/pull/407
[#429]: https://github.com/fedify-dev/fedify/issues/429

### @fedify/cli

@@ -94,6 +100,11 @@ To be released.
[#353]: https://github.com/fedify-dev/fedify/issues/353
[#365]: https://github.com/fedify-dev/fedify/pull/365

### @fedify/amqp

 -  Added CommonJS support alongside ESM for better compatibility with
    CommonJS-based Node.js applications.  [[#429], [#431]]

### @fedify/cfworkers

 -  Created Cloudflare Workers integration as the *@fedify/cfworkers* package.
@@ -106,27 +117,61 @@ To be released.
    Separated from `@fedify/fedify/x/denokv` to improve modularity and
    reduce bundle size.  [[#375] by Chanhaeng Lee]

### @fedify/elysia

 -  Added CommonJS support alongside ESM for better compatibility with
    CommonJS-based Node.js applications.  [[#429], [#431]]

### @fedify/express

 -  Added CommonJS support alongside ESM for better compatibility with
    CommonJS-based Node.js applications.  [[#429], [#431]]

### @fedify/h3

 -  Added CommonJS support alongside ESM for better compatibility with
    CommonJS-based Node.js applications.  [[#429], [#431]]

### @fedify/hono

 -  Created Hono integration as the *@fedify/hono* package.
    Separated from `@fedify/fedify/x/hono` to improve modularity and
    reduce bundle size.  [[#375] by Chanhaeng Lee]

 -  Added CommonJS support alongside ESM for better compatibility with
    CommonJS-based Node.js applications.  [[#429], [#431]]

### @fedify/next

 -  Created [Next.js] integration as the *@fedify/next* package.
    [[#313] by Chanhaeng Lee]

 -  Added CommonJS support alongside ESM for better compatibility with
    CommonJS-based Node.js applications.  [[#429], [#431]]

[Next.js]: https://nextjs.org/
[#313]: https://github.com/fedify-dev/fedify/issues/313

### @fedify/postgres

 -  Added CommonJS support alongside ESM for better compatibility with
    CommonJS-based Node.js applications.  [[#429], [#431]]

### @fedify/redis

 -  Added support for Redis Cluster to the *@fedify/redis* package.
    [[#368] by Michael Barrett]

 -  Added CommonJS support alongside ESM for better compatibility with
    CommonJS-based Node.js applications.  [[#429], [#431]]

[#368]: https://github.com/fedify-dev/fedify/pull/368

### @fedify/sqlite

 -  Added CommonJS support alongside ESM for better compatibility with
    CommonJS-based Node.js applications.  [[#429], [#431]]

### @fedify/sveltekit

 -  Created SvelteKit integration as the *@fedify/sveltekit* package.
@@ -136,9 +181,17 @@ To be released.
 -  Fixed SvelteKit integration hook types to correctly infer the request
    and response types in hooks.  [[#271], [#394] by Chanhaeng Lee]

 -  Added CommonJS support alongside ESM for better compatibility with
    CommonJS-based Node.js applications.  [[#429], [#431]]

[#271]: https://github.com/fedify-dev/fedify/pull/271
[#394]: https://github.com/fedify-dev/fedify/pull/394

### @fedify/testing

 -  Added CommonJS support alongside ESM for better compatibility with
    CommonJS-based Node.js applications.  [[#429], [#431]]


Version 1.8.9
-------------
+1 −1
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@
    "codegen": "deno task -f @fedify/cli codegen",
    "check-versions": "deno run --allow-read --allow-write scripts/check_versions.ts",
    "check-all": {
      "command": "deno fmt --check && deno lint && echo deno check --unstable-temporal $(deno eval 'import m from \"./deno.json\" with { type: \"json\" }; for (let p of m.workspace) console.log(p)')",
      "command": "deno fmt --check && deno lint && deno check --unstable-temporal $(deno eval 'import m from \"./deno.json\" with { type: \"json\" }; for (let p of m.workspace) console.log(p)')",
      "dependencies": [
        "check-versions",
        "codegen"
+6 −2
Original line number Diff line number Diff line
@@ -134,8 +134,9 @@ yarn add @fedify/fedify

:::

Fedify is an ESM-only package, so you need to add `"type": "module"` to the
*package.json* file:
We recommend using [ESM] with Fedify by adding `"type": "module"` to the
*package.json* file. While Fedify also supports [CommonJS] for legacy
compatibility, ESM is the preferred approach:

~~~~ json{2}
{
@@ -145,3 +146,6 @@ Fedify is an ESM-only package, so you need to add `"type": "module"` to the
  }
}
~~~~

[ESM]: https://nodejs.org/api/esm.html
[CommonJS]: https://nodejs.org/docs/latest/api/modules.html
+0 −4
Original line number Diff line number Diff line
@@ -325,10 +325,6 @@ NestJS

*This API is available since Fedify 1.8.0.*

> [!IMPORTANT]
> In a CommonJS-based NestJS project, this ESM-only module requires setting
> `NODE_OPTIONS=--experimental-require-module` at runtime.

[NestJS] is a modular, versatile, and scalable framework for building efficient,
reliable, and scalable server-side applications with Node.js and TypeScript.
The *@fedify/nestjs* package provides a middleware to integrate Fedify with
+6 −2
Original line number Diff line number Diff line
@@ -124,8 +124,10 @@ The above commands will create a *deno.json* (in case of Deno) or *package.json*
> Fedify framework without any issues.

> [!NOTE]
> In Bun and Node.js, you need to add [`"type": "module"`] to the *package.json*
> file because Fedify is an ESM-only package.
> In Bun and Node.js, we recommend adding [`"type": "module"`] to the
> *package.json* file to use [ESM] imports. While Fedify also supports
> [CommonJS] for legacy compatibility, ESM is the preferred and recommended
> approach.

> [!TIP]
> Do you wonder why we need to add *[tsx]* and *@types/node* in the case of
@@ -142,6 +144,8 @@ The above commands will create a *deno.json* (in case of Deno) or *package.json*
[`"unstable"`]: https://docs.deno.com/runtime/manual/tools/unstable_flags/#configuring-flags-in-deno.json
[`Temporal`]: https://tc39.es/proposal-temporal/docs/
[`"type": "module"`]: https://nodejs.org/api/packages.html#type
[ESM]: https://nodejs.org/api/esm.html
[CommonJS]: https://nodejs.org/docs/latest/api/modules.html
[tsx]: https://tsx.is/


Loading