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

506 Commits

Author SHA1 Message Date
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
Yusuke Wada
10c16c23ef
feat(context): remove experimental from c.render/c.setRenderer() (#1748)
* feat(context): remove `experimental` from `c.render` and `c.setRenderer()`

* denoify
2023-11-29 17:38:45 +09:00
Yusuke Wada
6dd1a77fb7
feat: introduce createFactory() and createHandlers() (#1743)
* feat(helper/factory): introduce `createHandlers()`

* create `Factory` class

* support up to 10 handlers

* denoify

* fixed tests
2023-11-29 17:29:49 +09:00
Gabriel Donnantuoni Lima
b80895a8bd
feat(types): Support types until 10 handlers (#1735)
* feat: Support types until 10 handlers

* denoify

* feat: extend OnHandlerInterface to support until 10 handlers

* denoify
2023-11-29 04:18:11 +09:00
Yusuke Wada
19641d07c1 Merge branch 'main' into next 2023-11-28 18:00:14 +09:00
Yusuke Wada
7dc215577a
fix(helper/cookie): make default Path=/ for setCookie()/setSignedCookie() (#1742)
* fix(helper/cookie): make default `path` as `/` for `setCookie()`/`setSignedCookie()`

* denoify

* fixed test
2023-11-28 17:52:34 +09:00
Taku Amano
c3275eebf0
fix(jsx): Write the raw value if the value is a HtmlEscaped string (#1739)
* fix(jsx): Write the raw value if the value is a HtmlEscaped string

* chore: denoify
2023-11-27 17:19:35 +09:00
watany
bea87a0429
feat(adaptor): Enhance AWS Lambda Event Handling and Interface (#1710) 2023-11-27 15:31:10 +09:00
Robert Sasak
79dc187dbb
fix(validator): Invalid HTTP header error is hidden (#1694)
* Invalid HTTP header error is hidden

This error is captured and never shown which may by misleading. This PR suggest to throw this error directly to the reponse.

* fixed the linter error

* add a test

* denoify

---------

Co-authored-by: Yusuke Wada <yusuke@kamawada.com>
2023-11-21 19:42:27 +09:00
Taku Amano
cd6c488b76
feat(jsx): Introduce ErrorBoundary component (#1714)
* feat(jsx/streaming): Support Suspense in non-streaming mode.

* feat(jsx): Introduce ErrorBoundary component.

* chore: denoify

* feat: Support ErrorBoundary[fallbackRender].

* chore: denoify

* Rename utils.ts to components.ts

* refactor: export the ErrorBoundary component from the top level.

* fix: tweaks `resolveStream` to work with nested components

* refactor: Import `childrenToString` from `components.ts`

* fix: return immediately if the element is not found

* test: add test for jsx/components

* fix: run `npm run format:fix`

* chore: denoify
2023-11-21 18:05:05 +09:00
Yusuke Wada
257d5711b4
fix(compose): allow onError() handler to be async (#1730)
* fix(compose): allow `onError()` handler to be async

* denoify
2023-11-21 17:15:01 +09:00
Russell Schick
710992fcd4
fix(compose): allow notFound handler to be async (#1729) 2023-11-21 16:59:41 +09:00
Yusuke Wada
3b71dc647f
fix(types): fixed a typo (#1721)
* fix(types): fixed a typo

* denoify
2023-11-19 05:23:45 +09:00
Taku Amano
ae3546e32a
fix: References this._s only when paramStash is passed from the router (#1715)
* fix: References this._s only when paramStash is passed from the router.

* chore: denoify

* fix: remove debug statement.

* test: Fix test for param keys.
2023-11-17 07:35:48 +09:00
Yusuke Wada
16396bc225
perf(compose): simplify (#1701)
* perf(compose): simplify

* denoify
2023-11-15 22:22:31 +09:00
Yusuke Wada
871cf80b6a
fix(context): c.text() set the status set by c.status() (#1702)
* fix(context): `c.text()` set the status set by `c.status()`

* fixed logic

* denoify
2023-11-15 22:16:38 +09:00
Yusuke Wada
5e3e85a179
Merge pull request #1690 from honojs/next
Next
2023-11-13 14:25:42 +09:00
Yusuke Wada
d711484ac7
feat(app): use console.error() for default errorHandler (#1687)
* feat(app): use `console.error()` for default `errorHandler`

* denoify
2023-11-13 01:18:54 +09:00
Yusuke Wada
db3387353f
fix(context): implement ContextVariableMap for c.var (#1682)
* fix(context): implement `ContextVariableMap` for `c.var`

* denoify
2023-11-12 09:06:40 +09:00
Christian Rackerseder
47942ffc68
fix(types): allow arbitrary values as environment values (#1680) 2023-11-12 09:05:54 +09:00
Yusuke Wada
397e9a5cb5
feat(hono): remove experimental flag from app.mount() (#1669)
* feat(hono): remove `experimental` flag from `app.mount()`

* denoify
2023-11-10 08:20:20 +09:00
Yusuke Wada
c6fbf84de3
fix(types): infer env types with chaining handlers (#1668)
* fix(types): infer env types with chaining handlers

* denoify
2023-11-09 15:40:25 +09:00
Taku Amano
fa1abf637b
fix(jsx/streaming): Fixed a problem when multiple children are added directly under Suspense. (#1665)
* fix(jsx/streaming): Fixed a problem when multiple children are added directly under Suspense.

* refactor: Use `raw()` helper as constructor of `HtmlEscapedString`.

* chore: denoify.
2023-11-09 14:37:47 +09:00
Yusuke Wada
d6cd2720ea
docs: rename Fastly Compute@Edge to Compute (#1664) 2023-11-09 05:13:09 +09:00
Taku Amano
ebd43b91ff
feat(jsx-renderer): Support "stream" option in jsxRenderer. (#1662)
* fix(jsx/streaming): Fix await order again.

* feat(jsx): Support async component in useContext().

* fix(html): fix async component bug in html helper.

* feat(jsx-renderer): Support "stream" option in jsxRenderer.

* chore: denoify

* fix(jsx-renderer): Add "eslint-disable @typescript-eslint/no-explicit-any".
2023-11-09 05:03:54 +09:00
Taku Amano
691d02450e
perf(jsx/streaming): In multiple Suspense, go ahead in the order of resolved. (#1663)
* perf(jsx/streaming): In multiple Suspense, go ahead in the order of resolved.

* chore: denoify
2023-11-09 04:13:50 +09:00
Taku Amano
7fd9cba89d
feat(jsx/streaming): Support nested Suspense. (#1660) 2023-11-08 23:49:42 +09:00
Taku Amano
652ef7c867
feat(jsx): Define jsxTemplate/jsxAttr/jsxEscape for "@jsx precompile" of Deno 1.38 (#1651)
* fix(jsx/streaming): Fix for renderToReadableStream(promise: Promise<HtmlEscapedString>).

* feat(jsx): Define jsxTemplate/jsxAttr/jsxEscape for "@jsx precompile" of Deno 1.38

* chore: denoify

* fix(jsx/streaming): some times jsxDEV is called with null props.

* test(deno-jsx): Add runtime tests for JSX by Deno.

* test: Refactor import map.

* test: Added @jsxImportSource to avoid type warnings
2023-11-08 21:07:35 +09:00
watany
7adae90fd7
fix(helper): Stream SSE Helper Non-Closure (#1650)
* fix(helper): Stream SSE Helper Non-Closure

* denoify

* test fixed.
2023-11-08 20:54:02 +09:00
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