tc39 / proposal-dynamic-import

import() proposal for JavaScript
https://tc39.github.io/proposal-dynamic-import/
MIT License
1.87k stars 47 forks source link

Needs cancellation #42

Closed benlesh closed 7 years ago

benlesh commented 7 years ago

The main use case I can think of for this is an instance where a component is dynamically added to a view, (classic framework route changes, for example) and the user then does something to cause the component to be removed (hits another route maybe) before the module is done arriving over the network. Ideally, we'd be able to prevent the script from being parsed if we no longer care about it anymore.

Sorry to pick at a wound. But I'm hoping you'll track this. I think import should have cancellation, (a promise is fine, just as long as we can cancel it somehow).

domenic commented 7 years ago

Cancelation is indeed an interesting thing for someone to work on. It's not part of this proposal, though, so I'll close this issue. If you're interested in making your own TC39 proposal, there's the whole stage process to go through.

benlesh commented 7 years ago

If you're interested in making your own TC39 proposal

No way... haha. Too scared. :)

Brooooooklyn commented 7 years ago

I'm wondering why

cancelation is not part of this proposal

It's a part of lifecycle when you want to request some resources.