Undocumented Goodies

Hi there! First off great work. Wrangler, docs are pretty stellar for such a new tool.

One thing I noticed was that there are a lot of inconsistencies (which you do note) but also undocumented features (often not mentioned) in the docs.

For example: https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/tee

It works! Quite well I might add.

Why would you need this?

Let’s say you wanted to stream a response body but also add it to the cache. You need 2 readable streams in order to do this at the same time and not block the request using e.waitUntil(cache.put(…))

Thanks for the great infra and tooling!

1 Like