Skip to content

Commit d19dce6

Browse files
committed
🎉 feat: kita 2.2
1 parent 4c2b717 commit d19dce6

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# 0.6.6 - 11 Sep 2023
2+
Improvement:
3+
- [#12](https://github.com/elysiajs/elysia-html/pull/12) update Kita to 2.2.1
4+
- add `autoDetect`, `autoDoctype`, `contentType` and `isHtml` by [@authurfiorette](https://github.com/arthurfiorette)
5+
6+
7+
Breaking Change:
8+
- Rename `ElysiaJSX`, `ElysiaJSX.Fragment` to `Html.createElement`, and `Html.Fragment`
9+
110
# 0.6.5 - 11 Sep 2023
211
Improvement:
312
- Export `Children`, `PropsWithChildren`, `Component`, and `Fragment`

bun.lockb

-718 Bytes
Binary file not shown.

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@
3636
"format": "prettier --write ."
3737
},
3838
"peerDependencies": {
39-
"elysia": ">= 0.6.23"
39+
"@kitajs/html": ">= 2.2.0",
40+
"elysia": ">= 0.6.11"
4041
},
4142
"devDependencies": {
42-
"@types/dompurify": "^3.0.2",
4343
"@types/node": "^20.6.0",
4444
"bun-types": "^1.0.1",
4545
"elysia": "^0.6.23",
@@ -49,5 +49,10 @@
4949
},
5050
"dependencies": {
5151
"@kitajs/html": "^2.2.1"
52+
},
53+
"peerDependenciesMeta": {
54+
"@kitajs/html": {
55+
"optional": true
56+
}
5257
}
5358
}

src/html.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export function html(options: HtmlOptions = {}) {
99
options.isHtml ??= isHtml
1010
options.autoDoctype ??= true
1111

12-
let instance = new Elysia({ name: '@elysiajs/html' }).derive(() => ({
12+
let instance = new Elysia({ name: '@elysiajs/html' }).derive(({ set }) => ({
1313
html(value: string) {
1414
if (
1515
options.autoDoctype &&
@@ -21,7 +21,9 @@ export function html(options: HtmlOptions = {}) {
2121
}
2222

2323
return new Response(value, {
24-
headers: { 'content-type': options.contentType! }
24+
...set,
25+
// @ts-expect-error
26+
headers: { ...set.headers, 'content-type': options.contentType! },
2527
})
2628
}
2729
}))

0 commit comments

Comments
 (0)