The idea is simple:
1) Source generate a JSExport thunk for the entry point with a well-known name.
2) Invoke that JSExport - the existing host code already does this.
The complications are in the finer details. For example, this change utilizes a hidden file injected into user compilations to achieve the JSExport bit, to simplify the code generation. Even with that, due to C# rules, we cannot generate wrappers for all possible entry point definitions.
The idea is simple: 1) Source generate a JSExport thunk for the entry point with a well-known name. 2) Invoke that JSExport - the existing host code already does this.
The complications are in the finer details. For example, this change utilizes a hidden file injected into user compilations to achieve the JSExport bit, to simplify the code generation. Even with that, due to C# rules, we cannot generate wrappers for all possible entry point definitions.