-
Notifications
You must be signed in to change notification settings - Fork 76
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
Add GraalJS as Javascript engine in F!F, next to J2V8 #6834
Conversation
Arguments.of(JavaScriptEngines.GRAALJS, "returnObject", "{answer: 42}"), // Don't understand why this is different in GraalJS | ||
Arguments.of(JavaScriptEngines.GRAALJS, "returnArray", "(3)[1, 3, 5]") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
De bovenste is goed, het is fijn dat hij nu Json responses terug kan geven. Maar de array had ik anders verwacht...
Zou het mogelijk zijn die (3)
er van af te snoepen en iets terug te geven waar de eindgebruiker wat meer mee kan?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ik vraag me af of die (3)
gerelateerd is aan de lengte van de array?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ja, dat is hij zeker. Ik heb ook de toString gevonden in de Javascript engine die dit doet. Ik ben bezig geweest met type mappers om te zorgen dat hij zich anders gedraagt. Helaas werd dat nog niet goed opgepakt.
If would prefer a more useable response (without the
If you can verify that it works on your machine (as in, does the FlowGenerator work with GraalJS, and are the flows visible in the console).
You most certainly could! I don't think it's wise to duplicate all the tests, but perhaps changing a few would be a good start! |
Tried to address 2 things: type issue & temp dir issue while starting in Tomcat & Docker. No solution yet. Refs: |
core/src/main/java/org/frankframework/senders/JavascriptSender.java
Outdated
Show resolved
Hide resolved
….java Co-authored-by: Erik <[email protected]>
* Fixes strange issue with GraalJS and illegal access in /home/tomcat
It seems that the |
public void registerCallback(final ISender sender, final PipeLineSession session) { | ||
scriptEngine.put(sender.getName(), (JavaCallback) s -> { | ||
try { | ||
Message msg = Message.asMessage(s[0]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moet deze msg
niet ook worden gesloten in een try-with-resources?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Goed punt, ik heb het zojuist geprobeerd. Echter blijft de promiseResult in org.frankframework.senders.JavascriptSenderCallbackTest#promise
steeds leeg en klopt het resultaat niet. Ik begrijp niet helemaal waarom dat is, maar iig krijg ik het niet werkend. Het is ook niet erg dat hij geen close krijgt, omdat het request toch van het type String is.
# Conflicts: # core/src/test/java/org/frankframework/senders/JavascriptSenderCallbackTest.java # core/src/test/java/org/frankframework/senders/JavascriptSenderTest.java
Quality Gate passedIssues Measures |
Remark: the unit test
JavascriptSenderTest.testWithJavaScriptReturningAnObject
has different results with GraalJS. The return types are different and uses internal GraalJS objects, which are not always accessible.