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

Update for TypeScript 4.2 and latest WPT #20

Merged
merged 12 commits into from
May 12, 2021
Merged

Conversation

MattiasBuelens
Copy link
Owner

TypeScript 4.2 no longer contains type definitions for readable byte streams (UnderlyingByteSource, ReadableStreamBYOBReader, or ReadableByteStreamController), since they are not widely supported. We now define these types ourselves as part of this project.

Note that TypeScript may not be able to select the correct overload. For example, this currently needs an explicit type cast:

import { ReadableStream } from 'web-streams-polyfill';
import { createReadableStreamWrapper, ReadableByteStreamLikeConstructor } from 'web-streams-adapter';

const wrapper = createReadableStreamWrapper(ReadableStreamPolyfill as ReadableByteStreamLikeConstructor);

(We may want to consider creating a separate createReadableByteStreamWrapper helper to avoid this... 🤔)

While we're at it, also update to the latest version of the web platform tests and the WPT runner. (We still don't pass all of the tests, but at least we run them. 😛)

Fixes #17.

@MattiasBuelens MattiasBuelens merged commit 45d5b73 into master May 12, 2021
@MattiasBuelens MattiasBuelens deleted the typescript-4.2 branch May 12, 2021 21:46
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.

Typescript 4.2.2 support
1 participant