Re: [directory-upload] Easier way to get files without complicated asynchronous traversal code (#26)

> That seems like sugar that a library could add.

I think we learned from IDB that that is not a great idea (i.e., we should not defer to libraries to most common cases).

Additionally, if you look at how much async bouncing needs to be done waiting for all the generated promises to settle (given lots of directories, including in the example in the spec), it seems like it could be more performant to just let the underlying implementation gather all the files and associated metadata. 

> Note that we went the iteration route because "smarter" primitives haven't been added to ES, like AsyncIterator (or Observable). When that happens, methods like enumerate() and enumerateDeep() would have provided the best blend of sugar and API.

I see. I'd still think we should target current ES6 feature set tho, with, as you say, an eye to the future where developers might be able to prollyfill to support the async iterators (e.g., through implementing the appropriate behavior through a JS provided symbol or whatever). 


---
Reply to this email directly or view it on GitHub:
https://github.com/WICG/directory-upload/issues/26#issuecomment-163666578

Received on Thursday, 10 December 2015 15:50:48 UTC