Use dslomov-chromium/ecmascript-structured-clone instead.
Unfortunately I already created an issue that has lots of useful discussion, so I shouldn't delete it. But don't keep using it.
Don't use this repo; use dslomov-chromium/ecmascript-structured-clone instead
Home Page: dslomov-chromium/ecmascript-structured-clone
Use dslomov-chromium/ecmascript-structured-clone instead.
Unfortunately I already created an issue that has lots of useful discussion, so I shouldn't delete it. But don't keep using it.
annevk> Domenic_: where should we track structured cloning for promises?
14:10:07 <annevk> Domenic_: as part of https://github.com/dslomov-chromium/ecmascript-structured-clone maybe?
14:48:45 <sicking> annevk, Domenic_: So the idea is a Promise subclass which when you resolve(x) it would structured clone x?
14:49:40 <sicking> annevk, Domenic_: Oh, or would each then-handler (sorry, i forget the correct vocabulary) receive a separate structured clone of 'x'?
14:54:13 <sicking> oh oh
14:54:29 <sicking> such a Promise would then itself be structured-clonable
14:54:39 <sicking> i.e. you could pass such a Promise to a worker
14:54:48 <sicking> even before it is resolved
14:54:57 <sicking> and when it is resolved the value appears in the worker
14:55:02 <sicking> that would be awesome!
14:55:25 <sicking> a pain to implement, but a delight to use
14:55:56 <sicking> and not any harder to implement than transferrable streams will be
14:56:53 <annevk> yeah, you want to clone the promise
14:56:57 <annevk> or transfer it maybe
14:57:09 <sicking> cloning is enough
14:57:32 <sicking> we could do the transfer for the same reason that we could do transfers of JS objects though
15:00:29 <sicking> something that would be interesting though is a Promise which you could pass to another thread, and when you resolve the promise, the value is *transferred* (rather than cloned) to the other thread
15:02:11 <sicking> the tricky thing with that is what happens if the Promise has multiple registered then-handlers. That would not really work
15:02:25 <sicking> actually... it kind'a would
15:03:13 <annevk> if you transfer the promise it could reject in the original thread
15:03:20 <sicking> exactly
15:13:11 <sicking> so far has TC39 gotten in enabling structured clones to be extensible?
15:16:24 <annevk> i don't think they have yet
15:16:28 <annevk> but people have ideas apparently
15:16:45 <annevk> https://github.com/dslomov-chromium/ecmascript-structured-clone is what I wrote with dslomov
15:16:52 <annevk> but that's mostly what HTML had
15:16:55 <annevk> has*
15:20:22 <sicking> oh, and that doesn't make it extensible
15:26:23 <annevk> right
15:26:30 <annevk> that was going to be a later step
15:26:38 <annevk> first get TC39 to embrace the concept in the first place
15:27:13 <annevk> JavaScript is bigger than the browser and therefore things we do are not automatically accepted...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.