jeasx 2.4.1 β 2.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -27
- package/README.md +2 -2
- package/package.json +5 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2026-03-05 - Jeasx 2.4.2 released
|
|
4
|
+
|
|
5
|
+
π Just a patch release to update Fastify to fix [CVE-2026-3419](https://github.com/fastify/fastify/security/advisories/GHSA-573f-x89g-hqp9).
|
|
6
|
+
|
|
7
|
+
Jeasx uses from now on [trusted publishing for npm packages](https://docs.npmjs.com/trusted-publishers) to release new versions.
|
|
8
|
+
|
|
9
|
+
Dependency updates: `fastify@5.8.1`, `jsx-async-runtime@2.0.3`
|
|
10
|
+
|
|
3
11
|
## 2026-03-02 - Jeasx 2.4.1 released
|
|
4
12
|
|
|
5
13
|
π This release introduces route prop inheritance from guards. Guards can return objects whose entries are used as additional props for your routes. Previously, only props from the closest guard were used. With this update, props from all guards along the route are collected and passed down. If multiple guards provide props with the same key, the value from the guard nearest to the route takes precedence and overwrites earlier ones.
|
|
@@ -31,16 +39,16 @@ export default {
|
|
|
31
39
|
development: process.env.NODE_ENV === "development",
|
|
32
40
|
jsxImportSource: "jsx-async-runtime",
|
|
33
41
|
elementAttributeNameCase: "html",
|
|
34
|
-
stylePropertyNameCase: "css"
|
|
35
|
-
})
|
|
36
|
-
]
|
|
42
|
+
stylePropertyNameCase: "css",
|
|
43
|
+
}),
|
|
44
|
+
],
|
|
37
45
|
}),
|
|
38
46
|
|
|
39
47
|
/** @type {() => import("esbuild").BuildOptions} */
|
|
40
48
|
ESBUILD_BROWSER_OPTIONS: () => ({
|
|
41
|
-
target: ["chrome130", "edge130", "firefox130", "safari18"]
|
|
42
|
-
})
|
|
43
|
-
}
|
|
49
|
+
target: ["chrome130", "edge130", "firefox130", "safari18"],
|
|
50
|
+
}),
|
|
51
|
+
};
|
|
44
52
|
```
|
|
45
53
|
|
|
46
54
|
The existing configuration options for Fastify (such as `FASTIFY_SERVER_OPTIONS`, `FASTIFY_COOKIE_OPTIONS`, `FASTIFY_MULTIPART_OPTIONS`, `FASTIFY_STATIC_OPTIONS`) now require a minor change: they must be defined as functions instead of plain objects.
|
|
@@ -59,14 +67,14 @@ export default {
|
|
|
59
67
|
/** @type {() => import("fastify").FastifyServerOptions} */
|
|
60
68
|
FASTIFY_SERVER_OPTIONS: () => ({
|
|
61
69
|
disableRequestLogging: NODE_ENV_IS_DEVELOPMENT,
|
|
62
|
-
bodyLimit: 1024 * 1024
|
|
70
|
+
bodyLimit: 1024 * 1024,
|
|
63
71
|
}),
|
|
64
72
|
|
|
65
73
|
/** @type {() => import("@fastify/static").FastifyStaticOptions} */
|
|
66
74
|
FASTIFY_STATIC_OPTIONS: () => ({
|
|
67
75
|
immutable: !NODE_ENV_IS_DEVELOPMENT,
|
|
68
|
-
maxAge: NODE_ENV_IS_DEVELOPMENT ? 0 : "365d"
|
|
69
|
-
})
|
|
76
|
+
maxAge: NODE_ENV_IS_DEVELOPMENT ? 0 : "365d",
|
|
77
|
+
}),
|
|
70
78
|
};
|
|
71
79
|
```
|
|
72
80
|
|
|
@@ -95,15 +103,12 @@ Dependency updates: `fastify@5.7.4`, `@types/node@24.10.10`
|
|
|
95
103
|
π This release introduces support for [MDX](https://mdxjs.com), enabling you to seamlessly embed JSX within Markdown content. Just create a route with a `.mdx` extension, and youβre all set to enhance your websites and blogs with Markdown enriched by dynamic JSX components.
|
|
96
104
|
|
|
97
105
|
```jsx
|
|
98
|
-
import Layout from "./Layout"
|
|
106
|
+
import Layout from "./Layout";
|
|
99
107
|
|
|
100
108
|
<Layout title="MDX - Markdown for the component era">
|
|
101
|
-
# MDX as content companion alongside JSX
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
- Current url: {props.request.url}
|
|
106
|
-
</Layout>
|
|
109
|
+
# MDX as content companion alongside JSX You can easily access existing `props` in MDX: - Current
|
|
110
|
+
url: {props.request.url}
|
|
111
|
+
</Layout>;
|
|
107
112
|
```
|
|
108
113
|
|
|
109
114
|
You can also create MDX-based components for use within JSX by importing them with their full `.mdx` file extension into your JSX routes or components.
|
|
@@ -123,10 +128,10 @@ export default {
|
|
|
123
128
|
/** @type import("@mdx-js/esbuild").Options */
|
|
124
129
|
ESBUILD_MDX_OPTIONS: {
|
|
125
130
|
remarkPlugins: [[remarkGFM, { singleTilde: false }]],
|
|
126
|
-
rehypePlugins: [rehypePrismPlus, [rehypeSlug, { prefix: "jeasx-" }]]
|
|
127
|
-
}
|
|
131
|
+
rehypePlugins: [rehypePrismPlus, [rehypeSlug, { prefix: "jeasx-" }]],
|
|
132
|
+
},
|
|
128
133
|
//...
|
|
129
|
-
}
|
|
134
|
+
};
|
|
130
135
|
```
|
|
131
136
|
|
|
132
137
|
For a full overview of available configuration options and plugins, check out the excellent documentation of [@mdx-js/esbuild](https://mdxjs.com/packages/esbuild).
|
|
@@ -136,9 +141,9 @@ For a full overview of available configuration options and plugins, check out th
|
|
|
136
141
|
```js
|
|
137
142
|
export default {
|
|
138
143
|
/** @type import("esbuild").BuildOptions["target"] */
|
|
139
|
-
ESBUILD_BROWSER_TARGET: ["chrome130", "edge130", "firefox130", "safari18"]
|
|
144
|
+
ESBUILD_BROWSER_TARGET: ["chrome130", "edge130", "firefox130", "safari18"],
|
|
140
145
|
//...
|
|
141
|
-
}
|
|
146
|
+
};
|
|
142
147
|
```
|
|
143
148
|
|
|
144
149
|
Dependency updates: `fastify@5.7.2`, `@fastify/multipart@9.4.0`
|
|
@@ -226,10 +231,7 @@ import { gzip } from "node:zlib";
|
|
|
226
231
|
|
|
227
232
|
export default function ({ request, reply }) {
|
|
228
233
|
this.responseHandler = (payload) => {
|
|
229
|
-
if (
|
|
230
|
-
typeof payload === "string" &&
|
|
231
|
-
request.headers["accept-encoding"]?.includes("gzip")
|
|
232
|
-
) {
|
|
234
|
+
if (typeof payload === "string" && request.headers["accept-encoding"]?.includes("gzip")) {
|
|
233
235
|
reply.header("content-encoding", "gzip");
|
|
234
236
|
return promisify(gzip)(payload);
|
|
235
237
|
} else {
|
|
@@ -324,7 +326,7 @@ This change makes the required code for handling form body requests much easier:
|
|
|
324
326
|
```js
|
|
325
327
|
// Change this code...
|
|
326
328
|
const file = await request.file();
|
|
327
|
-
const upload = await file.toBuffer()
|
|
329
|
+
const upload = await file.toBuffer();
|
|
328
330
|
const format = file.fields["format"]["value"];
|
|
329
331
|
|
|
330
332
|
// ... to this code.
|
|
@@ -352,7 +354,7 @@ To set up an error handler, simply register it in a route of your choice:
|
|
|
352
354
|
this.errorHandler = async (error) => {
|
|
353
355
|
console.error("β", error);
|
|
354
356
|
return <h1>Internal error</h1>;
|
|
355
|
-
}
|
|
357
|
+
};
|
|
356
358
|
```
|
|
357
359
|
|
|
358
360
|
An error handler is called with this as context, allowing easy access to your context setup.
|
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jeasx",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.2",
|
|
4
4
|
"description": "Jeasx - the ease of JSX with the power of SSR",
|
|
5
5
|
"keywords": [
|
|
6
|
+
"async",
|
|
7
|
+
"esbuild",
|
|
6
8
|
"fastify",
|
|
7
9
|
"jsx",
|
|
8
10
|
"node",
|
|
@@ -33,7 +35,7 @@
|
|
|
33
35
|
"@fastify/static": "9.0.0",
|
|
34
36
|
"@types/node": "25.3.3",
|
|
35
37
|
"esbuild": "0.27.3",
|
|
36
|
-
"fastify": "5.
|
|
37
|
-
"jsx-async-runtime": "2.0.
|
|
38
|
+
"fastify": "5.8.1",
|
|
39
|
+
"jsx-async-runtime": "2.0.3"
|
|
38
40
|
}
|
|
39
41
|
}
|