Open theolivenbaum opened 2 years ago
Currently h5 will emit the metadata file used for reflection after the project file:
<head> <script src="h5.js" defer></script> <script src="h5.meta.js" defer></script> <script src="newtonsoft.json.js" defer></script> <script src="app.js" defer></script> <script src="app.meta.js" defer></script> </head>
But this means if you use reflection on the app entry point:
console.log(JsonConvert.SerializeObject(new MyClass()));
This fails as the metadata file app.meta.js is not yet loaded. Adding a timeout to let the file load works fine.
app.meta.js
Need to investigate if we can invert the output order (i.e. load app.meta.js before app.js). On a quick test it works fine.
The fix might be as simple as re-ordering metadata and javascript files here
Currently h5 will emit the metadata file used for reflection after the project file:
But this means if you use reflection on the app entry point:
This fails as the metadata file
app.meta.js
is not yet loaded. Adding a timeout to let the file load works fine.Need to investigate if we can invert the output order (i.e. load app.meta.js before app.js). On a quick test it works fine.
The fix might be as simple as re-ordering metadata and javascript files here