-
Notifications
You must be signed in to change notification settings - Fork 14
Use ArrayBufferLike
instead of ArrayBuffer
for reading/writing bytes
#199
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
Conversation
I am in favour of reverting #197. I don't think the library is yet mature enough to turn off typescript checking for generated code. If we would absolutely want to support turning it off, then we should have the user opt-out by adding something to the |
@jhugman I'm in favour of reverting it too, for now (or as you said, make it configurable) With regards to this specific PR though, is there anything else you'd like to see? |
23e9c44
to
856d575
Compare
Sorry, my mistake. I think switching type-checking back on in this PR, and fixing the resulting errors would be useful. If I understand your comment #0 correctly, this issue is fixing a tsc compile error. I'm really sorry, I'm afk until 6 January, so can't really check out your PR and poke at it. I'm going to ask @Johennes or @zzorba to have a look with you. |
If its all the same to you, I'd prefer to make a separate PR reverting #197, keep this PR as-is to fix this one specific class of TypeScript compilation errors, and make separate PRs for the other errors as I can get to them. |
Prior to using `ArrayBufferLike`, TypeScript compilation errors in the generated output would occur: ``` src/generated/foobar.ts:1133:25 - error TS2345: Argument of type '(value: ArrayBuffer) => string' is not assignable to parameter of type 'StringLifter'. Types of parameters 'value' and 'bytes' are incompatible. Type 'Uint8Array<ArrayBufferLike>' is missing the following properties from type 'ArrayBuffer': maxByteLength, resizable, resize, detached, and 2 more. ``` Unfortunately, due to merging jhugman#197, these legitimate errors were also hidden. Ideally, we should investigate why the generated output has compilation issues and resolve them, and then revert jhugman#197.
856d575
to
2d24240
Compare
I haven't observed these error myself so far. I suspect they require the consumer to use a certain minimum TS version? Would it be possible to set up a test case that exposes the failure and verifies the fix? |
I'm sorry to step on your toes @Johennes . Looking at this PR, it seems harmless, and only part of @hassankhan 's larger #198.
The
@Johennes What say we approve this, so @hassankhan can regain some of the excellent momentum he had before the break? |
Ah, ok. This sounds totally fine then. Sorry, I didn't dig into the usages myself. I was just being overly cautious because of the prior TS breakage we had. 😅 |
Prior to using
ArrayBufferLike
, TypeScript compilation errors in the generated output would occur:Unfortunately, due to merging #197, these legitimate errors were also hidden. Ideally, we should investigate why the generated output has compilation issues and resolve them, and then revert #197.