Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if we can invert the order of metadata loading #58

Open
theolivenbaum opened this issue Nov 12, 2021 · 0 comments
Open

Check if we can invert the order of metadata loading #58

theolivenbaum opened this issue Nov 12, 2021 · 0 comments

Comments

@theolivenbaum
Copy link
Collaborator

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.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant