I've many Causes To Hope
페이지 정보
작성자 Elea… 작성일23-12-04 01:02 조회2,699회 댓글0건본문
One of many things I've poured myself into this 12 months -- with a merry band of contributors including Domenic Denicola, Anne van Kesteren, Jake Archibald, Mark Miller, Erik Arvidsson, and many others -- has been a design for Guarantees that DOM and JS can both adopt. There is a (very) long historical past of Promises, Deferreds, and varied different Promise-ish issues in JS which I will not bore you with right here except to notice that there are very few client-facet libraries which do not embody such a thing and use it as a core idiom for coping with async behvaior (e.g., XHR).
Query, Dojo, Q, WinJS, Cujo, Closure, YUI, Ember (through RSVP), and all of the rest use this style of contract pervasively and have for years. The most important libraries are coalescing round that contract and so it seems time, finally, to make our greatest and most essential library -- DOM -- savvy to them too.
The latest history begins (arbitrarily) a few years ago and ends 2 weeks ago. API we have designed need not upset anyone's applecart.
The TC39 meeting was a key turning point: up until 2 weeks in the past, DOM had a version of this design beneath the name Future. I made the choice to not use the title Promise for that work because without TC39's settlement on a design, the DOM variant might at some point find itself each camping on a worldwide name and disagreeing with JS about semantics or naming of particular APIs. That sort of thing might have result in the suspicion by DOM people that TC39 was out of touch and slow, and by TC39 that DOM rushed in like fools into an area that's pretty clearly one thing the std lib ought to include (even if it couldn't achieve this for a number of years attributable to publication and spec timing points).
Guarantees, notably Net Crypto and Web MIDI.
There has additionally been lively dialogue about other APIs that can profit from shifting to a standard mechanism for describing async operations. It seems, in every particular person case, History of the United States like this should not be such a big deal. The massive cause to spend months of my life on this downside, and to harass other very busy individuals to do the identical, is to me the core value of net requirements: after they're working effectively, they create a uniform surface space that describes a coherent platform.
We are the beneficiaries of this uniformity at the moment relating to events, and they are a major piece of the design language which DOM API authors can reliably use to assist describe bits of their design. Promises, like Events, are yet one more instrument in the field that DOM APIs authors can use, and thanks to sane constructors and the flexibility to subclass constructed into the design, it's possible for finish-consumer code to eventually put down the customized implementations of Promise-like things and simply depend on the platform to do what platforms should do: crypto-markets make low cost and simple what previously was widespread however expensive.
댓글목록
등록된 댓글이 없습니다.