karate icon indicating copy to clipboard operation
karate copied to clipboard

replace graal with karate-js engine

Open ptrthomas opened this issue 2 months ago • 32 comments

refer: https://github.com/karatelabs/karate-js for full background

this will give us the following advantages:

  • reduce JAR size by at least 30 MB if not more
  • no limits to re-using JS code, even by call-once and call-single
  • no more depending on 3rd party project (fewer CVEs and less risk in case that project changes direction)
  • possibly improve performance
  • foundation for extending karate in the future (e.g. an alternative to cucumber for those who want BDD)
  • support debugging of even JS blocks in IDE plugins

ptrthomas avatar Apr 09 '24 16:04 ptrthomas

the build passes on github-actions (that too on Java 23 EA) 🎉

this is a very big deal ! tagging a few power users, please do try this on your local test suites when you get a chance, the thing to look out for is if you have used any JS apis or tricks that we don't yet support @edwardsph @ericdriggs @joelpramos @brown-kaew @fabio-andre-rodrigues @rwong-gw @cl-weclapp @AKushWarrior @bouncysteve @bondar-artem @f-delahaye @dvargas46 @maxandersen @arnault01 @jkeys089 @bischoffdev @staffier

image

this is the issue that tipped me over the edge: #2536

full changeset: https://github.com/karatelabs/karate/commit/ba931c8a5b9c1690f923638ff34fe27167f68eee

ptrthomas avatar Apr 10 '24 06:04 ptrthomas

very interesting - will try it out.

I have to ask - why not just use and possibly fork nashhorn standalone? https://github.com/openjdk/nashorn ..maybe as an option?

anyhow - just curious. will see if i can make karata with this PR run jbang testsuite in near future.

maxandersen avatar Apr 10 '24 07:04 maxandersen

@maxandersen pretty sure Nashorn does not support some ES6 features - the big one being arrow-functions. I could be wrong on specifics, but it certainly fails the small set of ECMA conformance tests that we tried. Interestingly there are some folks who are keeping Rhino alive - for e.g. the HTMLUnit project who are now looking for new engine.

ptrthomas avatar Apr 10 '24 07:04 ptrthomas

Thank you for directly addressing this risk. I look forward to the potential improvements in speed, performance, concurrency, flakiness, and reduced maintenance and reduced frequency of breaking js engine changes.

Excellent start.

ericdriggs avatar Apr 11 '24 19:04 ericdriggs

pretty sure Nashorn does not support some ES6 features - the big one being arrow-functions

Basic arrow functions are supported (in --language=es6 mode).

woess avatar Apr 22 '24 12:04 woess