Modern JavaScript (ES6, ES7) support in ServiceStudio
1217
Views
22
Comments
On our RadarOn our Radar
Frontend (App Interfaces)

Hello All,


JavaScript has had ES6 and ES7 syntax since a couple of years. The new syntax provides some good features like lambda syntax, the 'let' keyword, the 'const' keyword, template literals etc.

While some old browsers do not support all of the syntax, there are libraries like 'babel.js' (https://babeljs.io/) which transform modern JS to ES5 (the usual JS syntax).

It would be great if the OutSystems product allowed using modern JS directly in ServiceStudio.

OutSystems can integrate the babel.js within the platform - so that it can convert any modern JS syntax to ES5 (older JS when required for old browsers, already most modern browsers do support ES6 , but not all..).

Advantages:

1. Developer productivity with modern JS will be very good. Many forge components rely on JS and JS libraries and having support for modern JS will be great.

2. Modern JS is helpful for writing easier to read and maintainable JS code.

3. On the mobile front in OutSystems - apache cordova for the mobile plugins is JS based - so supporting modern JS would be a win over there too.

2014-02-07 17-02-43
Vasco Pessanha
Changed the category to
Frontend

Hi Chetan,

I'm not sure I follow. Service Studio allows you to use whatever JavaScript you like? Or is it the integrated syntax checker that throws errors on valid ES6/7 code?

Hello Killian,


Yes, we can use the modern JavaScript directly in service studio.

But:

1. There is no syntax highlighting for modern JS. 

2. And, there is no on demand translation of modern javascript to the usual javascript. Some browsers like IE 11 do not support all of the modern javascript yet. So - the javascript community has babel.js as a solution - which translates the modern JS to the older JS (ES5) if required.

OutSystems can integrate the babel.js within the platform and intelligently decide (depending on support provided by browser for modern JS) whether babel.js transformation should be applied or not. A browser like Chrome wont need the transformation, but a browser like IE 11 may (and all older IE versions). Edge browser also supports some features already for modern JS and firefox too.



2023-05-18 09-00-19
Ricardo Vaz Alves
Changed the status to
On our RadarOn our radar

Hi Chetan,

Thanks for the idea. We've actually already had similar conversations at R&D to allow something similar to what you're proposing.

We're evaluating how we have a broader support for modern JS.  We'll tackle something along these lines soon. 

Kind regards,

Ricardo Alves


Thank you Ricardo.

2019-04-07 18-26-39
Vitor Teixeira
Merged this idea with 'Support ECMAScript 6' (created on 30 Jan 2020 13:21:44 by Ramesh Sirvi)

Hi Team,


It will be better if outsystems support ECMAScript 6.


Thanks & Regards,

Ramesh Sirvi



This comment was:
- originally posted on idea 'Support ECMAScript 6' (created on 30 Jan 2020 by Ramesh Sirvi)
- merged to idea 'Modern JavaScript (ES6, ES7) support in ServiceStudio' on 31 Jan 2020 11:07:40 by Vitor Teixeira
2016-04-21 20-09-55
J.
 
MVP

Yes please,

It's been on the radar for some time now sadly :(

For a developer it's almost an extra dayjob to downgrade 3rd party components to get it actually working within outsystems.
Even though the syntax is correct, SS refuses to publish it anyways.



I'm also keep running into walls when trying to use 3rth party components and using these in the manner OutSystems describes. Most modern packages are ES6 or higher (and since the opening of this topic at least 5 new versions have been published.

The main issue is that Service Studio detects that the JavaScript used is from a higher version then they support and therefor don't allow a publish. Even though the Javascript is correct and will be handled correctly by the target audience of the application in question.

I do understand that it's a lot of work for OutSystems to support these with all the checks that are currently happening but there is an other way. Let me, as a developer, disable (via an checkbox) all the checking and validation of a JavaScript widget so that Service Studio doesn't give any errors and allows a deployment. This way you let the developer acknowledge that OutSystems doesn't provide "support" and doesn't check the validity of the JavaScript but still allow modern 3rth party components to be used in a maintainable way for the developer.

Kind regards,

Vincent


2021-01-12 09-17-15
35e7a81a-9d12-4e49-a81f-8c1f290be6f4

I keep running into this issue while trying to write clean, legible JS, and it's making my job very difficult. It's also a pain to try to explain this restriction to new OutSystems developers as well, especially when they have a background in Frontend development.

Please let us at least have the *option* to deploy JS code without strict Service Studio validation.

Merged this idea with 'Reactive JavaScript support for Template Literals' (created on 23 Apr 2021 22:02:58 by erik berg)

I would like to see support for JavaScript Template Literals.

    $parameters.UrlBase =  `https://${document.domain}/MyPage?MyParameters=`;

I have been using JavaScript Template Literals for years in OutSystems Classic Web applications without issue.  Very surprised that the JavaScript parser throws errors on this syntax.

There is a Modern JavaScript (ES6, ES7) support in ServiceStudio idea already which might overlap this idea.  



This comment was:
- originally posted on idea 'Reactive JavaScript support for Template Literals' (created on 23 Apr 2021 by erik berg)
- merged to idea 'Modern JavaScript (ES6, ES7) support in ServiceStudio' on 26 Apr 2021 08:00:44 by Daniël Kuhlmann

Hi all,

The good news is that the new multi-platform Service Studio will support all of this, see screen shot, no errors: the text "My name is Ryan" shows up in the console log of the browser:

Merged this idea with 'Allow ES6 JavaScript syntax' (created on 29 Jun 2021 02:00:27 by Maxime Baracco)

Hi guys,


It would be so great to be able to use ES6 syntax for JavaScript blocks in Service Studio. Personally, I find it much more complicated to code without using Map or Arrow functions for instance.


I know that browser compatibility is an issue, but what makes me think that Outsystems could simply "enable" it is that when I look at the generated source code for our Reactive Web App, I can see that Outsystems is already using ES6 polyfills (see attached screenshot).



So if all the tools are already there, why not enabling it?


Also I think it's worth mentioning that enabling that will surely help developers to create and release more forge components, as most modern javascript code samples found online are using this syntax.


Thank you :)



