Peeling out import() · Issue #149 · whatwg/loader (original) (raw)

Hi all,

We're getting lots of interest from multiple corners in providing a way to add async loading to the module support specced for browsers. I was wondering if it'd be OK if I started work on a TC39-side import() spec? It would absorb some of the responsibilities of this repo, so I wanted to check here first.

The basic ideas I have so far:

I think this would be a pretty small spec. It would, of course, have room for expansion in the future to support all the loader hooks, e.g. Loader could define a HostFetchModule for host environments that implement the Loader spec that goes through all the hooks, similar to what it does with HostResolveImportedModule today. But in the meantime it would give browsers and Node something they could implement.

Let me know what you think! If you're OK with me taking on this effort, I'd plan to have some spec text ready in time for the next TC39.

/cc @bmeck