What version of JavaScript is available to JavaScript callouts in Apigee Edge?

Not applicable

I've searched and searched, but I can't seem to find anything in the Apigee documentation on the support version of javascript. Can anyone provide a link to the interpreter that parses and executes the js code? Is it node? if so what version? Is there a way for me to tell the current version?

Solved Solved
4 7 2,938
1 ACCEPTED SOLUTION

@John Wheeler , Welcome to Apigee Community.

Regarding versions,

Rhino JavaScript engine 1.7.7.1

Node.JS - Trireme 0.8.9

More info on Software versions used by Apigee you can find in docs here.

View solution in original post

7 REPLIES 7

@John Wheeler , Welcome to Apigee Community.

Regarding versions,

Rhino JavaScript engine 1.7.7.1

Node.JS - Trireme 0.8.9

More info on Software versions used by Apigee you can find in docs here.

Perfect! thx

Anytime 🙂 , Keep us posted moving forward if any.

Have these versions change any since this answer was posted?

I noticed the Javascript callout in Apigee doesn't support var or let declarations, but supports other ES6 features such as array.reduce/foreach.

I found this quite surprising, considering that the Rhino compatibility table mentions that let/const have been implemented for Rhino v1.7.7 (https://mozilla.github.io/rhino/compat/engines.html).

Is there a compatibility table that outlines the features of what both the Javascript callout engine and Hosted Target engines support? What version of Node is used to run Hosted Targets?

How good would it be if they used that Google engine, um... V8! 😉

You should check out Hosted Targets, it runs nodejs natively on Google App Engine

I agree with you, Jayden, that it would be really nice for the JS callout to support ES2016 or .. even ES9 features.

I looked into this a while ago. The JS callout depends on Rhino. After some investigation, I learned that some things:

  • The current implementation of the JS callout doesn't specify the language version to use with the Rhino JS Compiler. As such it gets "the default" from Rhino which is JS 1.6.
  • the JS 1.6 in Rhino also includes 1.6++ features such as const, object and array destructing, arrow functions, and some later methods on String and Array (foreach, reduce). As you pointed out.
  • The current Rhino (1.7.9) optionally provides JS language version 1.8, which would allow: let, function param destructuring, and typedarrays.
  • Rhino does not appear to support spread syntax, generators, promises, classes, default values for function parameters, and a few other ES2015/2016 things.

Bottom line, because the JS callout depends on Rhino, if update our code to request language version 1.8, we could get at most 2 or 3 new language features. I'm not sure how valuable that would be for people like yourself. Because the benefit is so limited, I've been reluctant to modify the JS callout to do this.

A slightly better solution would be to update Rhino to provide better support for later JS language features. So far the community is not signing up to extend Rhino in this way.

A really nifty idea is to integrate v8 directly. We haven't seriously investigated how we might do that. As Dane points out you can use v8 with App Engine now, and probably Cloud Run soon. That v8 process will be remote, but ... it's real v8.