Add default node web stream shim
- Dominant language
- Rust
- Stars
- 1.3k
- Forks
- 49
- PR merge metrics
- No merged PRs in 30d
Description
Something like this, but need to actually go through and figure out what everything is based on https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/node/stream/web.d.ts#L17 and https://github.com/denoland/deno/blob/7281775381cda79ef61df27820387dc2c74e0384/ext/web/lib.deno_web.d.ts
```ts
// in https://github.com/denoland/dnt/blob/main/lib/shims.ts
function getNodeWebStreamsShim(): Shim {
return {
package: {
name: "node:stream/web",
},
globalNames: [
"ReadableStream",
"WritableStream",
"TextDecoderStream",
typeOnly("ReadableStreamController"),
typeOnly("ReadableStreamDefaultReadValueResult"),
typeOnly("ReadableStreamDefaultReader"),
typeOnly("WritableStreamDefaultWriter"),
typeOnly("QueuingStrategy"),
{
name: "PipeOptions",
exportName: "StreamPipeOptions",
typeOnly: true,
},
],
};
}
```
Then someone could just do: `nodeWebStreams: true` in their shims.
Contributor guide
Research direction
Start in lib/shims.ts and compare the referenced DefinitelyTyped stream/web.d.ts and Deno ext/web/lib.deno_web.d.ts definitions. Determine the complete node:stream/web shim and how the existing shim configuration exposes options. Done means nodeWebStreams: true adds the required runtime globals and type-only exports without mismatches.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- deno, node.js, typescript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100