[w3c/FileAPI] Async createObjectURL (#84)

`createObjectURL` is unable to generate circular dependencies for ECMAScript Modules due to URLs requiring their content be given at time of creation. This leads to a problem when trying to recreate this file using `createObjectURL`:

```js
// a.mjs
import './a.mjs';
```

It seems that there is no way to generate the URL for the import statement since it is returned from `createObjectURL`.

I would propose there be an async form or controller for this. I am not tied to any given API but can imagine something like:

```js
// bikeshed method name, doesn't matter to me
const url = URL.createAsyncURL((async () => {
  await; // make sure `url` exists by waiting a tick
  return new Blob([`import ${url};`], {type: 'text/javascript'});
})());
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/FileAPI/issues/84

Received on Monday, 16 October 2017 18:34:08 UTC