scala-js/scala-js-dom

Facade for `setImmediate` and `clearImmediate`

armanbilge opened this issue · 2 comments

Since we are now facading APIs regardless of their experimental status or overall adoption, would it make sense for us to facade setImmediate and clearImmediate? It is documented on MDN after all.

Although by itself this facade is useless in virtually all browsers, when paired with an npm dependency to the setimmediate polyfill it becomes much more useful. Edit: seems also available as a webjar.

@japgolly wdyt? This would address your use-case in scala-js/scala-js-macrotask-executor#37.

sjrd commented

Since we are now facading APIs regardless of their experimental status or overall adoption

Adoption, yes. Status, not so much. We should stick to APIs that are standardized in the DOM. Or at the very least, on track to become standard in the DOM.

AFAIK, setImmediate has been indefinitely rejected as a proposal for DOM, and therefore it should not be in scalajs-dom, IMO.

Or at the very least, on track to become standard in the DOM.

Thanks, that's an important distinction. Indeed, MDN says at least twice that setImmediate is not on this track.

This feature is non-standard and is not on a standards track.

This method is not expected to become standard,

I assume that setImmediate was on a standards track on some point, before being rejected, so it's interesting to think about if the facade had been introduced at that point; in that case, I suppose we should have deprecated it?

As I wrote the above, I thought to check: indeed, setImmediate was facaded in scala-js-dom once upon a time ago and deprecated as part of #255 and subsequently removed (although I didn't track down that commit. update: it was in cfe34f9 just before 1.0.0).

Let's give @japgolly a chance to weigh in.