• Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: L3 - Default L3 - Default
    • 7.16.0, 7.16.0-alpha3
    • None
    • engine
    • None

      AT

      • Add Graal.js script engine to the distros (CE and EE including Run) - do not add it as a transitive dependency to the core and Spring Boot Starter
      • Make Graal.js the default JS script engine in the engine
        • Fallback to whatever JS script engine is present if Graal.js is not available
        • Make the JS script engine configurable, so users can still choose anything else
      • Investigate incompatibilities with Nashorn
        • document unresolvable ones
        • try to provide a solution for solvable ones (e.g. directly or by configuration option or Nashorn compat mode)
        • candidates:
          • public method/attribute access only in Graal.js
          • loading external script files from JS with "load"
      • Test coverage
        • JS script tests default to Graal.js
        • add explicit Nashorn tests to ensure compatibility - exclude those on JDK15+

        This is the controller panel for Smart Panels app

            [CAM-13516] Add Graal.js support

            Tobias Metzke-Bernstein added a comment - - edited

            Unresolvable Incompatibilities

            1. referencing specific functions only works with full class names and without whitespaces
              • e.g. `java.lang.String` instead of `String`, so
                node["prop(String, String)"]("order", null);
                

                has to become

                node["prop(java.lang.String,java.lang.String)"]("order", null);
                
            1. only publicly accessible methods and attributes can be called from Graal.js, e.g. bean methods
              • Nashorn (and Groovy, Python) can also call private attributes

            Tobias Metzke-Bernstein added a comment - - edited Unresolvable Incompatibilities referencing specific functions only works with full class names and without whitespaces e.g. `java.lang.String` instead of `String`, so node[ "prop( String , String )" ]( "order" , null ); has to become node[ "prop(java.lang. String ,java.lang. String )" ]( "order" , null ); only publicly accessible methods and attributes can be called from Graal.js, e.g. bean methods Nashorn (and Groovy, Python) can also call private attributes

            Tobias Metzke-Bernstein added a comment - - edited

            Decision
            Edit: due to feedback on this topic, we will include this via engine configuration option:
            We will not directly add support for

            loading external script files from JS with "load"

            Reasoning

            • We don't know yet if this is used by a lot of people
            • We don't want to add yet another JS script engine config option without evidence that people need this
            • Users can add their own script engine resolver with CAM-13517 that configures the Graal.js engine to do this
            • Users should be able to do this by enabling Nashorn compat mode via command line
            • Users can still use Nashorn if they rely on this and don't want to/cannot configure Graal.js on their own

            Tobias Metzke-Bernstein added a comment - - edited Decision Edit: due to feedback on this topic, we will include this via engine configuration option: We will not directly add support for loading external script files from JS with "load" Reasoning We don't know yet if this is used by a lot of people We don't want to add yet another JS script engine config option without evidence that people need this Users can add their own script engine resolver with CAM-13517 that configures the Graal.js engine to do this Users should be able to do this by enabling Nashorn compat mode via command line Users can still use Nashorn if they rely on this and don't want to/cannot configure Graal.js on their own

              Unassigned Unassigned
              tobias.metzke Tobias Metzke-Bernstein
              Tobias Metzke-Bernstein Tobias Metzke-Bernstein
              Nikola Koevski Nikola Koevski
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: