jeasx 2.4.1 β 2.4.3
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 +35 -27
- package/README.md +2 -2
- package/package.json +7 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2026-03-14 - Jeasx 2.4.3 released
|
|
4
|
+
|
|
5
|
+
π Just some dependency updates...
|
|
6
|
+
|
|
7
|
+
Dependency updates: `fastify@5.8.2`, `esbuild@0.27.4`, `@types/node@25.5.0`
|
|
8
|
+
|
|
9
|
+
## 2026-03-05 - Jeasx 2.4.2 released
|
|
10
|
+
|
|
11
|
+
π Just a patch release to update Fastify to fix [CVE-2026-3419](https://github.com/fastify/fastify/security/advisories/GHSA-573f-x89g-hqp9).
|
|
12
|
+
|
|
13
|
+
Jeasx uses from now on [trusted publishing for npm packages](https://docs.npmjs.com/trusted-publishers) to release new versions.
|
|
14
|
+
|
|
15
|
+
Dependency updates: `fastify@5.8.1`, `jsx-async-runtime@2.0.3`
|
|
16
|
+
|
|
3
17
|
## 2026-03-02 - Jeasx 2.4.1 released
|
|
4
18
|
|
|
5
19
|
π 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 +45,16 @@ export default {
|
|
|
31
45
|
development: process.env.NODE_ENV === "development",
|
|
32
46
|
jsxImportSource: "jsx-async-runtime",
|
|
33
47
|
elementAttributeNameCase: "html",
|
|
34
|
-
stylePropertyNameCase: "css"
|
|
35
|
-
})
|
|
36
|
-
]
|
|
48
|
+
stylePropertyNameCase: "css",
|
|
49
|
+
}),
|
|
50
|
+
],
|
|
37
51
|
}),
|
|
38
52
|
|
|
39
53
|
/** @type {() => import("esbuild").BuildOptions} */
|
|
40
54
|
ESBUILD_BROWSER_OPTIONS: () => ({
|
|
41
|
-
target: ["chrome130", "edge130", "firefox130", "safari18"]
|
|
42
|
-
})
|
|
43
|
-
}
|
|
55
|
+
target: ["chrome130", "edge130", "firefox130", "safari18"],
|
|
56
|
+
}),
|
|
57
|
+
};
|
|
44
58
|
```
|
|
45
59
|
|
|
46
60
|
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 +73,14 @@ export default {
|
|
|
59
73
|
/** @type {() => import("fastify").FastifyServerOptions} */
|
|
60
74
|
FASTIFY_SERVER_OPTIONS: () => ({
|
|
61
75
|
disableRequestLogging: NODE_ENV_IS_DEVELOPMENT,
|
|
62
|
-
bodyLimit: 1024 * 1024
|
|
76
|
+
bodyLimit: 1024 * 1024,
|
|
63
77
|
}),
|
|
64
78
|
|
|
65
79
|
/** @type {() => import("@fastify/static").FastifyStaticOptions} */
|
|
66
80
|
FASTIFY_STATIC_OPTIONS: () => ({
|
|
67
81
|
immutable: !NODE_ENV_IS_DEVELOPMENT,
|
|
68
|
-
maxAge: NODE_ENV_IS_DEVELOPMENT ? 0 : "365d"
|
|
69
|
-
})
|
|
82
|
+
maxAge: NODE_ENV_IS_DEVELOPMENT ? 0 : "365d",
|
|
83
|
+
}),
|
|
70
84
|
};
|
|
71
85
|
```
|
|
72
86
|
|
|
@@ -95,15 +109,12 @@ Dependency updates: `fastify@5.7.4`, `@types/node@24.10.10`
|
|
|
95
109
|
π 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
110
|
|
|
97
111
|
```jsx
|
|
98
|
-
import Layout from "./Layout"
|
|
112
|
+
import Layout from "./Layout";
|
|
99
113
|
|
|
100
114
|
<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>
|
|
115
|
+
# MDX as content companion alongside JSX You can easily access existing `props` in MDX: - Current
|
|
116
|
+
url: {props.request.url}
|
|
117
|
+
</Layout>;
|
|
107
118
|
```
|
|
108
119
|
|
|
109
120
|
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 +134,10 @@ export default {
|
|
|
123
134
|
/** @type import("@mdx-js/esbuild").Options */
|
|
124
135
|
ESBUILD_MDX_OPTIONS: {
|
|
125
136
|
remarkPlugins: [[remarkGFM, { singleTilde: false }]],
|
|
126
|
-
rehypePlugins: [rehypePrismPlus, [rehypeSlug, { prefix: "jeasx-" }]]
|
|
127
|
-
}
|
|
137
|
+
rehypePlugins: [rehypePrismPlus, [rehypeSlug, { prefix: "jeasx-" }]],
|
|
138
|
+
},
|
|
128
139
|
//...
|
|
129
|
-
}
|
|
140
|
+
};
|
|
130
141
|
```
|
|
131
142
|
|
|
132
143
|
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 +147,9 @@ For a full overview of available configuration options and plugins, check out th
|
|
|
136
147
|
```js
|
|
137
148
|
export default {
|
|
138
149
|
/** @type import("esbuild").BuildOptions["target"] */
|
|
139
|
-
ESBUILD_BROWSER_TARGET: ["chrome130", "edge130", "firefox130", "safari18"]
|
|
150
|
+
ESBUILD_BROWSER_TARGET: ["chrome130", "edge130", "firefox130", "safari18"],
|
|
140
151
|
//...
|
|
141
|
-
}
|
|
152
|
+
};
|
|
142
153
|
```
|
|
143
154
|
|
|
144
155
|
Dependency updates: `fastify@5.7.2`, `@fastify/multipart@9.4.0`
|
|
@@ -226,10 +237,7 @@ import { gzip } from "node:zlib";
|
|
|
226
237
|
|
|
227
238
|
export default function ({ request, reply }) {
|
|
228
239
|
this.responseHandler = (payload) => {
|
|
229
|
-
if (
|
|
230
|
-
typeof payload === "string" &&
|
|
231
|
-
request.headers["accept-encoding"]?.includes("gzip")
|
|
232
|
-
) {
|
|
240
|
+
if (typeof payload === "string" && request.headers["accept-encoding"]?.includes("gzip")) {
|
|
233
241
|
reply.header("content-encoding", "gzip");
|
|
234
242
|
return promisify(gzip)(payload);
|
|
235
243
|
} else {
|
|
@@ -324,7 +332,7 @@ This change makes the required code for handling form body requests much easier:
|
|
|
324
332
|
```js
|
|
325
333
|
// Change this code...
|
|
326
334
|
const file = await request.file();
|
|
327
|
-
const upload = await file.toBuffer()
|
|
335
|
+
const upload = await file.toBuffer();
|
|
328
336
|
const format = file.fields["format"]["value"];
|
|
329
337
|
|
|
330
338
|
// ... to this code.
|
|
@@ -352,7 +360,7 @@ To set up an error handler, simply register it in a route of your choice:
|
|
|
352
360
|
this.errorHandler = async (error) => {
|
|
353
361
|
console.error("β", error);
|
|
354
362
|
return <h1>Internal error</h1>;
|
|
355
|
-
}
|
|
363
|
+
};
|
|
356
364
|
```
|
|
357
365
|
|
|
358
366
|
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.3",
|
|
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",
|
|
@@ -31,9 +33,9 @@
|
|
|
31
33
|
"@fastify/formbody": "8.0.2",
|
|
32
34
|
"@fastify/multipart": "9.4.0",
|
|
33
35
|
"@fastify/static": "9.0.0",
|
|
34
|
-
"@types/node": "25.
|
|
35
|
-
"esbuild": "0.27.
|
|
36
|
-
"fastify": "5.
|
|
37
|
-
"jsx-async-runtime": "2.0.
|
|
36
|
+
"@types/node": "25.5.0",
|
|
37
|
+
"esbuild": "0.27.4",
|
|
38
|
+
"fastify": "5.8.2",
|
|
39
|
+
"jsx-async-runtime": "2.0.3"
|
|
38
40
|
}
|
|
39
41
|
}
|