Closed
Description
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
:
// 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:
// 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'});
})());
Metadata
Metadata
Assignees
Labels
No labels