0
0
mirror of https://github.com/honojs/hono.git synced 2024-11-29 09:43:20 +01:00
Commit Graph

555 Commits

Author SHA1 Message Date
Yusuke Wada
ff34b1ba9a
feat: support multiple optinal parameters (#1940)
* feat: support multiple optinal parameters

* fix && denoify
2024-01-10 21:57:37 +09:00
Yusuke Wada
d469ed9347
fix(netlify): add adapter/netlify/index.ts (#1932)
* fix(netlify): add `adapter/netlify/index.ts`

* denoify

* remove unnecessary comments

* denoify
2024-01-10 06:59:07 +09:00
Eli Edds
a93ddaf623
fix(client): Fix issue awaiting RPC client (#1924)
* allow awaiting clients

* update deno_dist

* add test for awaiting client
2024-01-10 06:45:00 +09:00
Sor4chi
1140532b95
fix: streamSSE's doesn't trigger onAbort correctly (#1920)
* test: add onAbort case to stream helper

* fix: how to handle sse

* test: add aborted case to streamSSE helper

* chore: denoify

* chore: lintfix
2024-01-09 15:46:51 +09:00
Yusuke Wada
dbdbd227a2
fix(validator): exclude Response type for returned values from c.req.valid() (#1914)
* fix(validator): exclude Response type for returned values from `c.req.valid()`

* denoify
2024-01-08 06:58:43 +09:00
Taku Amano
2d8d59f1e8
fix(jsx): fix jsx-runtime for falsy children (#1910) 2024-01-08 04:37:04 +09:00
Yusuke Wada
8ba8569aac
fix(deno): export css Helper for Deno (#1892)
* fix(deno): export css Helper for Deno

* denoify
2024-01-03 21:58:29 +09:00
Yusuke Wada
32e2e3c372
feat(client): add param option to $url() (#1885)
* feat(client): add `param` option to `$url()`

* denoify
2024-01-03 19:53:38 +09:00
Sor4chi
4dfcda8282
feat(streaming): implement stream.onAbort (#1871)
* feat: extend `StreamAPI` for response interception and adapt stream handler for it

* chore: denoify
2024-01-02 23:18:04 +09:00
Yusuke Wada
773531e35b
feat(dev): add colorize option for showRoutes() (#1886)
* feat(dev): add `colorize` option for `showRoutes()`

* denoify
2024-01-02 22:49:23 +09:00
Yusuke Wada
74287a82cc
feat: introduce css Helper (#1850)
* feat: introduce CSS Helper

* shorten

* feat(css): Implement css helper with callback (#1858)

* feat(css): Implement css helper with callback

* feat(css): add keyframes and pseudo selectors support

* fix(css): Specify missing "context" argument in resolveCallback()

* feat(css): use WeakMap instead of Map, to avoid memory leak

* feat(css): improve CSS helper

* fix(css): fix formatting and types in css helper

* chore: denoify

* docs(css): add experimental flag to css helper

* feat(css): Enable to embed sub `css`.

* fix(css): propagate selector to parent class

* feat(css): Use Record again for usedClassNameData

* feat(css): escape only close tag "</...>", not all slashes. we can use url() without escaping.

* fix(css): embedded `css` must have ";"

* Fix format.

* feat(css): add cx() helper

`cx()` is a helper function to combine multiple css classes.
This function is compatible with `cx()` in @emotion/css.

* feat(css): ignore boolean, null, and undefined values as same as jsx

* chore: denoify

* feat(css): enable to use cx() with external class name

* refactor(css): use symbols for keys

* chore: denoify

---------

Co-authored-by: Taku Amano <taku@taaas.jp>
2024-01-02 22:47:42 +09:00
Sor4chi
b8b0b384b6
feat: pass context to onNotFound callback in serveStatic (#1865)
* feat: pass context to onNotFound callback in serveStatic

* chore: denoify

* test: update notFoundHandler's callback expect

* feat: add Env generics for serveStatic to support `c.env` type in callback handler

* feat: add Env generics for serveStatic to support c.env type in cloudflare workers module's callback handler
2024-01-02 22:42:16 +09:00
Yusuke Wada
0e7f519916 Merge branch 'main' into next 2024-01-02 14:37:01 +09:00
Yusuke Wada
254f338a96
fix(hono-base): fixed a typo (#1877)
* fix(hono-base): fixed a typo

* denoify
2024-01-02 14:02:21 +09:00
Yusuke Wada
bfd7583cd3
fix(types): JSONParsed supports interface and Date etc. (#1853)
* fix(types): `JSONParsed` supports interface and `Date` etc.

* denoify

* supports bigint as never

* denoify
2024-01-01 18:23:12 +09:00
Taku Amano
813484dffd
fix(dev): preserve original handler in [composedHandler]. (#1873)
* fix(dev): preserve original handler in [composedHandler].

* chore: denoify

* refactor(dev): better variable names
2024-01-01 18:20:41 +09:00
watany
7bbaefcbee
feat(helper): export SSEStreamingApi and SSEMessage. (#1863)
* refactor

* export

* check & denoify
2023-12-27 10:45:34 +09:00
Withee Poositasai
b128d02336
feat: Add onNotFound handler in adapters' serveStatic (#1825)
* feat: add onNotFound handler in adapters' serveStatic

* test: add serveStatic onNotFound tests for bun and deno

* test: add serveStatic onNotFound tests for cloudflare workers
2023-12-27 07:04:46 +09:00
Yusuke Wada
5b4592190b
feat(dev): add getRouterName() (#1841)
* feat(dev): add `getRouterName()`

* denoify
2023-12-27 07:02:03 +09:00
Taku Amano
b143c4ed8b
feat(middleware/csrf): Introduce CSRF middleware (#1823)
* feat(middleware/csrf): Introduce CSRF middleware

* test(middleware/csrf): Add tests for CSRF middleware

* chore: denoify

* fix(middleware/csrf): fix typo.
2023-12-27 06:58:20 +09:00
Sor4chi
7768865e7a
fix: move c.stream* to helper (#1846)
* refactor: move streaming helper to `streaming/sse.ts`

* feat: add streamSSE's export in streaming handler

* feat: move `stream` and `streamText` to streaming helper

* chore: add deprecated expression for `c.stream` and `c.streamText`

* fix: use `stream` helper in streamSSE

* refactor: move `streamText` to `text.ts`

* test: add some case to `stream` and `streamText`

* test: refactor `streamSSE` case for uniformity

* chore: denoify

* fix: update jsdoc's deprecated description, simplify `c.stream` and `c.streamText`

* fix: match the header notation with that of `streamSSE

* chore: denoify

* refactor: remove unnecesary export
2023-12-27 06:55:24 +09:00
Yusuke Wada
d41c17ad0b
fix(req): avoid error when req.queries() receives unexpected values (#1862)
* wip

* fix(req): avoid error when `req.queries()` receives unexpected values

* denoify
2023-12-27 06:41:48 +09:00
Yusuke Wada
e2601c3f0c
fix(client): add missing properties to ClientResponse (#1861)
* fix(client): add missing properties to `ClientResponse`

* denoify
2023-12-27 06:26:56 +09:00
Yusuke Wada
84c399238f
fix(trie-router): pass params to the next node (#1852)
* fix(trie-router): pass params to the next node

* denoify
2023-12-24 16:52:10 +09:00
Yusuke Wada
96946bad8e
fix(hono-base): make onError and notFound as class field (#1839)
* fix(hono-base): make `onError` and `notFound` as class field

* denoify
2023-12-21 22:37:56 +09:00
Taku Amano
1567438549
feat(helper/html): Support Promise<string | HtmlEscapedString> in html tagged template literals (#1826)
* feat(helper/html): Support Promise<string | HtmlEscapedString> in html tagged template literals

* chore: denoify

* test: fix lint error
2023-12-17 07:35:34 +09:00
Yusuke Wada
3817ccccc9
fix(factory): infer a merged path correctly (#1821)
* fix(factory): infer a merged path correctly

* denoify
2023-12-14 21:28:15 +09:00
Yusuke Wada
8e2b6b0851
Merge pull request from GHSA-f6gv-hh8j-q8vq
* fix(trie-router): don't remain with the values of named param

* denoify

* fix: don't share `params`

* denoify
2023-12-14 10:21:02 +09:00
Yusuke Wada
4c4c4ee42c
fix(context): set status correctly (#1814)
* fix(context): set `status` correctly

* denoify
2023-12-13 16:21:53 +09:00
Yusuke Wada
af8d16b6db
fix(context): c.json() allows object and returns JSONParsed<T> (#1806)
* fix(context): `c.json()` allows object and returns JSONParsed<T>

* denoify
2023-12-13 09:01:34 +09:00
ryu
87e256b4c6
docs(readme): update hono/tiny size (#1809) 2023-12-13 07:56:55 +09:00
Yusuke Wada
0f33cf8d45
fix(context): set headers values correctly (#1808)
* fix(context): set headers values correctly

* denoify
2023-12-12 13:04:53 +09:00
Yusuke Wada
6830e7b99c
fix(client): c.json() supports undefined/null response (#1794)
* fix(client): `c.json()` supports `undefined`/`null` response

* denoify
2023-12-09 16:14:55 +09:00
Yusuke Wada
477e763ad3
fix(client): make ClientResponse.json() returns Union correctly (#1786)
* fix(client): make `ClientResponse.json()` returns Union correctly

* denoify
2023-12-06 23:11:34 +09:00
Yusuke Wada
19060105f1
fix(base): name private _basePath instead of #basePath (#1785)
* fix(base): name `private _basePath` instead of `#basePath`

* denoify
2023-12-06 22:23:50 +09:00
Ben
41075d5a80
fix(types): Added E env type argument to showRoutes & inspectRoutes hono parameter (#1778)
* Fixed `showRoutes` doc comment import path

* Fixed `showRoutes` & `inspectRoutes` Hono parameter types

* Updated `deno_dist` Deno files

* Renamed type arguments from `TEnv` to `E`
2023-12-05 18:47:45 +09:00
Yusuke Wada
42912df795
fix(context): Strict type checking c.json() (#1776)
* fix(context): Strict type checking `c.json()`

* denoify
2023-12-04 22:14:49 +09:00
Yusuke Wada
b21f33c987
Merge pull request #1774 from honojs/next
Next
2023-12-04 17:36:48 +09:00
Yusuke Wada
22b5f532b4
refactor: use # for private properties (#1762)
* refactor: use `#` for private properties

* denoify
2023-12-04 17:29:24 +09:00
Yusuke Wada
86c4165ea4
fix(factory): Filter undefined in createHandlers (#1772)
* fix(factory): Filter undefined in `createHandlers`

* denoify
2023-12-04 09:47:45 +09:00
Yusuke Wada
5f42d3cca4
feat(jsx): mark ErrorBoundary as experimental (#1771)
* feat(jsx): mark `ErrorBoundary` as `experimental`

* denoify
2023-12-04 05:56:25 +09:00
Yusuke Wada
99f5e132bc
fix(client): Allow optional props in JSON response (#1769)
* fix(client): allow optional props in JSON response

* denoify
2023-12-03 18:55:59 +09:00
Taku Amano
d86fcd41e1
feat(request): Introduce matchedRoutes and routePath for HonoRequest (#1744)
* feat(request): Introduce `matchedRoutes` and `routePath` for `HonoRequest`

* test: update test.

* chore: denoify

* fix: Remove unused type imports.
2023-12-03 18:55:38 +09:00
Taku Amano
d16aedfffd
feat: Ensure that calls to c.json() have a type equivalent to c.jsonT() (#1728)
* feat: Ensure that calls to `c.json()` have a type equivalent to `c.jsonT()`

* refactor: Objects with "response" properties are never returned by the handler

* refactor: "status" is not needed in TypedResponse

* refactor: Revive `c.jsonT()` and add @deprecated label

* refactor: Tweaks commenting on "eslint-disable" broken by `format:fix`

* test: Use `c.json()` instead of `c.jsonT()` to make sure there are no problems

* refactor: allow ambiguous type for `c.json()`

* chore: denoify

* fix: Remove unused TypedResponse from import statement
2023-12-03 09:03:14 +09:00
Yusuke Wada
b6133c4130
refactor(router): remove duplication MESSAGE_MATCHER_IS_ALREADY_BUILT (#1763)
* refactor(router): duplicated messages as `MESSAGE_MATCHER_IS_ALREADY_BUILT`

* denoify
2023-12-02 06:10:37 +09:00
Yusuke Wada
63179949c9
fix(types): Keep Env types with changed routes (#1757)
* fix(types): Keep `Env` types with changed routes

* denoify
2023-12-02 05:23:00 +09:00
Yusuke Wada
472fee3629 Merge branch 'main' into next 2023-12-02 05:22:10 +09:00
Yusuke Wada
4fdfdd6d12
fix(context): Set content-type with c.text() correctly (#1761)
* fix(context): Set `content-type` with `c.text()` correctly

* denoify
2023-12-02 05:15:09 +09:00
Taku Amano
bd36ad10fc
feat(helper/dev): Introduce inspectRoutes() and showRoutes() (#1716)
* feat(dev): Introduce "dev" helper

* feat(dev): Expose "dev" helper

* refactor: Use "named function" in some middleware.

* feat: `app.showRoutes()` is now deprecated. Use `showRoutes()` in `helper` instead.

* refactor: export RouterRoute interface for utility

* refactor: remove captureRouteStackTrace, add inspectRoutes

`captureRouteStackTrace` will be implemented after some more thought.
Instead, I added `inspectRoutes` to get routes as data.

* test: add tests for helper/dev/index.ts

* fix: run `format:fix`

* refactor: use named functions for middleware

* chore: denoify

* docs: tweaks deprecation warning message

* refactor(dev): Simplification of showList options

* chore: denoify
2023-11-29 19:22:09 +09:00
Stibbs
f4ff712796
feat(bearerAuth): accept a list of token strings (#1749)
* bearer-auth accepts list of token strings

* add yarn denoify output

* remove test files. retain only deno_dist bearer-auth
2023-11-29 19:04:20 +09:00