-
Notifications
You must be signed in to change notification settings - Fork 3
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
Use data resources to store react assets #25
Conversation
…ype that was `Keyed` could generate a null pointer at runtime
… for props by extracting a variable
This was an attempt to get assets included as resources and them loading them in app like public void onModuleLoad()
{
final HTMLScriptElement script = (HTMLScriptElement) DomGlobal.document.createElement( "script" );
script.type = "text/javascript";
script.src = Resources.INSTANCE.reactDev().getSafeUri().asString();
script.onload = e -> {
loadReactDom();
return null;
};
DomGlobal.document.body.appendChild( script );
}
private void loadReactDom()
{
final HTMLScriptElement script = (HTMLScriptElement) DomGlobal.document.createElement( "script" );
script.type = "text/javascript";
script.src = DomResources.INSTANCE.reactDomDev().getSafeUri().asString();
script.onload = e -> {
startApp();
return null;
};
DomGlobal.document.body.appendChild( script );
}
private void startApp()
{
... The problem with this is that any react app will define classes that extend native types and these classes are defined prior to The only solution that seemed to work either involved writing a custom linker that loaded the react js before app is defined or better yet writing a linker that generated the host html. Both seemed more work than was currently justified at this stage with the imminent move to j2CL on the cards. |
No description provided.