sindresorhus/pify

Return ES2015 Proxy object #29

schnittstabil posted onGitHub

ECMAScript6 Proxies are currently not available on node, therefore this issue is a reminder for future versions.

pify(obj) should return an ECMAScript6 Proxy object, forwarding almost all operations to obj, and promisifying only some functions, thus we almost surely get rid of most non-enumerable and inheritance issues.


@schnittstabil Interested in exploring this?

I'm requiring Node.js 4 in the next version, so we can safely use Proxy then.

posted by sindresorhus over 8 years ago

At least v4.5.0 (LTS) and v5.12.0 don't support Proxies :cry:

posted by schnittstabil over 8 years ago

Oh no. I was sure Proxy was in Node.js 4 for some reason...

posted by sindresorhus over 8 years ago

@sindresorhus If you'd like to give me access rights, I'll create a proxy-branch and push some v6 code for further usage…

posted by schnittstabil over 8 years ago

Done :)

posted by sindresorhus over 8 years ago

Yes, good idea. Can at least explore it now. There might be some performance issues using Proxies.

posted by sindresorhus over 8 years ago

There might be some performance issues using Proxies.

I've experienced the same issue - solved it by introducing a cache: https://github.com/sindresorhus/pify/blob/proxy/index.js#L44 :bowtie:

posted by schnittstabil over 8 years ago

@schnittstabil Nice! Already looks very good. I commented some quick feedback on the commit, but haven't tried it out yet. When that's resolved, can you open a PR? Would make it easier to review.

posted by sindresorhus over 8 years ago

Yes but why? The code doesn't seem much/any shorter/simpler/faster than the regular version.

posted by bfred-it about 7 years ago

@bfred-it Some things will just work compared to now, like ES6 classes, this binding, etc.

posted by sindresorhus about 7 years ago

Anyone wants to step in and finish https://github.com/sindresorhus/pify/pull/32? Including handle my review comments. I'll put a bounty on this shortly. I think it's better now to just have the proxy interface instead of both. Proxy is pretty optimized in newer Node.js versions. This task includes adding tests to handle all the things mentioned in the open issues too.

posted by sindresorhus about 6 years ago

@issuehunt has funded $70.00 to this issue.


posted by IssueHuntBot about 6 years ago

I'll take it.

posted by SamVerschueren about 6 years ago

@sindresorhus has rewarded $63.00 to @frangio. See it on IssueHunt

  • :moneybag: Total deposit: $70.00
  • :tada: Repository reward(0%): $0.00
  • :wrench: Service fee(10%): $7.00
posted by issuehunt-app[bot] about 5 years ago

Fund this Issue

$70.00
Rewarded

Rewarded pull request

Recent activities

frangio was rewarded by sindresorhus for sindresorhus/pify# 29
about 5 years ago
frangio submitted an output to  sindresorhus/ pify# 29
almost 6 years ago