* 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()`.
* 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>
* 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>
* 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>