W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2015

Exposing structured clone as an API?

From: Ted Mielczarek <ted@mozilla.com>
Date: Thu, 23 Apr 2015 18:02:50 -0400
Message-ID: <CACL_6fS4jbOxth+xhKukicX2p1_qCoo=8fAGtL9LHtyjarXK7w@mail.gmail.com>
To: public-webapps <public-webapps@w3.org>
Cc: kg@luminance.org
Has anyone ever proposed exposing the structured clone algorithm directly
as an API? Katelyn Gadd was musing about fast deep copy in JS on Twitter,
and I proposed a hack to use postMessage to do so[1], which works but it's
a little roundabout. Since structured clone is a primitive that the web
platform is built on it seems like a primitive that ought to be exposed. I
know this exists in other languages (Python has copy.deepcopy[2]) and
there's an npm "deepcopy" module[3] with lots of downloads so this is
clearly something people use.


1. https://twitter.com/TedMielczarek/status/591315580277391360
2. https://docs.python.org/2/library/copy.html#copy.deepcopy
3. https://www.npmjs.com/package/deepcopy
Received on Thursday, 23 April 2015 22:03:18 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:27:31 UTC