Closed closedsum closed 5 months ago
Are you using a JavaScript instance component or the standard one? The instance variant does expose by default unless it's specified. Standard component should still work as in the past.
Actually, Before I manually created the Isolate and Context and it seemed like I had no problems. This was in 5.1 (and I had been using this technique with no problem even in the 4.20ish days I think)
My previous method (worked in 5.1)
void FLibrary::SetupIsolateAndContext(UObject Owner, UObject& JavascriptIsolate, UObject*& JavascriptContext, const bool& IsEditor)
{
auto Isolate = NewObject
JavascriptIsolate = Isolate; JavascriptContext = ContextObject;
ContextObject->Expose("Root", Owner); }
I'm guessing this is no longer the right way for 5.3+?
Okay, So, I just tried making dummy Blueprint Actor with a both a JavaScript Component and Instance.
Example .js
function main() { console.log("main(): test");
var Test = null;
var Actor = Actor.C(Test);
}
main();
Update 1:
Update 2:
Would you say it would be better to use the Javascript Component or Instance? In terms of what is being maintained more going forward.
This fork, which is opinionated, focuses on instances to allow for precise exposure control (+ some perf things like JavaScript multithreading). You may want to use the upstream plugin if you want standard API, I try to make best effort updates to keep upstream API, but as you can see some things may break over time.
Makes sense! Thanks for the reply and contribution / maintenance to the plugin! I love using it :)
Hey, I got the latest Release for UnrealJS (https://github.com/getnamo/UnrealJs/releases/tag/v0.9.1) and it seems that the Globals.js file is no longer generated (Content/Scripts/typings/Globals.js)? Not sure if this is the root of issue, but it seems now none of my previous .js files run correctly.
New issues
Any thoughts?
Edit: Sorry I should add better repro steps