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

Merged
merged 7 commits into from
Mar 16, 2025
Merged

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

All modified and coverable lines are covered by tests ✅

Project coverage is 91.29%. Comparing base (6659ea1) to head (e6820e6).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3934   +/-   ##
=======================================
  Coverage   91.29%   91.29%           
=======================================
  Files         168      168           
  Lines       10771    10771           
  Branches     3038     3028   -10     
=======================================
  Hits         9833     9833           
  Misses        937      937           
  Partials        1        1           

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

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@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

@yusukebe
Copy link
Member

Hi @EdamAme-x!

It succeed if I merge main at honojs/hono to your branch. Let's go with this.

@yusukebe yusukebe merged commit 035c2d7 into honojs:main Mar 16, 2025
16 checks passed
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