0
0
mirror of https://github.com/honojs/hono.git synced 2024-12-01 11:51:01 +01:00
Commit Graph

87 Commits

Author SHA1 Message Date
Sor4chi
31f0605209 feat: Add c.stream() (#1437)
* feat: implement stream api utility-class

* test: write the test of StreamApi

* feat: implement `c.stream` to context

* test: write the test of `c.stream()`

* chore: denoify

* fix: extend for bytes, remove buffer system, add pipe and log interface

* test: update test about log, pipe, etc... for streaming API

* feat: extend textStream interface, remove utf-8 content-type

* test: add test about `c.textStream`

* refactor: update some args name

* chore: denoify

* fix: for deno, removed the optional parameter of `write` and `writeln`

* chore: denoify

* feat: add charset for textStream content-type header

* fix: rename textStream to streamText

* fix: reuse stream in streamText for bundle size

* feat: add `stream.wait()` api

* chore: denoify

* fix: rename `stream.wait` to `stream.sleep`

* test: use `stream.sleep` for waiting

* refactor: remove `stream.log`

* fix: remove preHeader from `c.stream()` and use `transfer-encoding` only `c.streamText()`

* chore: denoify

* refactoring: remove preHeader initialize

* test: reduce sleep duration

* chore: denoify

Co-authored-by: Glen Maddern <glenmaddern@gmail.com>
2023-09-17 00:57:26 +09:00
Yusuke Wada
665f456f84
feat(context): introduce c.var (#1406)
* feat(context): introduce `c.var`

* denoify

* make it a property

* denoify

* make it a read-only

* fix the complex pattern
2023-09-09 17:11:16 +09:00
Yusuke Wada
40c350cd88
feat(context): introduce c.render() (#1397)
* feat(context): introduce `c.render()`

* denoify
2023-09-05 16:01:58 +09:00
Derrick Farris
8cea5bc9c3
feat(context): add status to TypedResponse (#1403)
* feat(context): add `status` to `TypedResponse`

* test(context): make sure `tRes` has `status` prop
2023-09-05 15:58:43 +09:00
Yusuke Wada
e07019125d
feat: introduce "Helpers" (#1353)
* mv jsx

* introduce helper

* denoify & add src/helper.ts for Deno

* remove `c` not used

* remove `c` in lagon test

* remove `src/adapter.ts` not used
2023-08-21 15:22:37 +09:00
asaxeye
88e7650ee8
fix(types): corrected argument types for Context methods (#1357) 2023-08-21 00:23:05 +09:00
Yusuke Wada
dc0696f2d1
refactor(context): allow passing HonoRequest as 1st arg (#1312)
* perf(context): allow passing `HonoRequest` as 1st arg

* denoify

* test: fix the node runtime test

* test: fix deno tests
2023-08-19 16:20:08 +09:00
Yusuke Wada
8b0f189a3f refactor(json-pretty): don't use c.pretty() (#1288) 2023-08-05 18:14:57 +09:00
Yusuke Wada
47ae014724
perf(context): add init flag (#1284)
* perf(context): add `init` flag

* denoify
2023-08-04 00:09:12 +09:00
Yusuke Wada
8ebd8b7b76
fix(jsonT): remove overloads from JSONTRespond (#1208)
* fix(`jsonT`): remove overloads from `JSONTRespond`

* denoify

* update tests
2023-06-29 20:09:00 +09:00
Yusuke Wada
5b873fcc5c
fix(types): allow not to set skipLibCheck (#1206)
* fix(types): allow not to set `skipLibCheck`

* use `unknown`

* denoify
2023-06-29 16:48:00 +09:00
ayame113
81d271279c
feat: Allow context.jsonT to take interface as an argument (#1162) 2023-06-06 10:23:09 +09:00
Taku Amano
8a1b9aa9a8
refactor: Tweaks variable names to reduce code. (#1157)
* refactor: Tweaks variable names to reduce code.

* Delete meaningless comments

* chore: denoify
2023-06-04 09:16:29 +09:00
Yusuke Wada
a2d22807e4
feat: app.mount() (#1104)
* feat: `mount()`

* update tests

* check header values

* chore: denoify

* make it as `app.mount()`

* denoify

* Generate new URL more simply. (#1112)

* Generate new URL more simply.

* chore: denoify

---------

Co-authored-by: Taku Amano <taku@taaas.jp>
2023-05-18 14:03:50 +09:00
Yusuke Wada
390d05b006
feat(app): app.routerName() (#1105)
* feat(context): `c.routerName()`

* chore: denoify

* Enable to get router name via `app.routerName`. (#1110)

---------

Co-authored-by: Taku Amano <taku@taaas.jp>
2023-05-18 00:05:28 +09:00
Taku Amano
c25745c6fa
fix(context): Fix typo in charset, again. (#1086)
* fix(context): Fix typo in charset.

* chore: denoify
2023-05-10 08:27:40 +09:00
Yusuke Wada
bcc08081ef
fix(context): enable extending ContextVarableMap (#1080)
* fix(context): enable extending `ContextVarableMap`

* denoify
2023-05-09 21:55:40 +09:00
Yusuke Wada
116aea542d Merge branch 'main' into next 2023-05-05 17:46:30 +09:00
Yusuke Wada
a73f0d23f0
feat: Cookie Middleware and deprecate c.req.cookie() / c.cookie() (#1066)
* feat: add Cookie Middleware and deprecate `c.req.cookie()` / `c.cookie()`

* chore: denoify
2023-05-05 11:08:03 +09:00
Yusuke Wada
d06a3123e7 Merge branch 'main' into next 2023-05-02 16:30:24 +09:00
Yusuke Wada
85528398c3
fix: check global.fastly instead of require('fastly:env') (#1057)
* fix: use `global.fastly` instead of `require('fastly:env')`

* denoify
2023-05-02 16:26:39 +09:00
Yusuke Wada
0a19deaa5b
perf: shorten code (#1051) 2023-04-30 21:07:00 +09:00
Taku Amano
ac7eeda87f
fix(context): Fix typo in charset. (#1046) 2023-04-28 12:06:23 +09:00
Yusuke Wada
e0cead6100
fix(context): fixed a bug for c.header() with a append option (#997)
* fix(context): fixed a bug for `c.header()` with a `append` option

* denoify
2023-03-19 12:08:17 +09:00
Yusuke Wada
0238dc6b91
feat(req): introduce c.req.path (#988)
* feat(req): introduce `c.req.path`

* denoify

* we don't have to handle fragments

* fixed the test

* denoify
2023-03-17 16:32:19 +09:00
Yusuke Wada
ea7a1b2d95
refactor: remove lint warnings (#976) 2023-03-13 22:08:16 +09:00
Yusuke Wada
9c4197a772
feat(validator): support type transformation (#969)
* feat(validator): support type transformation

* denoify

* create `ValidationFunction` and add a test

* denoify

* rename

* denoify
2023-03-11 22:17:08 +09:00
Yusuke Wada
7548eaa0f6
feat(context): allow passing RequestInit to c.json() etc. (#959)
* feat(context): allow passing `RequestInit` to `c.json()` etc.

* denoify

resolve #952
2023-03-09 23:54:47 +09:00
Yusuke Wada
c996f2d542 denoify 2023-03-05 23:40:14 +09:00
Yusuke Wada
4fb8151663
feat(context): allow passing unknown to executionCtx.waitUntil (#957)
* feat(context): allow passing `Promise<unknown>` to `executionCtx.waitUntil`

* denoify
2023-03-05 23:37:02 +09:00
Yusuke Wada
b1c5059708
feat(jsonT): check JSON type (#939)
* feat(`jsonT`): check JSON type

* denoify

* use `JSONValue`

* create `TrueAndFalseToBoolean` and add a comment
2023-03-02 08:56:13 +09:00
Yusuke Wada
5b29d4235e
refactor: rename to TypedResponse (#889)
* refactor: rename to `TypedResponse`

* denoify
2023-02-13 21:57:12 +09:00
Yusuke Wada
60c0903a1c
fix(req): query return type as string | undefined (#888)
* fix(req): return type as `string | undefined`

* denoify
2023-02-13 21:40:51 +09:00
Yusuke Wada
41ba3a2193 Revert "perf(context): improve handling response (#860)"
This reverts commit ce0a8bd16d.
2023-02-05 02:53:10 +09:00
Yusuke Wada
ce0a8bd16d
perf(context): improve handling response (#860) 2023-02-02 08:08:07 +09:00
Yusuke Wada
aefe3869d0 chore: denoify 2023-02-02 00:25:58 +09:00
Yusuke Wada
e2b269acb0
feat: rewnew output types (#853)
* feat: rewnew output types

* denoify

* refactor: move type definitions of middlware handler to `types.ts`

* format comment block

* add more tests
2023-02-01 06:36:48 +09:00
Jayden
53de4a4021
Rename runtime keys (#850)
* Rename runtime keys

* denoify

* Fix test
2023-01-29 14:47:35 +09:00
Yusuke Wada
0c76049487 Merge branch 'main' into next 2023-01-24 09:00:29 +09:00
Yusuke Wada
4f9d7f2d7e
fix(context): fixed bug raw Response content-type is overwritten (#836) 2023-01-24 08:53:31 +09:00
Yusuke Wada
a53ae499d3 Merge branch 'main' into next 2023-01-23 08:40:17 +09:00
Yusuke Wada
033f23189c
fix(context): set the values of already set (#834) 2023-01-23 08:35:14 +09:00
Yusuke Wada
e404319824
perf: use substring and //.test ... (#829)
* v3.0.0-rc.8

* perf: use `substring` and `//.test` ...
2023-01-22 13:59:31 +09:00
Yusuke Wada
b6b1e5bc79 fix(context): enable destruction such json (#813)
This will fix #812
2023-01-19 22:45:25 +09:00
Yusuke Wada
eb6f1fdb0d perf: optimize parsing queries and headers / 19% faster than 2.7.2 (#811) 2023-01-19 22:45:25 +09:00
Yusuke Wada
733f05c21c refactor(types): more robust and flexible (#806)
* chore: denoify

* v3.0.0-rc.5

* refactor(types): more robust and flexible

* fixed some
2023-01-19 22:45:25 +09:00
Yusuke Wada
e989a93d01 refactor: tweak types (#795) 2023-01-19 22:45:25 +09:00
Yusuke Wada
548487aa53 chore: denoify 2023-01-19 22:45:25 +09:00
Yusuke Wada
a50efe4fa9 perf(context): tune up handling headers 3% faster (#778)
* perf(context): tune up handling headers ~ 3% faster

* uppercase

* denoify
2023-01-19 22:44:38 +09:00
Yusuke Wada
b49e557e5b refactor(types): shorten name, make it safer (#774)
* refactor(types): shorten name, make it safer

* remove not used
2023-01-19 22:44:38 +09:00