| 03:42 | <Jack Works> | there are 2 things in the language have this property, export function and export var. |
| 03:42 | <Jack Works> | I can see |
| 03:49 | <Jack Works> | having two stage initialization for virtual modules, just like systemjs
becomes
|
| 03:50 | <Jack Works> | but the problem is, it is allowing the virtual module to run some arbitrary code before the evaluation stage |
| 03:59 | <guybedford> | That's correct about the emulation. But SystemJS has very different contraints of course, and yes likely doesn't fit this model. If needing this level of parity you might be better off just using a static record from a string source to do the emulation I think, then passing bindings through import.meta or custom imports? |
| 04:02 | <Jack Works> | I'm considering (and my use case need) an eval-free version of downlevel compiling module blocks, so I hope the Virtual Module can do the full emulation |
| 04:06 | <Kris Kowal> | What if a is rewritten to env.a at every mention? |
| 04:07 | <Jack Works> | What if |
| 04:07 | <Jack Works> | Consider these two modules compiled into Virtual module:
|
| 04:11 | <Jack Works> | |
| 05:08 | <Jack Works> | I compared it with CommonJS (because the code above works after being compiled into CommonJS). |
| 05:10 | <Jack Works> |
But this is problematic because of then-able |
| 05:13 | <Jack Works> | So CommonJS behave more like this. They also have a "pre-evaluation" to setup those bindings (before and after
|
| 07:04 | <Jack Works> | I can think of some way to alleviate this problem, to make
Construct all assets => Link stage => Pre-evaluation (run all |