Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

poll is not exported from utils/index.ts #512

Closed
cellog opened this issue May 10, 2019 · 7 comments
Closed

poll is not exported from utils/index.ts #512

cellog opened this issue May 10, 2019 · 7 comments
Labels
discussion Questions, feedback and general information.

Comments

@cellog
Copy link

cellog commented May 10, 2019

Because of this, #511 cannot be fixed without forking the project.

@ricmoo
Copy link
Member

ricmoo commented May 10, 2019

I should probably add poll, and think I have in v5, but will check. It is generally useful. :)

I don't think you should need to fork the project though, you can always require("ethers/utils/web").poll...

@ricmoo ricmoo added the discussion Questions, feedback and general information. label May 10, 2019
@cellog
Copy link
Author

cellog commented May 10, 2019

I won't need to fork it :)

I need tree-shaking (reduces a script from 2.7MB to 355k), and so in that context, the only export available is { ethers }

@ricmoo
Copy link
Member

ricmoo commented May 10, 2019

That is coming in the future too, but is quite hard to support in the current JavaScript landscape, since to support ES3 through ES6 and also browser + Node + others, the tooling is weird. But I have some ideas I'm working on. :)

2.7MB is huge, though? The ethers.js library, under 300kb uncompressed (and about 82kb over-the-wire).

But v5 can partially solve this as well, since everything is broken out into packages, so you can pick and choose what you need, and with smaller packages, the browser package.json field is more precise.

@cellog
Copy link
Author

cellog commented May 10, 2019

oh yes! the majority of the 2.7MB comes from the json of 3 deployed contracts we distribute, which is why I need tree-shaking :).

Thanks for everything! When will v5 source be in a branch here on github? (not to pressure you, I just want to see it)

@ricmoo
Copy link
Member

ricmoo commented May 10, 2019

Have you tried using Human-Readable ABI? It is generally significantly more compact, and results in easier to read code. :)

In v5, the libraries are exposed to convert between JSON ABI and Human-Readable ABI can help automate a lot of this.

:)

@cellog
Copy link
Author

cellog commented May 10, 2019

https://github.com/unlock-protocol/unlock/blob/master/unlock-js/scripts/compressAbi.js
https://github.com/unlock-protocol/unlock/blob/master/unlock-js/src/abis.js

yep :)

I look forward to converting my multi-line compressAbi.js into a 1-liner with your v5 libraries

@ricmoo
Copy link
Member

ricmoo commented Jun 4, 2019

Poll is now exported in 4.0.29. Let me know if you have any problems.

Thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Questions, feedback and general information.
Projects
None yet
Development

No branches or pull requests

2 participants