0
0
mirror of https://github.com/honojs/hono.git synced 2024-11-25 05:07:03 +01:00
Commit Graph

1266 Commits

Author SHA1 Message Date
Yusuke Wada
88e89a46a8 v3.9.2 2023-11-04 06:59:46 +09:00
Yusuke Wada
48dc87dfd5
fix(utils/filepath): filepath supports Windows (#1642) 2023-11-04 06:56:14 +09:00
watany
d1ff3d89c7
chore(ci): maintenance Node.js (#1636) 2023-11-02 00:12:49 +09:00
Yusuke Wada
dcb5e10add v3.9.1 2023-10-31 18:37:51 +09:00
Yusuke Wada
85d5074bfc
fix(package.json): export types correctly (#1633) 2023-10-31 18:35:26 +09:00
Yusuke Wada
ce36f83978 v3.9.0 2023-10-27 16:40:35 +09:00
Yusuke Wada
eb530cd75c
Merge pull request #1624 from honojs/next
Next
2023-10-27 16:36:15 +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
0bc72b8c6f v3.9.0-rc.1 2023-10-27 06:26:55 +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
Yusuke Wada
657b93368b v3.8.4 2023-10-27 06:18:27 +09:00
Ochirjav Jargalsaikhan
5f0237525c
fix(lambda): Aws lambda cookies fix (#1613)
* AWS Lambda adapter cookies issue fix implementation

* AWS Lambda adapter cookies issue - tests modified to handle multiple cookies
2023-10-27 06:13:02 +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
Ashton
046767afd6
fix: combine fluent interface with route grouping (#1610) 2023-10-23 05:26:38 +09:00
Yusuke Wada
61622d8cc4 v3.8.3 2023-10-22 23:40:43 +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
Yusuke Wada
6e21e741da v3.8.2 2023-10-22 00:36:56 +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
1ed9ce1f56
fix(package.json): export hono-base (#1604) 2023-10-21 23:58:38 +09:00
watany
76a2c7f523
chore(ci): bun v1 (#1599)
* chore(ci): bun v1

* bun use jsx

* bun version
2023-10-20 18:18:05 +09:00
watany
fc9bdad5f5
chore(ci): update node v20 (#1598)
* update node v20

* node test

* only one Main
2023-10-20 15:21:38 +09:00
Yusuke Wada
62d4d44d34
test(validator): fix the error message for node v18.18 (#1596)
* test(validator): fix the error message for node v18.18

* ci: fix node version

* fixed version

* test: fix the test pattern
2023-10-18 22:38:37 +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
Yusuke Wada
46b9b53e90 v3.8.1 2023-10-18 12:36:22 +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
6cf794fde1 v3.8.0 2023-10-17 09:45:44 +09:00
Yusuke Wada
70d83cb3c9
Merge pull request #1589 from honojs/next
Next
2023-10-17 09:40:33 +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
3247f76aed
feat(package.json): export streaming helper (#1578) 2023-10-16 18:13:09 +09:00
Yusuke Wada
9a73d5fbfc v3.8.0-rc.3 2023-10-16 09:11:50 +09:00
Yusuke Wada
7188827537 Merge branch 'main' into next 2023-10-16 09:09:25 +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
690765d2a4
test: fix the sleep time for SSE (#1575) 2023-10-16 08:40:10 +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
Yusuke Wada
b6c0e45d5f
chore: bump up denoify (#1570) 2023-10-13 08:59:27 +09:00
Yusuke Wada
8ba721e654 v3.7.6 2023-10-12 18:13:34 +09:00
Yusuke Wada
2f9a07dda9
perf(hono-base): use instanceOf (#1565)
* perf(hono-base): use `instanceOf`

* denoify
2023-10-12 17:48:36 +09:00
Bruno Marques
cca7577cf4
fix: return status 500 when using validator 'form' (#1554)
* fix: return status 500 when using validator 'form'

When using `validator('form', ...)` hono is returning a 500 status
when receiving a POST request with a JSON in request body, instead
of a bad request 400, .

This is happenning due to a unhandled error in an
underlying library (@miniflare).
https://github.com/cloudflare/miniflare/pull/711

The code changes in this PR are responsible to prepare the code to
handle possible TypeError that can be thrown in the future, by the lib
doing the FormData parsing, as per, https://fetch.spec.whatwg.org/#dom-body-formdata.

This PR should wait for bugfix on @miniflare.

* fix: json validator allowing Content-Type value other than json/application

Forgery attacks will try to avoid preflight requests when POSTing JSON
payloads manipulating the HTTP header Content-Type. For example, it will
send a JSON payload with `Content-Type=text/plain`, but the request stills
containing a JSON in its body. Those requests must be rejected.

Thus, when using the validator with the target set to `json`, we must
check the Content-Type header.

* fix: change check for json Content-Type header

Change JSON validation to only allow Content-Type header starting with
'application/json'.

Change from regexp test to starsWith builtin function, to make code more
expressive.

---------

Co-authored-by: Bruno Nascimento <bruno.nascimento@csghq.com>
2023-10-12 00:21:01 +09:00
Yusuke Wada
90259f3acb
test: use Node.js Native Web APIs instead of miniflare's (#1558)
* test: use Node.js Native Web APIs instead of miniflare's

* `denoify-ignore`
2023-10-10 21:32:10 +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
3d3f7cdf87 v3.8.0-rc.2 2023-10-06 08:43:32 +09:00
Yusuke Wada
2feb300578 Merge branch 'main' into next 2023-10-06 05:17:45 +09:00
Yusuke Wada
3e4f151fa9 v3.7.5 2023-10-06 05:16:02 +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