0
0
mirror of https://github.com/honojs/hono.git synced 2024-11-21 18:18:57 +01:00
Commit Graph

2161 Commits

Author SHA1 Message Date
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
Taku Amano
ad04fbff1c
refactor(jsx): reduce code size and improve maintainability (#2956)
* refactor(jsx): Refactored an utility method to reduce code size and improve maintainability

* refactor: tweaks shared namespace string for svg and math for reduced size

* fix: degration of c0fade3
2024-06-11 10:08:39 +09:00
Yusuke Wada
32ba5ba836
refactor(request): shorten parseBody and remove unnecessary check (#2947)
* refactor(request): shorten `parseBody` and remove unnecessary check

* refactored as https://github.com/honojs/hono/pull/2947#issuecomment-2158262418

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

---------

Co-authored-by: Taku Amano <taku@taaas.jp>
2024-06-10 23:51:43 +09:00
Ame_x
208d77b06d
fix(context): default JSONRespond and TextRespond StatusCode generic arg (#2954)
* fix: default JSONRespond  and TextRespond StatusCode generic arg

* chore: format

* revert
2024-06-10 18:13:58 +09:00
Yusuke Wada
e1e0e0976b
test(hono-base): add tests for covering 100% (#2952) 2024-06-10 08:17:53 +09:00
Yusuke Wada
7eb3e3b281
refactor(context): remove unnecessary initialization add add tests for Context (#2949)
* refactor(context): remove unnecessary initialization add add tests

* Don't initialize `_var`

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

---------

Co-authored-by: Taku Amano <taku@taaas.jp>
2024-06-10 07:04:45 +09:00
Yusuke Wada
ddb1d862bc
refactor(hono-base): don't check argument values (#2946) 2024-06-09 22:55:53 +09:00
Yusuke Wada
0a974ffeb6
refactor(hono-base): make 2nd arg of app.route() required (#2945) 2024-06-09 21:09:44 +09:00
Yusuke Wada
e72787968f
fix(jsx): rename Hono to JSX and export JSX namespace (#2937)
* fix(jsx): rename `Hono` to `JSX` and export `JSX` namespace

* export as type
2024-06-09 07:57:18 +09:00
fzn0x
1a32ef4d9d
fix(cors): allow custom vary header (#2934) 2024-06-09 07:53:22 +09:00
Yusuke Wada
fe7cfcf719 v4.4.4 2024-06-06 23:01:46 +09:00
Yusuke Wada
8c5463f62b
refactor(connifo): create types.ts for type definitions (#2924) 2024-06-06 22:55:37 +09:00
Yusuke Wada
fd6ad5e7b1
chore: add text and html for coverage reporter (#2923) 2024-06-06 22:25:38 +09:00
Taku Amano
71f5a0123a
refactor(middleware/serve-static): call getContent only once if the file does not exist (#2922) 2024-06-06 22:13:22 +09:00
Trung Dang
00f32b7c17
fix(types): SimplifyDeepArray should now actually be "deep" (#2920)
* fix(types): `SimplifyDeepArray` should now actually be "deep"

Also now uses `Simplify` instead of inline declare the type

* tests(types): extra tests for `Should have correct types - interfaces`

* style: apply lint&style fixes

* docs: rewording SimplifyDeepArray jsdoc

* fix: type is possibly infinite

* fix: mismatching implementation of interface

* refactor: split JSONRespond return declaration to it's own type

DRY-er code and fixes a weird type is possibly infinite yelling
2024-06-06 22:09:33 +09:00
Yusuke Wada
731d7aebad
fix(types): add _ prefix to TypedResponse properties (#2917) 2024-06-06 21:48:24 +09:00
Yusuke Wada
cb55866ab8
fix(filepath): allow suffix includes - and _ (#2910) 2024-06-06 18:50:18 +09:00