0
0
mirror of https://github.com/honojs/hono.git synced 2024-11-29 17:46:30 +01:00
Commit Graph

477 Commits

Author SHA1 Message Date
Taku Amano
a98661b419
fix(jsx/streaming): Fixed a bug that caused async components to be evaluated multiple times inside Suspense. (#1656)
* fix(jsx/streaming): Fixed a bug that caused async components to be evaluated multiple times inside Suspense.

* test(jsx/streaming): The problem of catching the global unhandledRejection and causing an error has been fixed in the vitest.

* chore: denoify
2023-11-08 20:52:29 +09:00
Yusuke Wada
86037a54eb
feat(helper/factory): remove @experimental from createMiddleware() (#1653)
* feat(helper/factory): remove `@experimental` from `createMiddleware()`

* denoify
2023-11-08 12:19:15 +09:00
Taku Amano
fedeb3d696
feat: Introduce streaming API with Suspense and use. (#1630)
* feat(jsx): Support async component.

* chore: denoify

* feat: Support nested async components.

* chore: denoify

* Remove unintended file from commit.

* test(jsx): Add test for html tagged template strings.

* feat: Introduce streaming API with `Suspense` and `use`.

* chore: denoify

* "use" receives only Promise.

* feat: Support multiple calls and nested calls to "use".

* refactor: tweaks replacement script.

* test: Add test for replacement result of streaming

* chore: denoify

* test: Add test "Complex fallback content"

* refactor: Add "typescript-eslint/no-explicit-any".

* Use jsdom instead of happy-dom due to ci failure.

* test: update test data for suspense.

* refactor: Remove excessive exports

* refactor: Changed initialization of `useContexts[]` to clarify intent.

* perf: improve `renderToReadableStream()` performance.

* chore: denoify

* pref: Shortened the output JS a bit.

* pref: Delete unneeded condition

* docs(jsx/streaming): Add `@experimental` flag to streaming API.

* fix(jsx/streadming): fix loop when using fullfilled Promise with null or undefined.

* fix(jsx/streaming): Catch unhandledRejection to avoid streaming not being closed.

* chore(jsx/streaming): Add entries for jsx/streaming to package.json.

* chore: denoify

* feat(jsx/streaming): Support the Async Component inside Suspense.

* chore: denoify

* feat(jsx/streaming): remove implementation of `use()`.
2023-11-07 07:09:04 +09:00
Yusuke Wada
48dc87dfd5
fix(utils/filepath): filepath supports Windows (#1642) 2023-11-04 06:56:14 +09:00
Yusuke Wada
517a6c486e
feat(jsx-renderer): docType option (#1621)
* feat(jsx-renderer): `docType` option

* denoify

* refactor

Co-authored-by: Taku Amano <taku@taaas.jp>

* denoify

---------

Co-authored-by: Taku Amano <taku@taaas.jp>
2023-10-27 11:11:07 +09:00
Yusuke Wada
3ead9a761c
feat(helper/adapter): add runtime option to env (#1622)
* feat(helper/adapter): add `runtime` option to `env`

* denoify
2023-10-27 11:06:21 +09:00
Yusuke Wada
b3e465a103
feat: types for JSX elements (#1614)
* feat: types for JSX elements

* make it minimal

* add children

* denoify

* fixed some attributes

* denoify

* `dateTime` to `datetime`

* remove `onxxx`

* feat: Declare in the Hono namespace so that it can be overridden by the user. (#1616)

* feat: Declare in the Hono namespace so that it can be overridden by the user.

* feat: Use interface instead of type to enable overwriting

```ts
declare global {
  namespace JSX {
    interface IntrinsicElements {
      'my-custom-element': Hono.HTMLAttributes & {
        'x-event'?: 'click' | 'scroll';
      }
    }
  }
}
```

---------

Co-authored-by: Yusuke Wada <yusuke@kamawada.com>

* remove `onxxx`

* denoify

---------

Co-authored-by: Taku Amano <taku@taaas.jp>
2023-10-27 06:21:33 +09:00
Andrew
a654842d56
fix(client/types): make args param optional if the input has no required keys (#1618)
* feat(types.ts): add RequiredKeysOf and HasRequiredKeys utility types

* fix(client/types.ts): make args param optional if input has no required keys

* chore(types.ts): move RequiredKeysOf and HasRequiredKeys types to utils/types.ts

* chore(types.ts): rewrite ClientRequest type

* chore(types.ts): fix formatting

* chore(types.ts): denoify
2023-10-26 18:07:25 +09:00
Yusuke Wada
3c6b18fb2f
fix(hc): allows optional schemas (#1608)
* fix(hc): allows optional schemas

* denoify
2023-10-22 23:23:53 +09:00
Yusuke Wada
0372214f7a
fix(jsx-renderer): fix PropsForRenderer (#1607)
* fix(jsx-renderer): fix `PropsForRenderer`

* denoify
2023-10-22 21:38:03 +09:00
Connor White
715b4841ea
fix: Don't kebab case style property values (#1562)
* fix: don't kebab case style property values

* add a test and format

* denoify and `denoify-ignore`

---------

Co-authored-by: Yusuke Wada <yusuke@kamawada.com>
2023-10-22 00:13:09 +09:00
Yusuke Wada
850ae92c47
fix(context): change FetchEvent detection way (#1595)
* fix(context): change `FetchEvent` detection way

* denoify
2023-10-18 22:24:19 +09:00
Taku Amano
b94897d6c0
fix: c.req.params() in nested app with custom error handler. (#1593)
* fix: `c.req.params()` in nested app with custom error handler.

* chore: denoify
2023-10-18 12:28:37 +09:00
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
766eebbf5d
feat(deno): export the factory helper for Deno (#1582) 2023-10-16 20:01:19 +09:00
Yusuke Wada
9f5b7298ab
fix(factory): fixed the comment (#1581)
* fix(factory): fixed the comment

* denoify
2023-10-16 19:50:35 +09:00
Yusuke Wada
ec39f44cb2
fix(streaming): fix SSE format (#1579)
* fix(streaming): fix SSE format

* denoify
2023-10-16 18:54:28 +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
Taku Amano
ec94acd909
feat: one params per a handler (optimized for RegExpRouter) (#1566)
Co-authored-by: Yusuke Wada <yusuke@kamawada.com>
2023-10-16 08:39:37 +09:00
Taku Amano
0e77991429
feat(reg-exp-router): Improve capture group support. (#1556)
* feat(reg-exp-router): Improve capture group support.

* chore: denoify
2023-10-10 07:49:59 +09:00
Yusuke Wada
2feb300578 Merge branch 'main' into next 2023-10-06 05:17:45 +09:00
Yusuke Wada
c703dd3726
fix(types): don't use webworker types (#1548)
* fix(types): don't use webworker types

* denoify
2023-10-06 05:14:16 +09:00
Taku Amano
b05ed376b2
feat(jsx): Introduce Context API and jsx-renderer middleware (#1496)
Co-authored-by: Yusuke Wada <yusuke@kamawada.com>
2023-10-05 16:57:33 +09:00
Arunava Basu
8aea6e5a42
feat: rename middleware to createMiddleware (#1540)
* feat: rename middleware to createMiddleware and mdoify tests

* feat:yarn denoify

* feat:formatted

* feat:cleanup

* feat:cleanup

* feat: denoify
2023-10-05 16:40:38 +09:00
Sor4chi
e4f7f971a8
feat: parseBody() for multi values' field (#1528)
* feat: add "all" option to parseBody

* feat: add parseBody option to `req.parseBody()`

* test: add single value (override) and multiple value cases to praseBody

* test: split parse case of parseBody

* chore: denoify

* refactor(body): make clear parseBody logic

* chore: denoify

* fix: single value of the field should not be parsed to array

* test: add some case of single value's field in "all" option

* chore: denoify
2023-10-05 16:33:56 +09:00
watany
96476a787b
feat(helper): streaming-sse (#1504)
* feat(helper): streaming-sse

* lint-check

* fixed streaming

* few fixed.

* denoify
2023-10-05 16:33:34 +09:00
Yusuke Wada
6a9590d69c
fix(jsx): render a child or odd children with Fragment correctly (#1541)
* fix(jsx): render a child or odd children with `Fragment` correctly

* denoify
2023-10-05 00:18:18 +09:00
Yusuke Wada
93fec337d0
refactor(hono-base): remove any casting (#1535)
* refactor(hono-base): remove `any` casting

* denoify
2023-10-03 23:19:05 +09:00
Yusuke Wada
e326208fdf
fix(context): use FetchEvent instead of FetchEventLike (#1532) 2023-10-03 23:09:16 +09:00
Yusuke Wada
dddd4978d8
fix(types): fix inferring path strings for an optional parameter with regexp (#1522)
* fix(types): fix inferring path strings for optional parameters with regexp

* denoify

* fix the test
2023-09-29 06:49:52 +09:00
Yusuke Wada
c7fc8a033a
fix(utils/buffer): fix bufferToFormData() (#1500)
* fix(utils/buffer): fix `bufferToFormData()`

* denoify
2023-09-23 23:46:09 +09:00
Yusuke Wada
a18828886f
fix(deno): export testing helper (#1493) 2023-09-22 06:30:25 +09:00
Yusuke Wada
3eb52bc102
Merge pull request #1489 from honojs/next 2023-09-21 11:44:56 +09:00
Nico Plyley
d6478aac6c
fix(jwt): incorrect error message (#1487) 2023-09-21 06:14:48 +09:00
Yusuke Wada
6c374623ed Merge branch 'main' into next 2023-09-21 00:32:01 +09:00
Yusuke Wada
2c47bf5890
fix(context): fix c.stream() and c.streamText() matters (#1482)
* fix(context): fix `c.stream()` and `c.streamText()`

* denoify

* remove the not used line
2023-09-20 22:53:30 +09:00
Yusuke Wada
11f2fe53ad
fix(jwt): avoid using enum (#1485)
* fix(jwt): avoid using `enum`

* denoify
2023-09-20 22:48:14 +09:00
hagishi
cdb36b80af
feat(client) add cookie type validate (#1476)
* feat: add hc header type check

* fix: revert comment

* denoify

* feat(client): add cookie type valid

* denoify

* feat: remove function from cookie helper

* refactor: modify client type
2023-09-19 07:25:34 +09:00
uaichat
94786a7e31
fix: error to retrieve cookie (#1386)
* fix: error to retrieve cookie

TypeError: Cannot read properties of undefined (reading 'split')

* add a test and denoify

---------

Co-authored-by: Yusuke Wada <yusuke@cloudflare.com>
2023-09-19 07:23:15 +09:00
hagishi
2e5e1b2f0c
feat: add Hono test client (RPC) (#1451)
* feat: add test client helper

* refactor:  rename from hc to testClient
2023-09-17 09:04:07 +09:00
neucoas
8d4f23a1ea
feat: expose the Jwt fucntions under the 'hono/jwt' path (#1472)
* Expose the Jwt fucntions under the 'hono/jwt' path

* Run yarn denoify
2023-09-17 07:22:39 +09:00
hagishi
a5ba936784
feat: Refactor ClientRequest Type for header validation (#1462)
* feat: add hc header type check

* fix: revert comment

* denoify
2023-09-17 01:09:47 +09:00
Bakunya | Kirisaki Rem
f25ae8aa5c
feat: Improvement of Parse Body (#1461)
* feat: improvement of parse body

* feat: add test for improvement of parse body commit

* chore: denoify and fix:format

* rm: test file on deno_dist

---------

Co-authored-by: irvan hakim <irvanhakim.dev@gmail.com>
2023-09-17 01:09:25 +09:00
CyberFlame
d64cbdb05a feat: Add CHIP support - supersedes #1198 (#1456)
Signed-off-by: CyberFlame <cyberflameu@gmail.com>
Co-authored-by: David Manouchehri <david.manouchehri@ai.moda>
2023-09-17 00:57:26 +09:00
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
b450751403
fix(types): support infering path types for multiple handlers (#1473)
* fix(types): support infering path types for multiple handlers

* denoify
2023-09-16 22:47:47 +09:00
Yusuke Wada
aa65a6e1b9
fix(types): return types of jsonT() should be union (#1471)
* fix(types): return types of `jsonT()` should be union

* denoify
2023-09-16 22:09:46 +09:00
Yusuke Wada
0febdf7544
fix(type): check 1st arg of middleware is string (#1470)
* fix(type): check 1st arg of middleware is `string`

* denoify
2023-09-16 21:05:31 +09:00
Yusuke Wada
bb386a49c9
fix(types): middleware with different env types (#1466)
* fix(types): middleware with different env types

* denoify

* fix factory helper
2023-09-16 20:32:54 +09:00