tc39 / proposal-observable

Observables for ECMAScript
https://tc39.github.io/proposal-observable/
3.06k stars 90 forks source link

Is there any update? #214

Open codesculpture opened 1 year ago

duduc commented 1 year ago

up

hax commented 1 year ago

It seems this proposal do not have active champions, and never have updates in TC39 meetings in last 5 years.

codesculpture commented 1 year ago

The language can be considered to be standard if it contains these type of essential classes which are very useful🙂

benjamingr commented 1 year ago

This actually has updates, it's moved to standardize by Google and Ben at https://github.com/domfarolino/observable seeking standardization as part of the web platform and not the language.

ljharb commented 1 year ago

I continue to encourage them to bring it to TC39; imo that's where it belongs.

codesculpture commented 1 year ago

This actually has updates, it's moved to standardize by Google and Ben at https://github.com/domfarolino/observable seeking standardization as part of the web platform and not the language.

Am just wondering why it cant be language primitive rather than being web platform specific. Since this is highly related to language specific (i guess). Literally i see that asynchronous classes are the future (now, it was playing major role at library-level only). So in my opinion, it needs to be language primitive

benjamingr commented 1 year ago

Am just wondering why it cant be language primitive rather than being web platform specific.

@codesculpture those two are not exclusive, also https://github.com/domfarolino/observable/issues/30#issuecomment-1656724203

ljharb commented 1 year ago

If it already exists in the web, it won’t likely reach consensus for being in the language - promises only landed in one spec for that reason.

codesculpture commented 1 year ago

Am just wondering why it cant be language primitive rather than being web platform specific.

@codesculpture those two are not exclusive, also https://github.com/domfarolino/observable/issues/30#issuecomment-165672420

We are having event emitters in node.js, we can build something better than that using observables, i cant say any existing stuffs which we can replace by observable in node for now. But it totally will be helpful i would say

codesculpture commented 1 year ago

If it already exists in the web, it won’t likely reach consensus for being in the language - promises only landed in one spec for that reason.

Can u elaborate this, please?

ljharb commented 1 year ago

What I mean is, if the web has a thing, there's not going to be much appetite to add it to the language.

codesculpture commented 1 year ago

Can we expect this to happen or is there anything other we can do it to happen

benjamingr commented 1 year ago

For what it's worth promises landed in a WHATWG spec first and then moved to JavaScrip via TC39 (promises are kind of complicate since both specs were based on a third userland spec). So if anything this makes an argument to add it to both since both the language and the platform have APIs that need this sort of thing.

Both can also consume it from each other.

It's been ±10 years so recollection is kind of vague.

benjamingr commented 1 year ago

Also:

Can we expect this to happen or is there anything other we can do it to happen

Sure there is a lot of stuff to do observables have been blocked mostly on actual work done. You should reach out to @benlesh with a clear email of what you know and how much time you commit to spend on this.

codesculpture commented 1 year ago

Seems scary, isnt there any possible way that this can be happen quickly than a decade. I know my question is dumb. But whatever

benjamingr commented 1 year ago

@codesculpture observables and most stuff have always been blocked on someone either funding people to work on it or doing the work themselves.

If you're willing to do either it can progress pretty quickly. Otherwise we can mostly wait.

codesculpture commented 1 year ago

I mean i was really interested in bringing this in, but am an amateur (under grad and still studying). But i can put my all time to do this at whatever cost. If u think i can help, can u just navigate me how i can start please?

benjamingr commented 1 year ago

Seems scary, isnt there any possible way that this can be happen quickly than a decade.

Sure, nothing in the spec is rocket science - you would email @benlesh with the following email:

Subject: Helping with Observables in the web

Contents:

Hey, my name is XXX. I'm willing to dedicate XXX hours a week for XXX weeks in order to help make native observables a reality. 

I know JavaScript and to do YYY. I've never adde something to the language before so please scope my work accordingly.

Thanks,
Your Name

And I'm sure he can guide you from there. If he doesn't answer let me know and I'll ping him but he's generally a nice guy.

