Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Bridging the tooling gap with Scala.js

Bridging the tooling gap with Scala.js

Scala.js is a tool for compiling your Scala code to JavaScript. This enables writing type-safe and robust front-end application, but have you ever considered what it can do for Scala tooling? In this talk we’ll see how Scala.js can bridge the gap between the Scala-based and the JavaScript-based tools we use every day as programmers.

Gabriele Petronella

April 16, 2018
Tweet

More Decks by Gabriele Petronella

Other Decks in Programming

Transcript

  1. '' == false // true [''] == '' // true

    [[]] == 0 // true typeof document.all // undefined document.all === undefined // false document.all === null // false document.all == null // true Number.MIN_VALUE > 0 // true ['1','2','3'].map(parseInt) // [1, NaN, NaN]
  2. First idea +-------------------------+ +------------------------+ | | | | | |

    | | | | | | | | source | | | +---------------------------------------> | | | | | | | | | | | | | | | AST EXPLORER | | JVM SERVER | | | | | | | AST | (SCALAMETA) | | | <---------------------------------------+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +-------------------------+ +------------------------+
  3. First idea +-------------------------+ +------------------------+ | | | | | |

    | | | | | | | | source | | | +---------------------------------------> | | | | | | | | | | | | | | | VSCODE | | SCALAFMT CLI | | | | | | | formatted source | (JVM) | | | <---------------------------------------+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +-------------------------+ +------------------------+
  4. Yep

  5. Upsides 4 ! fast 4 " self-contained Downsides 4 !

    config -> cross-platform HOCON is still meh
  6. Free ideas, grab them! 4 scalafmt on astexplorer.net 4 (alternatively)

    standalone playground on scalafmt.org 4 browser extension that formats code comments 4 scalafmt on scala native 4 GitHub app for scalafmt checks (talk to @laughedelic)