question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

This is sort of a long term maybe-nice-to-have goal for the JS implementation of RiveScript: rewrite the source code in EcmaScript 2015 (ES6).

There’s this gist about migrating from CoffeeScript to ES6 which contains a nice overview of the new ES6 syntax and how it compares to CoffeeScript syntax.

A script like decaffeinate may help, if it produces high enough quality code. Otherwise a manual rewrite would produce better code.

There’s also this article Don’t Replace CoffeeScript with ES6 Transpilers, but most of its points are mostly only true of web browsers. Node supports ES6 so developers of Node apps could use the RiveScript-ES6 modules directly (no grunt build step needed to transpile from CS to JS), which also brings the benefit of Node devs being able to git clone this repo and use it immediately. But I’d have to investigate whether or not to support older versions of Node (if they can’t just npm install it and get the raw ES6 code to work, that may be a reason not to move away from grunt to transpile code into ES5 syntax and therefore we can just stay on CoffeeScript).

For web browsers, there’s already the required CoffeeScript+browserify steps to create a JS file suitable for the web, so replacing it with Babel isn’t much different.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:6
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
dcsancommented, Apr 21, 2016

you could also use Typescript to get typechecking and async/await is there right now. It will compile down to ES5 for browsers (tho not if you use await/async). I’m using that for current projects. If the goal is to keep things as simple as possible for more contributors, probably not a good idea, but if you want to have more powerful tooling but with a bit of setup overhead, then it’s a good option IMHO.

There’s also livescript which has a nice pipe syntax |> (like Elixir) that maybe good for these type of scripts where you’re piping inputs around… but fairly niche tool.

0reactions
Kuchirielcommented, Aug 3, 2018

Don’t forget about WebPack, it will help a lot people that uses WebPack, if you managed to full convert, I can write a .rive loader for WebPack.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ES2015 | Web - Google Developers
ES2015 is a fantastic step forward for the JavaScript language. It brings new features and sugaring for patterns that required significant ...
Read more >
Porting a Large ES5 JavaScript Library to ES6 Modules and ...
Now that we have merged the ES6 Module port, where do we go from here? First up, Rollup is kindly informing us that...
Read more >
Developers - Port to ES2015 - - Bountysource
Coming soon: A brand new website interface for an even better experience!
Read more >
Port hubot from coffeescript to plain Javascipt (ES2015) #1138
After es6 is on the table and its easy to make es6 work on modern JS runtime through babel. Developers will have less...
Read more >
My Twelve Favorite ES6/ES2015 Features | Capital One Tech
If you're an enterprise JavaScript developer who hasn't used ES6 yet ... getUrl: function() {return "http://" + this.url + ':' + this.port},
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found