codesculpture commented 1 year ago

Seems scary, isnt there any possible way that this can be happen quickly than a decade.

Sure, nothing in the spec is rocket science - you would email @benlesh with the following email:

Subject: Helping with Observables in the web

Contents:

Hey, my name is XXX. I'm willing to dedicate XXX hours a week for XXX weeks in order to help make native observables a reality. 

I know JavaScript and to do YYY. I've never adde something to the language before so please scope my work accordingly.

Thanks,
Your Name

And I'm sure he can guide you from there. If he doesn't answer let me know and I'll ping him but he's generally a nice guy.

Can i get his email?

benjamingr commented 1 year ago

Sure, let me ask him. You can also email me at benjamingr@gmail.com and I'll forward it to him

codesculpture commented 1 year ago

Hey i sent u the email and happy to see people like you who are trying to help others. Very thanks @benjamingr

benlesh commented 1 year ago

FWIW: I'm not an owner of this repository. So I'm not sure what I could provide someone who wanted to work in the TC39 space. My understanding is that this proposal would effectively require sponsorship from a member company, ergo $$$ and time (which is also $$$).

ljharb commented 1 year ago

@benlesh it needs a champion, for which Google employees are eligible like @domfarolino.

domfarolino commented 1 year ago

Given the precedent of EventTarget and AbortController in WHATWG DOM, and that Observables are highly motivated by web platform use cases that use those primitives (that exist in the Web platform), I think WHATWG DOM seems like a good place to eventually standardize Observables, personally.

ljharb commented 1 year ago

@domfarolino there's no doubt it'd be useful in the DOM, but completing the fourth quadrant of GTOR seems foundational enough and much broader than the web.

benlesh commented 1 year ago

why-not-both

ljharb commented 1 year ago

@benlesh i agree! the best way to get both, tho, is to land it in the language first :-)

domfarolino commented 1 year ago

I'm a little confused what "getting both" means. You can only have Observables in one spec, right? If it's in WHATWG DOM, there's nothing stopping TC39 standardization if the right TC39 groundwork was eventually laid (I'm imagining some event emitting infrastructure and token-based cancellation primitives introduced at that layer). But all that groundwork has already been laid in the web platform, and TC39 seems to not have an issue with that, right?

ljharb commented 1 year ago

The reverse is true - once it’s in WHATWG, the chances of it landing in tc39 approach zero.

codesculpture commented 1 year ago

Hey guys, i see that whatwg has specific repo for streams (Readable Streams, Writable Stream, Transform Stream) https://github.com/whatwg/streams

Is that possible that we can propose this "Observable" there. Sorry if my question is dumb. But just want to know if that whatwg's stream repo help this proposal to ship fast.

domfarolino commented 1 year ago

@codesculpture Observables is currently being proposed in https://github.com/domfarolino/observable and will be moved to https://github.com/WICG soon. The goal is to standardize it in the DOM Standard ultimately, so I don't think there's a need to integrate with the Streams Standard.

codesculpture commented 1 year ago

@domfarolino So, do u have any future plan to move this (https://github.com/domfarolino/observable) proposal to tc39 from whatwg (maybe after this accepted)

ljharb commented 1 year ago

@codesculpture if it depends on AbortSignal (which, ftr, I haven't been convinced is necessary) then it couldn't move to tc39 until AbortSignal exists in the language, which it's unlikely to ever do (due to it being shipped in browsers without going through tc39 first)

domfarolino commented 1 year ago

@domfarolino So, do u have any future plan to move this (https://github.com/domfarolino/observable) proposal to tc39 from whatwg (maybe after this accepted)

No. We are planning to standardize it in the WHATWG as I said earlier, after moving to WICG as an intermediate step. I'm not going to rule out TC39 ever adopting Observables in the future, if they had the same semantics as in the web platform and wanted to move it there, but that'd likely benefit from some kind of cancelation primitive and event target interface, which ECMAScript doesn't have.