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

feat: update to deno v2 #48

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

feat: update to deno v2 #48

wants to merge 5 commits into from

Conversation

ohroy
Copy link

@ohroy ohroy commented Oct 29, 2024

summary

@langpavel
Copy link

This is probably the thing I'm waiting for:

SyntaxError: The requested module 'jsr:@std/io' does not provide an export named 'BufReader' at https://deno.land/x/[email protected]/deps.ts:1:18
... {
  code: "ERR_MODULE_NOT_FOUND"
}

@lenkan
Copy link
Owner

lenkan commented Nov 5, 2024

Thanks! I forgot to mention that I ran the workflow last week but it failed. I think it just needs to be updated to use deno v2.

@bramtechs
Copy link

I've updated the workflow in my PR ohroy#1 to use Deno v2. I don't really know how making a PR for another PR works on Github, but consider taking a look, @ohroy.

deno fmt and upgrade to v2 to make CI pass
@ohroy
Copy link
Author

ohroy commented Nov 16, 2024

@bramtechs Thank you for perfecting it ! I've merge it to my branch, now this should auto sync changes. let's wait @lenkan check it

Copy link
Owner

@lenkan lenkan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot!

In general, it looks good to me! However, it would be good to make sure there is test coverage for the case when the connection reader does not read the entire buffer in a single call. I think it might cause issues (?). That was the reason the BufReader was used previously.

Comment on lines +15 to +22
const buf = new Uint8Array(length);
const n = await this.#reader.read(buf);

if (n === null) {
throw new FrameError("EOF");
}

return n;
return buf;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering if this might cause issues on slower connections. From the docs https://docs.deno.com/api/deno/~/Deno.Conn#call_signature_read_0:

It is possible for a read to successfully return with 0 bytes. This does not indicate EOF.
It is not guaranteed that the full buffer will be read in a single call.

These are the cases that BufReader handled. I see the tests passes though. But I do not remember if there is a test that specifically triggers the case where the full buffer is not read in a single call.

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.

jsr:@std/io v0.225 Breaking change
4 participants