These are chat archives for martinheidegger/es6modules-nodejs

10th
Jun 2016
Yaw Etse
@yawetse
Jun 10 2016 14:44
Hi @martinheidegger, first of all, great write up of the the current state of es6 modules
has the use of an asynchronous implementation of require been explored as an alternative to e6 modules?
a la something like this: http://stackoverflow.com/a/20528452
Martin Heidegger
@martinheidegger
Jun 10 2016 15:29
I think it was certainly explored. And I can faintly remember a discussion somewhere.
I do know that the discussion is flaming again with the introduction of async/await which would break that logic.
Martin Heidegger
@martinheidegger
Jun 10 2016 15:58
My assumption is that it simply would break too many projects if the packages were to be async suddenly.
Yaw Etse
@yawetse
Jun 10 2016 16:34
Got it, I was actually suggesting / wondering about keeping the existing require logic in place, and add an additional module loader that was async, instead of a replacement. That way by default, require works as it currently does - synchronously and requireAsync would return a callback or a promise
Martin Heidegger
@martinheidegger
Jun 10 2016 16:47
@yawetse One of the big problem with solutions like this is that they affect the whole infrastructure.
If you write a module that is async it can hardly be assumed sync.