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.

C2bb0454c4af1a61e7f173d54ce17b0b?s=128

Gabriele Petronella

April 16, 2018
Tweet

Transcript

  1. 2.
  2. 5.

    '' == 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]
  3. 11.
  4. 14.
  5. 15.

    First idea +-------------------------+ +------------------------+ | | | | | |

    | | | | | | | | source | | | +---------------------------------------> | | | | | | | | | | | | | | | AST EXPLORER | | JVM SERVER | | | | | | | AST | (SCALAMETA) | | | <---------------------------------------+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +-------------------------+ +------------------------+
  6. 18.
  7. 19.
  8. 20.
  9. 23.
  10. 24.

    First idea +-------------------------+ +------------------------+ | | | | | |

    | | | | | | | | source | | | +---------------------------------------> | | | | | | | | | | | | | | | VSCODE | | SCALAFMT CLI | | | | | | | formatted source | (JVM) | | | <---------------------------------------+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +-------------------------+ +------------------------+
  11. 26.
  12. 27.

    Yep

  13. 28.

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

    config -> cross-platform HOCON is still meh
  14. 29.

    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)
  15. 30.