0
0
mirror of https://github.com/honojs/hono.git synced 2024-12-01 10:51:01 +00:00
Commit Graph

10 Commits

Author SHA1 Message Date
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
Taku Amano
1567438549
feat(helper/html): Support Promise<string | HtmlEscapedString> in html tagged template literals (#1826)
* feat(helper/html): Support Promise<string | HtmlEscapedString> in html tagged template literals

* chore: denoify

* test: fix lint error
2023-12-17 07:35: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
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
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
Sor4chi
8ab0ccd7cc
docs: support change of escapeTextForBrowser path in react (#1336) 2023-08-16 07:39:35 +09:00
Codinak
1495f8b41b
fix(jsx): escapeToBuffer vulnerability (#1266)
* fix escapeToBuffer vulnerability

Escape single quote (0x27) to limit execution capabilities under certain conditions.

* denoify
2023-07-26 23:12:25 +09:00
Yusuke Wada
a7ad89ccef refactor(utils/html): remove escape function (#450)
Close #445
2022-08-03 11:39:36 +09:00
Yusuke Wada
9f2a270c28
refactor(utils/html): rename Buffer to StringBuffer (#449) 2022-08-03 11:24:51 +09:00
Yusuke Wada
d9e9e62e47
feat: support Deno! (#336) 2022-07-02 15:09:45 +09:00