0
0
mirror of https://github.com/honojs/hono.git synced 2024-11-24 02:07:30 +01:00
Commit Graph

2127 Commits

Author SHA1 Message Date
Taku Amano
ada10e5bf0
fix(stream): Fixed a problem that onAbort() is called even if request is normally closed in deno (#3079)
* Fix(stream): Fixed a problem that onAbort() is called even if request is normally closed in deno

* test: fix stream abort test for Node.js
2024-07-03 10:50:44 +09:00
yasuaki640
ba8fb48551
test(helper/dev): fix typo of test case name (#3073) 2024-07-01 23:33:21 +09:00
Trung Dang
d038d82e66
refactor(types): move HandlerInterface's (path, handler)s overloads down (#3072)
* refactor(types): move `HandlerInterface`'s `(path, handler)` overloads down one level

* test: add tests for validator as first middleware - #3027

Fixes #3027
2024-07-01 21:29:46 +09:00
naporitan
ddc1de8394
fix(client): Add Query Parameter Support to WebSocket Client in hono/client (#3066)
* chore(client): fix url with query parameter websocket client

* chore(client): remove log
2024-07-01 17:05:45 +09:00
Yusuke Wada
2d452f2bd2
fix(validator): don't return a FormData if formData is cached (#3067)
* fix(validator): don't return a FormData if formData is cached

* fixed typo

* test the value
2024-07-01 16:29:34 +09:00
Jonathan Haines
f393730d44
fix(cloudflare-pages): Expose Cloudflare Pages type parameters (#3065) 2024-07-01 16:23:22 +09:00
K-tecchan
94f47ec2e6
test(router): remove unnecessary async keyword from router tests (#3061) 2024-07-01 09:52:33 +09:00
Yusuke Wada
c095dfac4e v4.4.10 2024-06-30 07:55:36 +09:00
m-shaka
1d16b84b62
fix(client): set Path as the default of Original (#3058) 2024-06-30 07:50:45 +09:00
Yusuke Wada
f2908d62fb v4.5.0-rc.2 2024-06-29 17:39:50 +09:00
Jonathan Haines
204e10b7ce
feat(cloudflare-pages): Add Cloudflare Pages middleware handler (#3028)
* Add Cloudflare Pages middleware handler

* fix: handle HTTPException

* fix: handle context.error

* fix: remove HonoRequest from conninfo test
2024-06-29 17:35:20 +09:00
Taku Amano
a8a84f3055
feat(jsx/dom): skip calculate children if props are the same (#3049)
* feat(jsx/dom): skip build children if props are the same

* test: fix format

* fix: re-calculate form element if state is updated
2024-06-29 17:24:39 +09:00
Yusuke Wada
cb79f2302b
test(adapter/bun): fixed conninfo.test.ts (#3059) 2024-06-29 17:20:06 +09:00
Yusuke Wada
ebbaea982c Merge branch 'main' into next 2024-06-29 17:13:45 +09:00
Taku Amano
2d3bc55954
fix(streaming): call stream.abort() explicitly when request is aborted (#3042)
* feat(utils/stream): enable to abort streaming manually

* feat(utils/stream): prevent multiple aborts, and enable to get the abort status

* fix(streaming): call `stream.abort()` explicitly when request is aborted

* test: add tests for streaming

* docs(stream): add comments

* test: add --allow-net to deno test command in ci.yml

* test(streaming): update test code

* test(stream): retry flaky test up to 3 times at "bun"

* test(streaming): refactor test to use afterEach

* fix(streaming): in bun, `c` is destroyed when the request is returned, so hold it until the end of streaming

* refactor(streaming): tweaks code layout
2024-06-29 07:00:28 +09:00
ryu
a6ad42d03b
chore(jsr): export JWT utils (#3056) 2024-06-28 05:49:45 +09:00
Yusuke Wada
5201c9fe31 Merge branch 'main' into next 2024-06-27 21:59:59 +09:00
Yusuke Wada
2ba805ca28 v4.4.9 2024-06-27 18:22:44 +09:00
Yusuke Wada
669ab94130
fix(timing): prevent duplicate applications (#3054) 2024-06-27 17:45:32 +09:00
Yusuke Wada
0a4621f737
docs: update the description of package.json and README (#3052) 2024-06-27 17:13:29 +09:00
Yusuke Wada
8fee01ca47
fix(types): correct inferring env when routes channing (#3051) 2024-06-27 16:06:08 +09:00
yasuaki640
afa44e9707
feat(adaptor): Remove unknown from AddressType (#2958)
* fix(typo): Fix typo in request.test.ts

* fix: remove 'unknown' string from AddressType

* fix: return undefined when addressType is invalid string

* fix: change addressType in getConnInfo function to undefined

* fix: change addressType in getConnInfo function to undefined

* fix: remove unused "unknown" string
2024-06-27 11:23:36 +09:00
Yusuke Wada
ae3a67beb1
perf(context): improve initializing Context (#3046)
* perf(context): improve initializing `Context`

* update to pass tests and CI

* removed not used module

* remove not used module
2024-06-27 10:44:37 +09:00
Taku Amano
4201a29490 feat(jsx/dom): Compatible implementation of new features in React 19 (document metadata, "form" element and related hooks, and new behavior of hooks) (#2960)
* feat(jsx/dom): Introduce document metadata integration for compatibility with React 19

* test(jsx/dom): add test for "ref as a prop"

* refactor: tweaks element selector

* feat(jsx/dom): implement " Cleanup functions for refs" for compatibility with React 19

* feat(jsx/dom): implement `useDeferredValue()`

* refactor(jsx): insert metadata into head synchronously

* feat(jsx/dom): introduce form and related hooks

* feat(jsx): sort by precedence in documentMetadataTag

* feat(jsx): enable to specify action attribute as function

* fixup! feat(jsx): enable to specify action attribute as function

* refactor: refactor file layout

* feat(jsx): de-dupe tags

* feat(jsx): accept crossOrigin as crossorigin

* feat(jsx/dom): inprement blocking and precedence feature for jsx/dom

* feat(jsx): export new hooks

* fix(jsx/dom): fix some bugs in jsx/dom/hooks

* fix(jsx/dom): fix useOptimistic hook

* fix(jsx/dom): fix signature of useActionState

* fix(jsx): fix type declaration for HtmlEscapedCallback

* refactor(jsx): improve importing of intrinsic element components

* feat(jsx): support permalink for useActionState

* fix(jsx): fix composeRef cleanup in intrinsic element components

* fix(jsx): remove blocking attribute from DOM node

* fix(jsx/dom): preserve HTMLElement for meta data if it will be unmounted

* fix(jsx/dom): fix de-dupe logic in `documentMetadataTag`

* fix(jsx/dom): fix precedence logic in `documentMetadataTag`

* feat(jsx): add React 19 compatibility attributes

* fix(jsx): Handle NodeListOf<HTMLElement> as an iterable

* test: tweaks test data

* fix(jsx/dom): fix precedence logic in `documentMetadataTag`

* fix(jsx/dom): fix meta data tag insertion behavior

* fix(jsx/dom): set next node recursively for all previous nodes

* refactor(jsx/dom): use better variable names and types in form component

* fix(jsx/dom): fix meta data tag insertion behavior

* fix(jsx): improve document meta tag behavior in jsx

* test(jsx/dom): add tests for intrinsic-element/components

* fix(jsx/dom): fix `use()` hook wrong behavior

* test(jsx/dom): add tests for hooks

* test(jsx): add tests new hooks for form

* fix(jsx): update current state synchronously if no actions are provided

* test(jsx): add tests for new hooks for form handling

* docs(jsx): add documentation for hooks

* test(jsx): Update test

* refactor(jsx/hooks): remove unused constant

* feat(jsx): improve compatibility with React 19 (precedence / special behavior)

* feat(jsx/dom): improve compatibility with title element mount/unmount behavior

* feat(jsx): support async function for useTransition

* fix(jsx/dom): method is always 'post' when data is present

* feat(jsx): support formAction for input and button elements

* feat(jsx/dom): support suspense with child counter

* feat(jsx/dom): enable to handle async error in useTransition
2024-06-27 10:37:57 +09:00
Taku Amano
032070adbb feat(jsx/dom): implement "<Context> as a provider" for compatibility with React 19 (#2962) 2024-06-27 10:37:57 +09:00
Taku Amano
37a10f4870 feat(jsx): bump react compat version to 19.0.0-hono-jsx (#2963) 2024-06-27 10:37:57 +09:00
Arif Rahman Hakim
936db9bfa1
feat(jwt): Use Signed Cookie in JWT Middleware (#2989)
* Pass options to getCookie/getSignedCookie

Adds support for getSignedCookie while also allowing for all options to getCookie/getSignedCookie to be set.

* Need to await getSignedCookie

* Add test

* style(jwt): lint and format code

* build(jwt): build jwt middleware for deno

* fix(jwt): get cookie in jwt middleware with/without prefixOptions

* feat(jwt): Use Signed Cookie in JWT Middleware

* test: add tests for JWT middleware with undercoverage

* fix: apply code formatting and linting fixes

---------

Co-authored-by: Christian Sirolli <34974905+HeyITGuyFixIt@users.noreply.github.com>
2024-06-27 10:16:03 +09:00
Yusuke Wada
42436bf799 Merge branch 'main' into next 2024-06-27 10:09:56 +09:00
Yusuke Wada
d21f8eb27a v4.4.8 2024-06-25 06:24:12 +09:00
yasuaki640
a9e4176d11
perf(utils/buffer): use promise all for better performance (#3031) 2024-06-25 06:18:37 +09:00
Ame_x
a9d5313a5a
fix(helper/ssg): remove unneeded import statements (#3014) 2024-06-24 05:51:41 +09:00
TATSUNO “Taz” Yasuhiro
1bbaf51279
chore(ci): enable lcov reporter for Bun test (#3022) 2024-06-24 05:39:29 +09:00
yasuaki640
f7a6b06975
test(utils/buffer): add tests for buffer.ts (#3004)
* add test for equal function

* add test for uncovered branch

* remove unused import
2024-06-24 04:28:29 +09:00
Antony David
60d68cac3a
perf: parseAccept without spread operator (#3003)
* perf: parseAccept without spread operator

* fix: format

* fix: review
2024-06-23 17:25:00 +09:00
Ame_x
d383e49ed8
fix(websocket): change to allow use of websocket options (#2999)
* fix: change to allow use of websocket options

* fix types

* change args

* fix

* add tests

* change to any

* add ignore any comment

* merge into mian

* Revert "add ignore any comment"

This reverts commit 8b3a34f212.

* Revert "merge into mian"

This reverts commit bf82da8d90.

* add ignore any comment
2024-06-21 22:08:58 +09:00
Nico Plyley
e5f91bd46c
chore: Fix typos in JSDoc (#3002) 2024-06-21 16:44:52 +09:00
Yusuke Wada
8ced5caf0f
ci: use env for codecov GitHub Actions (#3010) 2024-06-21 16:34:29 +09:00
Yusuke Wada
3327baf633
fix(jsx): add an explicit type (#3007) 2024-06-21 15:45:31 +09:00
Yusuke Wada
7ee829be6b v4.4.7 2024-06-19 15:24:23 +09:00
Kael
b074f07555
fix(types): env variables override ContextVariableMap (#2987)
* env variables should override ContextVariableMap

* add a test

---------

Co-authored-by: Yusuke Wada <yusuke@kamawada.com>
2024-06-19 15:16:52 +09:00
Joaquim Ley
b9799e4f45
test: Update request.test.ts to remove duplicate checks (#2984) 2024-06-17 23:49:55 +09:00
yasuaki640
57c95d4df5
test(client): test uncovered return statement (#2985) 2024-06-17 23:39:40 +09:00
Andreas Storesund Madsen
e6bfb459bb
fix(types): use correct return type for c.html depending on input (#2973) 2024-06-15 23:21:24 +09:00
Yusuke Wada
614dff06ba v4.4.6 2024-06-14 07:08:43 +09:00
Markus Wolf
a2a04a98a1
fix(aws-lambda): handle multiple cookies in streaming responses (#2926)
* fix: handle multiple cookies in streaming responses

This fix does address that cookies have to be handled
specially in lambda responses.

Fixes #2921

* test: check cookie handling
2024-06-12 19:25:37 +09:00
Yusuke Wada
61d50f6fe9 v4.5.0-rc.1 2024-06-12 12:17:46 +09:00
Taku Amano
9c21cc6f71
feat(jsx/dom): Improve compatibility React (useCallback, React.StrictMode) (#2944)
* fix(jsx/hooks): fix useCallback type

Fixed problem where callbacks that take arguments could not be specified

Like React's useCallback
8c57769f1f/types/react/index.d.ts (L2055)

* feat(jsx): export StrictMode as an alias of Fragment
2024-06-12 12:03:15 +09:00
Taku Amano
c910923aea
feat(jsx/server): introduce jsx/dom/server module for compatibility with react-dom/server (#2930)
* feat(jsx/server): introduce `jsx/dom/server` module for compatibility with `react-dom/server`

* refactor: tweaks signature of onError callback in renderToReadableStream for compatibility

* Add jsx/dom/server to jsr.json

* fix: relative import path error in `deno publish`
2024-06-12 11:59:51 +09:00
Taku Amano
668a07cb8a
feat(jsx/dom): export createRoot and hydrateRoot from jsx/dom/client as default (#2929) 2024-06-12 11:56:31 +09:00
Yusuke Wada
75663ff162 v4.4.5 2024-06-11 10:22:18 +09:00