Path to ES6, ES7?

corbettbrasing1
Mega Guru

Is there current roadmap to upgrade the platform to ES6, or 7?   I know Helsinki upgraded it to ES5.

56 REPLIES 56

Simon:

 

Thanks!  Nary a peep.  Definitely not in London.  I have not yet heard about Madrid or New York.

 

Steven.

Howard Elton
Tera Contributor

Although Chuck said to log an enhancement it's not really that simple.  This is a matter of architecture rather than a simple functional change.  Unfortunately ServiceNow uses the ageing Mozilla Rhino server side JavaScript engine. Unlike Node.js (another server side JavaScript engine), it has not been keeping up with modern  ECMAScript standards.  On top of that, London is still using and old version of Rhino (v1.7 R5) which is is even further behind in terms of ECMAScript compatibility.  v1.7 R5 implements only about 9% of the ECMAScript 2015 (ES6) standard, and even the latest version v1.7.10 only covers 22%. 

As the name suggests ECMAscript 2015 was released back in 2015, and since then we have had new standards:

  • ECMAscript 2016  (0% compatible on all version of Rhino)
  • ECMAscript 2017  (14% compatible on all version of Rhino)
  • ECMAscript 2018  (0% compatible on all version of Rhino)

Basically, the dependency on the Rhino engine, which is not being kept up to date, means that ServiceNow is getting further behind as time passes. Modern coders who are taught the modern standards, will eventually get very frustrated when they have to downgrade their coding style by a generation (somebody say "Jelly script"?).

Even moving to v1.7.10 is a massive undertaking in terms of testing for ServiceNow. I only recall one previous change to the Rhino version since I have been using ServiceNow.

In a nutshell, it's not going to happen any time soon unless they move to an entirely different JavaScript engine (which sounds like a nightmare). So for those of us who want to use advanced asynchronous programming techniques such as Promises and Await, forget it and do it the old way I am afraid.

Rhino compatibility chart: HERE

Thank you for a great post Howard. I have had many of the same thoughts. Since this is such a core topic to the platform, maybe they need to consider creating a new platform and a strategy for migrating the customer data. I would think if they don't take an approach similar to this, the complexity for most customers would be too much to support. Thanks again.

This is what will eventually sink SN. too big to upgrade.

Transpiling. Native feature parity for Rhino is not a great concern if you discard features that are inherently incompatible with the SN platform to start with such as async/await. A subset of ES2015 would be a tremendous lift to the community; Discarding an upgrade path through readily available industry-standard transpilers because you can't get native Rhino implementation is not a good point of view.

For reference I've built solutions for SN on both TypeScript and Haxe of significant complexity through transpiling down to ES5. It is a completely viable and relatively straight forward path that would help the dev community in a massive way.