This comment was:
- originally posted on idea 'Allow ES6 JavaScript syntax' (created on 29 Jun 2021 by Maxime Baracco)
- merged to idea 'Modern JavaScript (ES6, ES7) support in ServiceStudio' on 29 Jun 2021 07:08:52 by Daniël Kuhlmann

Hi,

This is possible with the new hybrid version of Service Studio that is in EAP.

It is planned to be GA somewhere later this year.

Regards,

Daniel



This comment was:
- originally posted on idea 'Allow ES6 JavaScript syntax' (created on 29 Jun 2021 by Maxime Baracco)
- merged to idea 'Modern JavaScript (ES6, ES7) support in ServiceStudio' on 29 Jun 2021 07:08:52 by Daniël Kuhlmann
Merged this idea with 'Update javascript editor to ES6' (created on 04 Mar 2021 15:48:23 by David Marques)


Today all browsers supported by OutSystems already are compatible with ES6 but the javascript widget editor is not.


I use a comment in the first line of javascript to ignore the errors.

/*jshint esversion: 6 */


We woud love outsystems be updated with recent javascript versions.





This comment was:
- originally posted on idea 'Update javascript editor to ES6' (created on 04 Mar 2021 by David Marques)
- merged to idea 'Modern JavaScript (ES6, ES7) support in ServiceStudio' on 29 Jun 2021 07:10:50 by Daniël Kuhlmann
Changed the category to
Service Studio


This comment was:
- originally posted on idea 'Update javascript editor to ES6' (created on 04 Mar 2021 by David Marques)
- merged to idea 'Modern JavaScript (ES6, ES7) support in ServiceStudio' on 29 Jun 2021 07:10:50 by Daniël Kuhlmann
Merged this idea with 'Extending modern javaScript ES 2015 support in ServiceStudio' (created on 27 Oct 2021 19:16:57 by Gokula Kannan P)

Hello All,


   In Service Studio js widget has allowed to write ES5 and ES6 code, but some of features like 'let' keyword, the 'const' keyword, template literals etc,. shows warning and it handled by "jsHint" lint ignore comment line. Errors are detected by truechange. after did some comparison with "https://node.green/" as per my guess studio currently supported features are related to node v0.10. 


In these case my idea will be, if we implement the node v6.4 features into our Service Studio then it supports basic es6 feature like above mentioned. Developer productivity with modern JS also increase. 


Note: Please provide documentation for "jsHint Options " which are usable in studio.

yes @gokula i agree with your points , event me also check with that if OS support that version atlease we can use some basic Es6 Properties .