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

562 Commits

Author SHA1 Message Date
Yusuke Wada
583d3d498b
Merge pull request #306 from honojs/feat/jsx
feat: jsx middleware
2022-06-10 18:43:22 +09:00
Yusuke Wada
e6c916a6ce docs: add docs for JSX middleware 2022-06-10 18:37:30 +09:00
Taku Amano
9ae8f7295d
feat(middleware/jsx): Introduce memo. (#309)
* feat(middleware/jsx): Introduce memo.

* fix(middleware/jsx): propsAreEqual is always defined.
2022-06-10 15:09:29 +09:00
Taku Amano
ddd905ec26
feat(middleware/jsx): Support dangerouslySetInnerHTML and some special spec (#308)
* feat(middleware/jsx): handle some special cases for jsx.

* feat(middleware/jsx): Support dangerouslySetInnerHTML.
2022-06-10 10:19:04 +09:00
Taku Amano
b96526270e
perf(utils/html): Improve performance escape() (#307) 2022-06-10 07:47:43 +09:00
Eric Lee
d2a4b2dfb1
Export md5 function in src/utils/crypto.ts (#305)
* Export `md5` function in src/utils/crypto.ts

Export an additional `md5` function in the crypto utility.

Useful when working with R2 and providing a MD5 hash for verification.

```
import { md5 } from "hono/utils/crypto";

...
const md5Digest = md5(body);
const object = await bucket.put(key, body, {md5: md5Digest});
```

* Update crypto.test.ts

Add a test for 'md5' crypto utility function.

* Add forgotten import to crypto.test.ts
2022-06-10 07:45:51 +09:00
Charl Kruger
6b8d605375
Update README.md (#304)
* Update README.md

Adding some clarity on how to access bindings like secrets

* Update README.md
2022-06-07 21:09:17 +09:00
Yusuke Wada
273106cfa9 [WIP] feat: jsx middleware 2022-06-07 19:03:42 +09:00
Yusuke Wada
38a8c46568
feat: notFound support asyc/await (#303)
Close #302
2022-06-07 16:13:12 +09:00
Yusuke Wada
8506ed4969 chore: bump up to v1.4.5 2022-06-07 10:24:50 +09:00
Yusuke Wada
0de127fd74
feat: throw error if context is not finalized (#301)
* feat: throw error if context is not finalized

* remove duplicate
2022-06-07 10:20:05 +09:00
Yusuke Wada
7c244c3bb3
feat(middleware): add bearer auth middleware (#299)
* feat(middleware): add bearer auth middleware

Close #279

* add prefix option

* tweak
2022-06-06 08:38:33 +09:00
Yusuke Wada
153fe69b17 chore: bump up to v1.4.4 2022-06-04 20:10:45 +09:00
Taku Amano
078c5ddf4d
fix: Import "declare global" for the Request interface explicitly. (#298) 2022-06-04 19:57:28 +09:00
Minghe
92793399a3
fix(status): make the status 401 for the invalid authorization info (#296) 2022-06-03 11:14:40 +09:00
Yusuke Wada
b17d56fd7e chore: bump up to v1.4.3 2022-06-02 15:22:09 +09:00
Yusuke Wada
6a42e1c847 chore(type): fixed generics warnings 2022-06-02 15:20:03 +09:00
Yusuke Wada
d54ff87c58 chore(benchmark): tweak, Hono is really fastest! 2022-06-02 15:10:57 +09:00
Minghe
06b37a4a8a
fix(test): upgrade the miniflare to consume the fix on node18 (#295) 2022-06-02 14:56:35 +09:00
Minghe
e774e0760f
fix(token): correct 'WWW-Authenticate' header in respose (#294) 2022-06-02 14:54:45 +09:00
Taku Amano
081b5f7c0a
perf(util): use indexOf instead of RegExp.match for extracting URL. (#293)
Co-authored-by: Yusuke Wada <yusuke@kamawada.com>
2022-06-02 14:52:04 +09:00
Taku Amano
9da10ac44b
perf: Various performance tuning (#292)
* Revert "perf(util): cache regex result for URL path(s) (#284)"

This reverts commit eaef358deb.

* Extend Request.prototype.

* Tweaks constructor of Context.

* Optimize context.ts

* Lazy initialization.

* Skip runtime type checking.

* Use spread operator for creating temporary record.

* Reduce object creation.

* Automatic finalize flag when res is updated.

* Define interface and init function for Request in request.ts

* Tweaks context.text.ts.

* Remove unused member "handlersCache".
2022-06-02 14:32:36 +09:00
Yusuke Wada
548c12b5cd
chore(benchmark): polyfill Request and Response (#287)
* chore(benchmark): polyfill `Request` and `Response`

* polyfill
2022-06-01 05:48:20 +09:00
Nelson Chen
81d77ba4c3
minor typo fixes in readme (#286) 2022-05-31 07:51:23 +09:00
Yusuke Wada
e237927934
chore(tsconfig): update es2017 to es2020 (#285) 2022-05-30 21:59:38 +09:00
Yusuke Wada
98521d39d6 perf: tweak 2022-05-30 21:33:37 +09:00
Yusuke Wada
eaef358deb
perf(util): cache regex result for URL path(s) (#284) 2022-05-30 21:28:08 +09:00
Yusuke Wada
5b561bfb1e
perf(conmpose): remove bind (#283) 2022-05-30 17:33:52 +09:00
Yusuke Wada
16967676a3 chore: bump up to v1.4.2 2022-05-28 13:01:22 +09:00
Yusuke Wada
18be41f026
perf(context): add HonoResponse for better performance (#281) 2022-05-28 12:59:55 +09:00
Yusuke Wada
8bbb495d51 chore: add .mts to tsconfig.json 2022-05-27 17:28:07 +09:00
Yusuke Wada
b55eb2e661
refactor(TypeScript): enable strict null check (#280) 2022-05-27 17:22:39 +09:00
Yusuke Wada
c0661519b0 chore(benchmark): fix RegExpRouter score, it's fastest 2022-05-27 17:16:43 +09:00
Yusuke Wada
79c99c6403 chore: bump up to v1.4.1 2022-05-26 17:33:30 +09:00
Yusuke Wada
a1d21329ea
refactor: make GraphQL Server middleware as handler (#277) 2022-05-26 17:31:17 +09:00
Taku Amano
aa6807cfba
Update scoring rules in RegExpRouter. (#275) 2022-05-26 16:38:20 +09:00
Yusuke Wada
924408b463
refactor(trie-router): fixed routing priority for * (#276)
* refactor(trie-router): make `*` and `/*` have same priority

* feat(router): fixed routing priority for `*`

* feat(router): fixed routing priority for `*`
2022-05-26 16:36:40 +09:00
Yusuke Wada
500fcaa9e1
refactor(trie-router): make * and /* have same priority (#274) 2022-05-26 15:26:13 +09:00
Yusuke Wada
938aa7f060 chore: bump up to v1.4.0 🎉 2022-05-26 10:08:31 +09:00
Yusuke Wada
730502b169 docs: update readme 2022-05-26 10:06:10 +09:00
Yusuke Wada
ebbb58dc81 chore: update benchmark script 2022-05-26 09:09:19 +09:00
Yusuke Wada
77e16ddfb7
feat: c.res is available before dispatching (#272)
* fix(router): fixed trie-router bugs

* feat: `c.res` is available before dispatching
2022-05-26 09:06:41 +09:00
Taku Amano
e6924271f3
refactor(router): Make Router an interface, not a class (#268)
* Allow initialization with router objects instead of routerClass.

* Make Router an interface, not a class.

* Make Result an interface, not a class.

* Apply getSortedHandlers for result.

Co-authored-by: Yusuke Wada <yusuke@kamawada.com>
2022-05-26 07:39:43 +09:00
Yusuke Wada
ef65308357
fix(router): fixed trie-router bugs (#271) 2022-05-26 00:34:01 +09:00
Yusuke Wada
7cc9644b60
feat(trie-router) : Routing with order specification (#269)
* Routing with order specification

* fixed test

* fixed for special wildcard and so on

* fixed scoring

* fix for `route` method
2022-05-25 11:56:17 +09:00
Taku Amano
a18edd5294
RegExpRouter : Routing with order specification. (#267) 2022-05-25 09:57:37 +09:00
Yusuke Wada
4a906a8aae test(jwt): add tests 2022-05-25 09:24:01 +09:00
Chris R
0e6bff6eb1
fix: ensure the request does not continue if the jwt token is not valid (#266) 2022-05-25 09:18:02 +09:00
Yusuke Wada
52bca3bd0a docs: fix readme 2022-05-22 19:14:37 +09:00
Yusuke Wada
8dfc74b187
fix(context): initialize status and header values after newResponse (#261)
* fix(context): initialize status and header values after `newResponse`
* fixed test
2022-05-22 10:49:58 +09:00