Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## next #4100 +/- ##
==========================================
- Coverage 91.32% 91.27% -0.06%
==========================================
Files 168 168
Lines 10802 10723 -79
Branches 3073 3043 -30
==========================================
- Hits 9865 9787 -78
+ Misses 936 935 -1
Partials 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Whether we merge this or not is a difficult thing. In the |
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Kentaro Suzuki <71284054+sushichan044@users.noreply.github.com> Co-authored-by: Fuxiao Peng <xx1124961758@126.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Hello @usualoma @sushichan044 ! What do you think of this? If this makes sense to you, can you review it? |
usualoma
left a comment
There was a problem hiding this comment.
Great, I think it's wonderful work!
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
sushichan044
left a comment
There was a problem hiding this comment.
I had the same concern as @usualoma .
Since it has already been corrected, I think it looks good now!
I did a quick check on my end, and it seemed to handle common corner cases without any issues.
|
@yusukebe it('Should remove existing header when new value is empty array', async () => {
c.header('X-Test', 'existing')
const res = c.json({ test: 'data' }, 200, {
'X-Test': [],
})
expect(res.headers.get('X-Test')).toBeNull()
}) |
Co-authored-by: Kentaro Suzuki <71284054+sushichan044@users.noreply.github.com>
Bundle size check
Compiler Diagnostics (typescript-go)
Reported by octocov |
Bundle size check
Compiler Diagnostics (tsc)
Reported by octocov |
|
@usualoma @sushichan044 Thanks! @sushichan044 Yes. The test you mentioned is good. I added it. I'll include this in the next minor release. |
This PR reduces the code size of
src/context.tsand fixes some bugs.Reducing the code size
The current implementation uses
#preparedHeadersand#isFreshto avoid generatingHeadersandResponseobjects as much as possible. This increases the amount of code and makes the code more complex.In this PR, we have removed them and shortened the code.
This change has reduced the bundle size by about 900B with a minified minimum app using the
hono/tiny.Fixes weird behaviors
There are some bugs in the current implementation of
context.tsthat cause weird behaviors. The following tests have failed. This PR allows those tests to succeed.f4cb6ac
Therefore, the following Issues are fixed.
Fixes honojs/node-server#226
Fixes #3736 (maybe)
Performance
This PR shows a slight decrease in performance related to application speed. Benchmark results using this script are as follows.
Performance is very important to us. So we are not sure if we can accept this PR or not. However, the difference is slight, and the smaller file size is expected to improve performance in a serverless environment.
The author should do the following, if applicable
bun run format:fix && bun run lint:fixto format the code