-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Related to issue and solution:
Starting Notes
@lobau @michaelthatsit - it seems to work all fine if we have users define things in the header after the <script src=mrjs> tag - it seems the reason for the issue was:
- even though we can do async etc of
mrjsloading in header withmrfooin a script after<mr-app>is created, theonloadfunction is needed as part of <script src=mrjs> to connectmr-footo that part of the loading before any of the tag elements are includedThe Cause
that is, this is what was causing the issue
<header> <script src="./mr.js"></script> </header> <body> <mr-app> ... <mr-foo>...</mr-foo> ... </mr-app> <script> ... class MRFoo extends MREntity { ... } ... </script> </body>so the
<mr-foo>tag would be hit since it's not on async or defer, > even if the import script formrjsand the construction script for >MRFoohavedeferin their tag.doing the
onloadfor<script src="./mr.js" onload="constructMRFoo()"></script>(that was noted in the previous comment) works just because it tiesMRFoo's implementation timing tomrjs's timing before the rest of the body gets fully filled out (even though the body is already fully read)The Fix
to not require that, we just need to do the following to make sure the
<mr-foo>html element inside<mr-app>is happy just like everything else:<header> <script src="./mr.js"></script> <script> ... class MRFoo extends MREntity { ... } ... </script> </header> <body> <mr-app> ... <mr-foo>...</mr-foo> ... </mr-app> </body>
Originally posted by @hanbollar in Volumetrics-io/mrjs#619 (comment)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status