- From: juner <notifications@github.com>
- Date: Sat, 31 Jan 2026 08:50:45 -0800
- To: whatwg/streams <streams@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/streams/issues/1359/3828820141@github.com>
juner left a comment (whatwg/streams#1359)
@jasnell
That’s a fair point, and I agree that the existing `start(c) { controller = c; }` pattern is well established and works fine today. I don’t think this proposal should be seen as something that existing libraries or applications are expected to migrate to.
My motivation here isn’t that the current pattern is insufficient, but that it’s somewhat *implicit* and non-obvious, especially outside of library code. The controller relationship already exists in the model, but the only way to access it today is by knowing and re-implementing this idiom.
From that perspective, `withController()` would be more about *making an existing relationship explicit* than about introducing a new capability or replacing a best practice. Similar to `Promise.withResolvers()`, it wouldn’t unlock anything new, but it can reduce boilerplate and make intent clearer in cases where producer and consumer lifetimes are intentionally decoupled.
That said, I fully agree the bar for standardizing this should be high, and if the conclusion is that the existing pattern is sufficient and clearer to keep as-is, that’s a reasonable outcome too. I mainly wanted to sanity-check whether this kind of explicitness is something the platform would ever want to offer.
--
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/issues/1359#issuecomment-3828820141
You are receiving this because you are subscribed to this thread.
Message ID: <whatwg/streams/issues/1359/3828820141@github.com>
Received on Saturday, 31 January 2026 16:50:49 UTC