0
0
mirror of https://github.com/honojs/hono.git synced 2024-11-29 09:43:20 +01:00
Commit Graph

583 Commits

Author SHA1 Message Date
Ame_x
7217a50fee
refactor: faster for loop (#1989)
* refactor: faster

* chore: denofiy

* chore: format
2024-01-16 11:36:38 +09:00
Taku Amano
62f11a2817
feat(jsx/dom): rewrite renderer to use virtual tree (#1981)
* feat(jsx/dom): rewrite renderer to use virtual tree

* test(deno): add runtime_tests/deno/deno.json in order to allow `document`, `Element`, etc.

* refactor(jsx/dom): Removed redundant `map()` calls

* refactor(jsx/dom): tweaks getNextChildren for reduce code size

* refactor(jsx/dom): optimize findInsertBefore

* refactor(jsx/dom): optimize `build()`

* refactor(jsx/dom): reuse oldChild even in text nodes.

* feat(jsx/dom): handle promise rejection in use()

* feat(jsx): The result of using Suspense and use() is now the same as React's renderToReadableStream().

* chore: denoify

* test(deno): "dom.iterable" is required for 'Headers.entries()'
2024-01-16 11:32:44 +09:00
watany
c4f4ab06b6
feat(ssg): Implement Dynamic File Extension on MIME Type and Enhanced Response Handling (#1968)
* v0.1

* v0.2

* v0.3

* fix test

* adding test

* denoify

* fix comment
2024-01-15 18:08:50 +09:00
Yusuke Wada
6a8b4e61ba Merge branch 'main' into v4 2024-01-15 16:17:45 +09:00
Yusuke Wada
884e6d5bc4
fix(trie-router): fixed the issue same param name is used (#1983)
* fix(trie-router): fixed the issue same param name is used

* denoify
2024-01-15 16:07:23 +09:00
Ame_x
aaab8d9b3d
fix(ssg): fix path parser bug & refactor code (#1976)
* refactor util & fix bug

* add test case

* denoify

* format & denoify

* faster & add test & denoify
2024-01-15 09:29:06 +09:00
Yusuke Wada
5d1dd2f626
feat(factory): remove deprecated from Factory and createHandlers (#1979)
* feat(factory): remove `deprecated` flag from `Factory` and `createHandlers`

* denoify
2024-01-15 02:10:11 +09:00
Shotaro Nakamura
4a173c947d
refactor(ssg): SSG works without node:path (#1965)
* feat: SSG works without `node:path`

* chore: denoify

* chore: pretter

* chore: move `joinPath` and `dirname` functions

* chore: format code

* chore: denoify

* feat: add more test code

* fix: forgot remove `console.log`

* fix(ssg): Invalid joined path
If `/test` and `/test2` joined, joined path should be `/test/test2`

* chore: denoify
2024-01-15 00:00:04 +09:00
Yusuke Wada
4560df5efc
ci: remove lagon runtime tests and other lagon things (#1971)
* ci: remove lagon runtime tests and other lagon things

* remove lagon from github actions
2024-01-14 19:09:09 +09:00
Bruce Harrison
03b6903b96 feat(jsx-renderer): Nested Layouts via Renderer (#1945)
* setup basic test

* naive implementaton kinda working

* pass props to parent layout

* most tests passing

* tests passing

* remove files

* reset files

* reset files

* leave note

* introduce `<Layout>`

* denoify

* fixed type error

---------

Co-authored-by: Yusuke Wada <yusuke@kamawada.com>
2024-01-14 16:55:14 +09:00
Yusuke Wada
a2d0417fa3
refactor: remove and fix comments (#1970)
* refactor: remove and fix comments

* denoify
2024-01-14 10:31:07 +09:00
Yusuke Wada
7b83a89dd7
refactor: remove unnecessary import (#1969)
* refactor: remove unnecessary `import`

* denoify
2024-01-14 04:00:51 +09:00
watany
54ef22adff
chore(helper): Add experimental flag the SSG features (#1967) 2024-01-14 03:55:04 +09:00
Yusuke Wada
34a7ada73f
fix(routers): RegExpRouter and LinearRouter support multiple optional params (#1951)
* test(router): add optional params tests

* fix(routers): RegExpRouter and LinearRouter support multiple optional params

* fixed RegExpRouter

* denoify


Co-authored-by: Taku Amano <taku@taaas.jp>
2024-01-12 15:33:24 +09:00
Yusuke Wada
e8753d7035
feat(client): export ClientResponse and ClientRequest (#1952)
* feat(client): export `ClientResponse` and `ClientRequest`

* denoify
2024-01-12 15:29:27 +09:00
Yusuke Wada
1722144302
fix(context): set multiple cookies correctly in set res (#1947)
* fix(context): set multiple cookies correctly in `set res`

* denoify
2024-01-12 07:36:31 +09:00
watany
04b686ca39
feat: Introducing a New SSG Adaptor/Helper (#1904)
* first

* v0.1

* faster

* enhanced type

* tsx

* jsx

* split

* fix

* denoify

* fix:  compatible with node:fs/promises

* rename

* fixed

* for bun

* add Deno

* add Deno

* fix

* revert

* 1.0

* denoify

* remove message

* ToSSGResult

* fix comment

* fix comment
2024-01-12 06:04:49 +09:00
Yusuke Wada
62d420961d Merge branch 'main' into v4 2024-01-11 16:26:38 +09:00
Charles Kornoelje
0af52f828d
fix(netlify): change path in deno_dist/adapter/netlify 2024-01-11 16:12:22 +09:00
Eduard
6fe828ca0f
fix(cache): Allow composing cache control directives (#1922) 2024-01-11 11:36:52 +09:00
Yusuke Wada
ff34b1ba9a
feat: support multiple optinal parameters (#1940)
* feat: support multiple optinal parameters

* fix && denoify
2024-01-10 21:57:37 +09:00
Taku Amano
02bff6bc7b
feat(css): Introduce pseudo global selector and class name based extend syntax (#1928)
* feat(css): Introduce pseudo global selector and class name based extend syntax

* chore: denoify

* feat(css): Generated deferent class name for deferent first line comment even if the content is the same

* feat(css): enable to embed global style via <Style> component

* chore: denoify
2024-01-10 21:12:24 +09:00
Taku Amano
5cb8cd3435
refactor(jsx/dom): replace existing content by render() (#1938)
* refactor(jsx/dom): replace existing content by render()

* chore: denoify
2024-01-10 21:02:31 +09:00
Taku Amano
4df4bb4b57
fix(jsx/dom): fix cleanup for deps (#1936) 2024-01-10 10:30:44 +09:00
Yusuke Wada
fb96a76ee5
feat!: remove deprecated features (#1934)
* feat!: remove deprecated features

* denoify

* remove not used `import`

* denoify
2024-01-10 09:33:44 +09:00
Yusuke Wada
0bd8289917
feat(hono-base): app.on supports multiple paths (#1923)
* feat(hono-base): `app.on` supports multiple paths

* denoify
2024-01-10 08:50:24 +09:00
Yusuke Wada
f259dd23a6
ci: enables CI in the v4 branch (#1933)
* ci: enables CI in the v4 branch

* fixed the errors
2024-01-10 08:47:58 +09:00
Taku Amano
e532183f87
feat: Introduce jsx/dom (#1917)
* Introduce jsx/dom

* feat(jsx): add some hooks and tidy up dom core

* feat(jsx/dom): support css`` helper

* chore: denoify

* fix(jsx/dom): fix type error.

* fix(jsx/dom): avoid type error in deno

* fix(jsx/dom): fix some bugs

* chore: denoify

* refactor(jsx/dom): refactor invokeUpdate function
2024-01-10 08:36:34 +09:00
watany
adfef57af0
feat(base): Set Default Path to '*' for app.use() (#1753)
* Create codacy.yml

* Revert "Create codacy.yml"

This reverts commit af762891c0.

* feat(base): use default

* build
2024-01-10 08:30:09 +09:00
Yusuke Wada
d469ed9347
fix(netlify): add adapter/netlify/index.ts (#1932)
* fix(netlify): add `adapter/netlify/index.ts`

* denoify

* remove unnecessary comments

* denoify
2024-01-10 06:59:07 +09:00
Eli Edds
a93ddaf623
fix(client): Fix issue awaiting RPC client (#1924)
* allow awaiting clients

* update deno_dist

* add test for awaiting client
2024-01-10 06:45:00 +09:00
Sor4chi
1140532b95
fix: streamSSE's doesn't trigger onAbort correctly (#1920)
* test: add onAbort case to stream helper

* fix: how to handle sse

* test: add aborted case to streamSSE helper

* chore: denoify

* chore: lintfix
2024-01-09 15:46:51 +09:00
Yusuke Wada
dbdbd227a2
fix(validator): exclude Response type for returned values from c.req.valid() (#1914)
* fix(validator): exclude Response type for returned values from `c.req.valid()`

* denoify
2024-01-08 06:58:43 +09:00
Taku Amano
2d8d59f1e8
fix(jsx): fix jsx-runtime for falsy children (#1910) 2024-01-08 04:37:04 +09:00
Yusuke Wada
8ba8569aac
fix(deno): export css Helper for Deno (#1892)
* fix(deno): export css Helper for Deno

* denoify
2024-01-03 21:58:29 +09:00
Yusuke Wada
32e2e3c372
feat(client): add param option to $url() (#1885)
* feat(client): add `param` option to `$url()`

* denoify
2024-01-03 19:53:38 +09:00
Sor4chi
4dfcda8282
feat(streaming): implement stream.onAbort (#1871)
* feat: extend `StreamAPI` for response interception and adapt stream handler for it

* chore: denoify
2024-01-02 23:18:04 +09:00
Yusuke Wada
773531e35b
feat(dev): add colorize option for showRoutes() (#1886)
* feat(dev): add `colorize` option for `showRoutes()`

* denoify
2024-01-02 22:49:23 +09:00
Yusuke Wada
74287a82cc
feat: introduce css Helper (#1850)
* feat: introduce CSS Helper

* shorten

* feat(css): Implement css helper with callback (#1858)

* feat(css): Implement css helper with callback

* feat(css): add keyframes and pseudo selectors support

* fix(css): Specify missing "context" argument in resolveCallback()

* feat(css): use WeakMap instead of Map, to avoid memory leak

* feat(css): improve CSS helper

* fix(css): fix formatting and types in css helper

* chore: denoify

* docs(css): add experimental flag to css helper

* feat(css): Enable to embed sub `css`.

* fix(css): propagate selector to parent class

* feat(css): Use Record again for usedClassNameData

* feat(css): escape only close tag "</...>", not all slashes. we can use url() without escaping.

* fix(css): embedded `css` must have ";"

* Fix format.

* feat(css): add cx() helper

`cx()` is a helper function to combine multiple css classes.
This function is compatible with `cx()` in @emotion/css.

* feat(css): ignore boolean, null, and undefined values as same as jsx

* chore: denoify

* feat(css): enable to use cx() with external class name

* refactor(css): use symbols for keys

* chore: denoify

---------

Co-authored-by: Taku Amano <taku@taaas.jp>
2024-01-02 22:47:42 +09:00
Sor4chi
b8b0b384b6
feat: pass context to onNotFound callback in serveStatic (#1865)
* feat: pass context to onNotFound callback in serveStatic

* chore: denoify

* test: update notFoundHandler's callback expect

* feat: add Env generics for serveStatic to support `c.env` type in callback handler

* feat: add Env generics for serveStatic to support c.env type in cloudflare workers module's callback handler
2024-01-02 22:42:16 +09:00
Yusuke Wada
0e7f519916 Merge branch 'main' into next 2024-01-02 14:37:01 +09:00
Yusuke Wada
254f338a96
fix(hono-base): fixed a typo (#1877)
* fix(hono-base): fixed a typo

* denoify
2024-01-02 14:02:21 +09:00
Yusuke Wada
bfd7583cd3
fix(types): JSONParsed supports interface and Date etc. (#1853)
* fix(types): `JSONParsed` supports interface and `Date` etc.

* denoify

* supports bigint as never

* denoify
2024-01-01 18:23:12 +09:00
Taku Amano
813484dffd
fix(dev): preserve original handler in [composedHandler]. (#1873)
* fix(dev): preserve original handler in [composedHandler].

* chore: denoify

* refactor(dev): better variable names
2024-01-01 18:20:41 +09:00
watany
7bbaefcbee
feat(helper): export SSEStreamingApi and SSEMessage. (#1863)
* refactor

* export

* check & denoify
2023-12-27 10:45:34 +09:00
Withee Poositasai
b128d02336
feat: Add onNotFound handler in adapters' serveStatic (#1825)
* feat: add onNotFound handler in adapters' serveStatic

* test: add serveStatic onNotFound tests for bun and deno

* test: add serveStatic onNotFound tests for cloudflare workers
2023-12-27 07:04:46 +09:00
Yusuke Wada
5b4592190b
feat(dev): add getRouterName() (#1841)
* feat(dev): add `getRouterName()`

* denoify
2023-12-27 07:02:03 +09:00
Taku Amano
b143c4ed8b
feat(middleware/csrf): Introduce CSRF middleware (#1823)
* feat(middleware/csrf): Introduce CSRF middleware

* test(middleware/csrf): Add tests for CSRF middleware

* chore: denoify

* fix(middleware/csrf): fix typo.
2023-12-27 06:58:20 +09:00
Sor4chi
7768865e7a
fix: move c.stream* to helper (#1846)
* refactor: move streaming helper to `streaming/sse.ts`

* feat: add streamSSE's export in streaming handler

* feat: move `stream` and `streamText` to streaming helper

* chore: add deprecated expression for `c.stream` and `c.streamText`

* fix: use `stream` helper in streamSSE

* refactor: move `streamText` to `text.ts`

* test: add some case to `stream` and `streamText`

* test: refactor `streamSSE` case for uniformity

* chore: denoify

* fix: update jsdoc's deprecated description, simplify `c.stream` and `c.streamText`

* fix: match the header notation with that of `streamSSE

* chore: denoify

* refactor: remove unnecesary export
2023-12-27 06:55:24 +09:00
Yusuke Wada
d41c17ad0b
fix(req): avoid error when req.queries() receives unexpected values (#1862)
* wip

* fix(req): avoid error when `req.queries()` receives unexpected values

* denoify
2023-12-27 06:41:48 +09:00