Hi Malaka, If you drop the support for E4X when moving to Nashorn, what happens to the customers who want to migrate their artefacts from an old ESB version (say 4.8.1) to the new version?
Re-writting the entire JS artefacts will not be a possibility for many. So you need to have a serious think about how to provide a safe and pain free migration path for old E4X based code to the new engine. Thanks and Regards, Harshana -- Harshana Eranga Martin Committer - Eclipse ECF: http://www.eclipse.org/ecf/ Blog: http://harshana05.blogspot.com Profile: https://www.google.com/profiles/harshana05 On 19 July 2017 at 21:14, Malaka Gangananda <[email protected]> wrote: > Hi All, > > Current script mediator use Rhino as its JavaScript engine and we are in > the process of upgrading the script mediator to use new Nashorn engine. So > we will be providing the capability of using Rhino as javascript engine for > java 7 users and Nashorn for java 8 users in script mediator. But in the > process we have found some issues and solved them. Such as when trying to > set Json payload the existing Rhino engine will use its native objects to > pass Json payload so in existing script mediator it use different > serialization techniques for each Rhino native object type. But in Nashorn > the passed object will be always ScriptObjectMirror type. We have overcome > this issue by serializing these objects using serialization functionality > of Nashorn native "JSON" object. So when handling the Json payloads the > used engine will not be an issue. But the main issue was usage of E4X xml > objects when handling xml payloads with Rhino engine. Because as stated > in[1] E4X is deprecated and it does not supported by Nashorn engine. To > overcome this when using Nashorn, DOMparser can be used to parse xml > strings rather than using xml objects. But then the users who are using > script mediator with new Nashorn engine will not be able to use xml objects > in javascript but they will be able to use setPayloadXML and getPayloadXML > methods in script mediator by using string representations of xml. So the > decision we need to make is whether to use existing mediator with Nashorn > engine support but without using E4X(which is deprecated but still using > Rhino engine it will be supported) or writing new mediator separately for > javascript with Nashorn engine support. > > > [1] https://developer.mozilla.org/en-US/docs/Archive/Web/E4X/ > Processing_XML_with_E4X > > Thanks, > -- > Malaka. > -- > Malaka Gangananda - Software Engineer | WSO2 > Email : [email protected] > Mobile : +94713564340 <+94%2071%20356%204340> > Web : http://wso2.com > <http://wso2.com/signature> > > _______________________________________________ > Architecture mailing list > [email protected] > https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture > >
_______________________________________________ Architecture mailing list [email protected] https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture
