Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

types(compose): follow up #3932 #3934

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

EdamAme-x
Copy link
Contributor

@EdamAme-x EdamAme-x commented Feb 19, 2025

This is a follow-up to PR #3922.

Fixed jsdoc and made minor type definition changes.
Marked as chore types since it does not constitute a change to the internal structure.

The author should do the following, if applicable

  • Add tests
  • Run tests
  • bun run format:fix && bun run lint:fix to format the code
  • Add TSDoc/JSDoc to document the code

@EdamAme-x
Copy link
Contributor Author

EdamAme-x commented Feb 19, 2025

@EdamAme-x
Copy link
Contributor Author

This seems to be a bug caused by a spec change in 2.2.0, as it works fine when Deno is reverted to 2.1.10 (one version earlier).

https://github.com/denoland/deno/releases/tag/v2.2.0

@EdamAme-x
Copy link
Contributor Author

EdamAme-x commented Feb 19, 2025

@yusukebe
Copy link
Member

Yes. Updating to TypeScript v5.7 caused this error. I'm investigating.

@EdamAme-x
Copy link
Contributor Author

just completed merging the fix for CI commit into this branch.
@yusukebe Can you review this?

Copy link

codecov bot commented Mar 5, 2025

Codecov Report

Attention: Patch coverage is 89.43089% with 91 lines in your changes missing coverage. Please review.

Project coverage is 91.32%. Comparing base (a15bec3) to head (09a4ef7).
Report is 89 commits behind head on main.

Files with missing lines Patch % Lines
build/remove-private-fields.ts 0.00% 32 Missing ⚠️
src/middleware/language/language.ts 85.02% 25 Missing ⚠️
build/remove-private-fields-worker.ts 75.00% 15 Missing ⚠️
src/utils/jwt/jwt.ts 87.30% 8 Missing ⚠️
src/router/trie-router/node.ts 94.00% 3 Missing ⚠️
src/utils/jwt/types.ts 50.00% 3 Missing ⚠️
src/jsx/dom/render.ts 83.33% 2 Missing ⚠️
src/context.ts 92.85% 1 Missing ⚠️
src/utils/accept.ts 98.50% 1 Missing ⚠️
src/utils/cookie.ts 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3934      +/-   ##
==========================================
- Coverage   91.70%   91.32%   -0.38%     
==========================================
  Files         159      168       +9     
  Lines       10145    10687     +542     
  Branches     2862     3022     +160     
==========================================
+ Hits         9303     9760     +457     
- Misses        840      926      +86     
+ Partials        2        1       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@EdamAme-x EdamAme-x changed the title chore(compose): follow up #3932 types(compose): follow up #3932 Mar 5, 2025
@yusukebe
Copy link
Member

yusukebe commented Mar 5, 2025

Hi @EdamAme-x

It's weird. The following command will fail on my machine.

deno publish --dry-run

Can you try it?

@EdamAme-x
Copy link
Contributor Author

okay

@EdamAme-x
Copy link
Contributor Author

It certainly fails.
This PR should have nothing to do with...

TS2345 [ERROR]: Argument of type 'string | ArrayBuffer | Uint8Array<ArrayBufferLike>' is not assignable to parameter of type 'string | ArrayBuffer'.
  Type 'Uint8Array<ArrayBufferLike>' is not assignable to type 'string | ArrayBuffer'.
    Type 'Uint8Array<ArrayBufferLike>' is missing the following properties from type 'ArrayBuffer': maxByteLength, resizable, resize, detached, and 2 more.
    this.#init.send(source, options ?? {})
                    ~~~~~~
    at file:///workspace/hono/src/helper/websocket/index.ts:71:21

TS2345 [ERROR]: Argument of type 'Uint8Array<ArrayBuffer>' is not assignable to parameter of type 'ArrayBufferLike'.
  Type 'Uint8Array<ArrayBuffer>' is missing the following properties from type 'ArrayBuffer': maxByteLength, resizable, resize, detached, and 2 more.
  return encodeBase64(buffer)
                      ~~~~~~
    at file:///workspace/hono/src/middleware/secure-headers/secure-headers.ts:131:23

TS2345 [ERROR]: Argument of type 'Uint8Array<ArrayBufferLike>' is not assignable to parameter of type 'ArrayBufferLike'.
  Type 'Uint8Array<ArrayBufferLike>' is missing the following properties from type 'ArrayBuffer': maxByteLength, resizable, resize, detached, and 2 more.
  encodeBase64Url(utf8Encoder.encode(JSON.stringify(part))).replace(/=/g, '')
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    at file:///workspace/hono/src/utils/jwt/jwt.ts:25:19

Found 3 errors.

error: Type checking failed.

@yusukebe
Copy link
Member

yusukebe commented Mar 5, 2025

@EdamAme-x Yes. Super weird.

@EdamAme-x
Copy link
Contributor Author

EdamAme-x commented Mar 5, 2025

If it's main, it works.
Very hyper-super ultra weird.

gitpod@honojs-hono-ze48ld05ll8:/workspace/hono$ deno publish --dry-run
Success Dry run complete

gitpod@honojs-hono-ze48ld05ll8:/workspace/hono$ git branch
* main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants