fusionauth-issues icon indicating copy to clipboard operation
fusionauth-issues copied to clipboard

[Lambdas] Revisit Lambda JS linting/compliance with ecma6 or 7 to spec

Open ebahsini opened this issue 3 years ago • 1 comments

[Lambdas] Revisit Lambda JS linting/compliance with ecma6 or 7 to spec

Problem

You can't use let and maybe a few other nice ECMA magic in Lambda's right now. The linter, or however we are checking this, does not like it.

Solution

Maybe implement something like https://prettier.io and a button to even "prettify" the lambda code in browser.

Alternatives/workarounds

Living in the past, and using old JS lovely technologies

Additional context

People like newer ECMA script features.

Related

  • https://github.com/FusionAuth/fusionauth-issues/issues/1790#issuecomment-1238336566
  • https://github.com/FusionAuth/fusionauth-issues/issues/1828

Community guidelines

All issues filed in this repository must abide by the FusionAuth community guidelines.

How to vote

Please give us a thumbs up or thumbs down as a reaction to help us prioritize this feature. Feel free to comment if you have a particular need or comment on how this feature should work.

ebahsini avatar Sep 20 '22 16:09 ebahsini

I think this only has to do with the editor we provide in the UI? If so, can you clarify the problem description to indicate this does not affect the API or runtime, but just the admin UI editor?

Assuming that is the case currently use CodeMirror (https://codemirror.net/), so we'd have to see if there is a a proper linter for ECMAScript >= 6.1 or build one.

Ideally we'd enable the linter according to the selected engine. Nashorn is stuck at ECMAScript 5.1.

According to their doc GrallJS supports the latest 2022 ECMAScript spec.

  • https://github.com/oracle/graaljs
  • https://262.ecma-international.org/13.0/

robotdan avatar Sep 22 '22 03:09 robotdan

Why is this closed, @robotdan ? The editor still doesn't let you use let or other valid JavaScript. That is problematic for a major use case (people iterating on lambdas in the editor).

Would you prefer we create another issue?

Screenshot 2023-09-12 at 4 43 58 AM

mooreds avatar Sep 12 '23 10:09 mooreds