Open guybedford opened 10 years ago
Exposing the execution of ES6 modules would also allow easy creation of post-execution hooks, which could be useful as well in future.
Just chiming in here. This is a pretty big scenario for me and my community. I'd really love to see something like this added to the spec.
An alternative approach would be to add a new hook here for post-instantiation.
Example:
post_instantiate_hook: function(name, imports, module) {
}
It should be trivial to add, and would allow full dependency traces, as well as module adjustments for module meta.
It seems the loader still doesn't expose an internal "link" method extracting the effective execute function and dependency list for an es6 source file.
If the loader does expose an internal "link" method, then it would be possible to easily write a tracer (eg https://github.com/guybedford/es6-tracer/blob/master/tracer.js#L16)
Otherwise any tracer needs to re-implement the parsing code.
Not a big deal, but making the dependency tree easily transparent allows for nicer build tool internals etc. running on a NodeJS server.
If there was anyway to expose the $GetDependencies function or something like that it would make things easier when we get there. I know it seems an edge case now, but would be useful.