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

79 Commits

Author SHA1 Message Date
Yusuke Wada
68808453d5
refactor: refactored hono-base (#1588)
* refactor: refactored `hono-base`

* denoify
2023-10-17 06:36:09 +09:00
Yusuke Wada
319f49d493
Revert "feat(app): basePath option for the constructor, deprecate app.basePath() (#1560)" (#1586)
This reverts commit 8b6bd46e66.
2023-10-17 06:24:59 +09:00
Yusuke Wada
8b6bd46e66
feat(app): basePath option for the constructor, deprecate app.basePath() (#1560)
* feat(app): `basePath` option for the constructor, deprecate `app.basePath()`

* denoify

* refactor: `HonoOptions`

* denoify
2023-10-16 09:04:58 +09:00
Yusuke Wada
6034dd7f7f
fix(types): remove type-errors for routes (#1371)
* fix(types): remove type-errors for routes

* denoify

* fixed the client and the presets

* rename
2023-08-24 15:36:49 +09:00
Yusuke Wada
ccc4308871
fix(types): set / for generics basePath (#1083)
* fix(types): set `/` for generics `basePath`

* denoify

* fix `MergePath`

* tweak

* denoify
2023-05-14 08:18:45 +09:00
Yusuke Wada
d9aca261a1
fix: enable specifying router from args (#1079)
* fix: enable specifying router from args

* add tests

* denoify
2023-05-09 21:50:43 +09:00
Taku Amano
b253a8735b
feat: Allow getPath to be replaced. (#1064)
* feat: Allow getPath to be replaced.

* chore: denoify
2023-05-03 22:13:23 +09:00
Yusuke Wada
677b572fd5 feat: introduce PatternRouter and hono/tiny (#1036)
* wip

* Use RegExp instead of URLPattern. (#1039)

* Use RegExp instead of URLPattern.

* refactor(url-pattern-router): tidy up.

* refactor(url-pattern-router): Tweaks type for mangling.

* refactor: Rename URLPatternRouter to PatternRouter.

* chore: denoify.

---------

Co-authored-by: Taku Amano <taku@taaas.jp>
2023-04-28 12:10:20 +09:00
Taku Amano
c0af3d0726
feat: Enable to add subApp with basePath. (#998)
* feat: Enable to add subApp with basePath.

* chore: denoify.
2023-03-19 12:39:07 +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
Taku Amano
55baf9d2d3
feat: route() with one argument is renamed basePath(). (#964)
* feat: `route()` with one argument is renamed `basePath()`.

* chore: denoify.

* refactor: Use `private` instead of hard private fields.

* refactor: The `route()` with one argument has reverted and deprecated.

* chore: denoify
2023-03-09 09:41:11 +09:00
Yusuke Wada
46c233e463
fix(client): show type error if $get() needs args (#937)
* fix(client): show type error if `$get()` needs args

* denoify
2023-03-02 21:40:53 +09:00
tangye
73860a1595
fix: let the app.request behave the same as fetch (#933)
* fix: let the app.request behave the same as fetch

* fix: add deno dist files

---------

Co-authored-by: 唐烨 <tangye@xinpianchang.com>
2023-02-27 20:01:04 +09:00
Taku Amano
b0501e03cd
feat: Improve route() (#929)
* feat: return a sub app cloning itself from route()

* feat: Add extra type parameter BasePath.

* refactor: The type of hono.basePath may simply be a string.

* refactor: first argument of route is required, default value is not required

* chore: denoify
2023-02-27 18:38:27 +09:00
Yusuke Wada
b3868d1075
fix(types): app.route with multiple endpoints returns types correctly (#919)
* fix(types): `app.route` with multiple endpoints returns types correctly

* fix `OnHandlerInterface` patterns too.

* denoify

* fix type mismatch of Env

* remove unnecessary assert
2023-02-24 09:07:25 +09:00
hagishi
14ed9f7368
feat: allow pathname argument (#921)
* feat: allow pathname argument

* fix: add control input argument

* denoify
2023-02-23 23:41:50 +09:00
Yusuke Wada
2c5b9891bd
feat(types): keep schema info with app.route() (#909) 2023-02-20 08:56:29 +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
e0059916e9
fix(deno): allow {} for app.fetch fo compatibility (#887) 2023-02-12 16:46:47 +09:00
Yusuke Wada
39e855f0a4
feat: move http-exception out of utils (#883) 2023-02-11 18:05:50 +09:00
Yusuke Wada
ff7b225620
feat(app): support multiple methods with app.on() (#882)
* feat(`app`): support multiple methods with `app.on()`

* use `flat()`

* denoify
2023-02-11 16:20:11 +09:00
Yusuke Wada
6f729895a7 merge main into next 2023-02-09 19:49:27 +09:00
Taku Amano
dfd4f81e79
feat: Remove the StaticRouter from default candidates. (#869)
* feat: Remove the StaticRouter from default candidates.

* chore: denoify
2023-02-08 23:19:02 +09:00
Yusuke Wada
dd4122a5e0
refactor: obsolute CustomHandler (#861) 2023-02-03 05:56:59 +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
Yusuke Wada
2de2ef3279
feat(validator): support multiple handlers w/ complex patterns. (#831) 2023-01-22 21:21:37 +09:00
Yusuke Wada
698a783573 Merge branch 'main' into next 2023-01-22 14:28:13 +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
a60e46ae53
fix(request): make optional param type correct (#826)
* fix(request): make optional param type correct

* `ts-ignore`

* `denoify`
2023-01-22 13:32:33 +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
7beb64956c feat: [BREAKING] introduce adapters (#807)
* feat: [BREAKING] introduce adapters

* added Next.js adapter

* denoify
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
d00a47ef70 feat: introduce HTTPException (#796)
* feat: introduce `HTTPException`

* denoify and fixed tests for Lagon
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
d2dd42b35e fix: fixed bugs handling TypeResponse (#791) 2023-01-19 22:45:25 +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
Yusuke Wada
397c12e181 refactor: refactor and fix Types (#748)
* wip

* refactor: refactor and fix Types
2023-01-19 22:44:34 +09:00
Yusuke Wada
85e3c6a275 feat: new validator middleware using 3rd-party & current middleware obsolete (#745)
* feat: introduce HonoRequest with "wrapper pattern" (#733)

* feat: HonoRequest

* avoid `awaits`

* use `raw` instead of `original`

* feat: types for "RPC" support & build-in validator obsolete

* feat: introduce HonoRequest with "wrapper pattern" (#733)

* feat: HonoRequest

* avoid `awaits`

* use `raw` instead of `original`

* create generic middleare for 3rd-party validator

* indent

* support multiple validators and refactor

* remove unsed lines

* denoify
2023-01-19 22:40:13 +09:00
Yusuke Wada
a6d54dbff3 feat: introduce HonoRequest with "wrapper pattern" (#733)
* feat: HonoRequest

* avoid `awaits`

* use `raw` instead of `original`
2023-01-19 22:40:13 +09:00
Yusuke Wada
e6635e9997 chore: denoify 2022-12-12 22:10:14 +09:00
Yusuke Wada
3def9b12c0
fix(type): fix the type mismatch if using Handler as middleware (#714)
* fix(type): fix the type mismatch if using `Handler` as middleware

* remove a line
2022-12-10 23:11:27 +09:00
Yusuke Wada
59bb0b1a40
feat(handler): "schema" allow normal types (#700)
* feat(handler): "schema" allow normal types

* check types for handler+validator+handler pattern

* denoify

* improve type definitions
2022-12-10 16:37:14 +09:00
Yusuke Wada
1eb49b8d96
refactor: support new @cloudflare/worker-types (#673)
* refactor: support new `@cloudflare/worker-types`

* do not attach crypto to global

* denoify ignore serve-static for cloudlfare

* ignore the utility for cloudflare

* import types
2022-11-23 07:27:42 +09:00
Yusuke Wada
05f2f6eb10 fix(types): app.use return correct types
Fix #666
2022-11-19 15:49:22 +09:00
Yusuke Wada
d3a6f80d7c
fix(type): change the type definition of req in Context (#658) 2022-11-11 15:23:05 +09:00
Yusuke Wada
b963d6e7cb
feat(app): introduce app.on(method, path, handler) (#653)
* feat(app): introduce `app.on(method, path, handler)`

* Refactoring of feat/on branche (#655)

* refactor(reg-exp-router): Use `includes` instead of `find` to check if an element is in an array.

* fix(static-router): Copy middleware from METHOD_NAME_ALL for new method.

* chore: denoify

Co-authored-by: Taku Amano <taku@taaas.jp>
2022-11-08 03:17:34 +09:00
Yusuke Wada
15a5119bac
feat(app): introduce app.showRoutes() (#650) 2022-11-05 19:04:01 +09:00
Yusuke Wada
edfb31ee94
fix(error): make notFound() enables to catch errors correctly (#652) 2022-11-05 19:02:19 +09:00
Yusuke Wada
4a9cd272f8
refactor(types): reduce type definitions (#649)
* refactor(types): reduce type definitions

* fixed tests for Deno and Bun
2022-11-03 15:53:41 +09:00