0
0
mirror of https://github.com/honojs/hono.git synced 2024-11-25 13:19:30 +01:00
Commit Graph

29 Commits

Author SHA1 Message Date
Ben
41075d5a80
fix(types): Added E env type argument to showRoutes & inspectRoutes hono parameter (#1778)
* Fixed `showRoutes` doc comment import path

* Fixed `showRoutes` & `inspectRoutes` Hono parameter types

* Updated `deno_dist` Deno files

* Renamed type arguments from `TEnv` to `E`
2023-12-05 18:47:45 +09:00
Yusuke Wada
86c4165ea4
fix(factory): Filter undefined in createHandlers (#1772)
* fix(factory): Filter undefined in `createHandlers`

* denoify
2023-12-04 09:47:45 +09:00
Taku Amano
d86fcd41e1
feat(request): Introduce matchedRoutes and routePath for HonoRequest (#1744)
* feat(request): Introduce `matchedRoutes` and `routePath` for `HonoRequest`

* test: update test.

* chore: denoify

* fix: Remove unused type imports.
2023-12-03 18:55:38 +09:00
Taku Amano
bd36ad10fc
feat(helper/dev): Introduce inspectRoutes() and showRoutes() (#1716)
* feat(dev): Introduce "dev" helper

* feat(dev): Expose "dev" helper

* refactor: Use "named function" in some middleware.

* feat: `app.showRoutes()` is now deprecated. Use `showRoutes()` in `helper` instead.

* refactor: export RouterRoute interface for utility

* refactor: remove captureRouteStackTrace, add inspectRoutes

`captureRouteStackTrace` will be implemented after some more thought.
Instead, I added `inspectRoutes` to get routes as data.

* test: add tests for helper/dev/index.ts

* fix: run `format:fix`

* refactor: use named functions for middleware

* chore: denoify

* docs: tweaks deprecation warning message

* refactor(dev): Simplification of showList options

* chore: denoify
2023-11-29 19:22:09 +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
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
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
5e3e85a179
Merge pull request #1690 from honojs/next
Next
2023-11-13 14:25:42 +09:00
Christian Rackerseder
47942ffc68
fix(types): allow arbitrary values as environment values (#1680) 2023-11-12 09:05:54 +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
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
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
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
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
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
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
6c374623ed Merge branch 'main' into next 2023-09-21 00:32:01 +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
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
watany
d8b0e7e51e
refactor(helper): Use getRuntimeKey() in env function (#1454)
* refactor

* lint&denoify

* marker

* type assersion

* revert fastly message
2023-09-15 18:40:06 +09:00
Yusuke Wada
e4c4322941
feat(helper): introduce factory helper (#1434)
* feat(helper): introduce `factory` helper

* denoify
2023-09-11 07:31:30 +09:00
jkeys089
d6ec48ee02
feat(cookie): cookie parsing improvements (#1428) 2023-09-09 17:05:09 +09:00
Yusuke Wada
e07019125d
feat: introduce "Helpers" (#1353)
* mv jsx

* introduce helper

* denoify & add src/helper.ts for Deno

* remove `c` not used

* remove `c` in lagon test

* remove `src/adapter.ts` not used
2023-08-21 15:22:37 +09:00