Announcing Scala.js v0.2

Showing 1-9 of 9 messages
Announcing Scala.js v0.2 Sébastien Doeraene 1/6/14 8:45 AM
Hello everyone, and happy new year!

I just tagged and published Scala.js v0.2! Several very nice features have reached master since 0.1, and I have emptied the queue of requested features that can be implemented in a few days' time, so I thought it was a good occasion to tag v0.2.

New features

  • A testing framework based on Jasmine, working out-of-the-box.
    • See the bootstrapping skeleton for how to use it.
  • Improved interoperability with JavaScript
    • Support for JavaScript callback functions where this is intended to be used as a parameter: the series of traits js.ThisFunctionN are similar to js.FunctionN, but take one additional argument which will be bound to this.
    • Object literal construction: js.Dynamic.literal(foo = 3, bar = "foobar") produces the JavaScript object {foo: 3, bar: "foobar"}
  • True Longs
    • scala.Longs are now truly 64 bits, and respect the same semantics as on the JVM
  • Support for Scala 2.11.0-M7
    • Just add scalaVersion := "2.11.0-M7" in your sbt build to use this alternative version of Scala.js
    • With -Xexperimental, JavaScript functions receive the SAM treatment, and hence types of parameters can be inferred for lambdas
    • With -Ydelambdafy:method, all lambdas in your code (except partial functions) are compiled as JavaScript functions.

Improvements

  • Compile errors for invalid js.Any definitions
    • The compiler now issues clear error messages when you try to define subclasses of js.Any where it is not permitted. Previously your code would crash at runtime with obscure error messages.
  • Smaller output
    • We continue to strive for smaller dev and opt versions of the emitted code size. In particular, most lambdas in your code are now translated as JavaScript functions with tiny wrappers rather than full classes, reducing the size of the output.

Bug fixes

See all bug fixes for 0.2 in the issue tracker.

 

A big thank you to all the contributors!

#Author
36  Sébastien Doeraene
32  Tobias Schlatter
2  Li Haoyi
1  Piotr Kolaczkowski
1  Vincent Munier
1  chrismcc
1  olivier
1  EECOLOR

 

Complete commit list!

shaTitle
5890198  Version 0.2.
8c032ab   Remove obsolete patching in the runner for partest.
2447303  Blacklist a test that crashes Rhino.
cbbb5f7  Pass command-line arguments to main method in run task.
2620d06   Add line in travis matrix to use -Xexperimental in test suite.
d819606  Fix translation of JS SAMs when they are nested in other lambdas.
6cc77e4  Add support for SAM treatment of js.ThisFunctionN.
6df81e4   Add js.ThisFunctionN to capture JS `this` as parameter.
8447f8f  Add an object literal construction mechanism.
82c0ed1  Integrate unit testing framework with sbt test discovery.
c37a2a1   Fix #55: Correctly dispatch `subSequence` on non-string CharSequence
e554140  Fix #65: Hack in Regex adapter to make StringLike.split(c: Char) work
b2999eb  Fix #58: Implement java.lang.String.toCharArray
fb4303b   Fixes #91 : expand fromFunctionN, toFunctionN, FunctionN and AnonFunctionN to 22
76fe9b1  #93: Add complete set of fill methods for java.util.Arrays.
c074d9f  Fix Formatter's failure and positional behavior
7718807   Fix #47: Implement 's' conversion
9a25b7f  Fix already existing conversion to comply with JavaDoc
8bd9bb2  Move formatting code to java.util.Formatter
f046428   Implement upper/lower case functions on java.lang.Character
4f9164d  Fix #79: Allow anonymous subclasses of js.Any for lambdas
23daed9  Fix #79: Fail if an anonymous class extends js.Any
c99d782   Fix #78: Fail if a case class extends js.Any
028898d  Fix #83: swallow Unit expr when converting to js.Undefined.
12031a1  Auto-publish compiler and library for Scala 2.11.0-M7.
e6b68cd   Fix #69: optimizeJS should be wrapped in anon function.
8cd1788  Add java.io.IOException.
99cb13b  Port all the missing java.util and java.lang Exceptions/Errors.
06a2a95   Classify some partests
4a62499  Add Buglist and Blacklist test flag to partest
4038406   Reclassify partests that now succeed
11c01f5  Re-Implement java.lang.Long in terms of the new runtime representation
e2be2d5  Patch scala.scalajs.runtime.Long as runtime replacement for JavaScript numbers
3c57386   Add scalajs library to compiler dependencies
44e11b1  Add scala.scalajs.runtime.Long (javascript compatible 64-bit Long)
767ec87  Re-allow js.Any ctors with arguments
629f8c8   Fix #57: clone on Array[ T] fails.
e833b0e  Fix #56: Broken boxing of Byte.
372bcdf   Some new whitelisted tests, and some blacklisted b/c of time.
b2418ed  Fix semantics of null.asInstanceOf[Int] and other primitives.
f98211f  Fix #66: emit static calls for forwarding a constructor call.
62b752e   Fix #63: test was too restrictive for compareTo on strings.
031f338  Add checks for js.Any class structure in frontend- phase
b57456a  Add secondary constructor to js.Function to have no-arg primary ctor as required
d020955  Remove call to beforePhase to check for js.GlobalScope
4d76bd2   Apply -Ydelambdafy:method to the library.
9666214  Fix bug in handling -Ydelambdafy:method and value classes.
8f777c9  Classify a lot of tests.
7fed538   Implement java.lang.Long.bitCount
1a71559  Hack scalajs partest interface to allow to run single tests
04df991  add tests considered bugs, create flag to only run tests that are not classified
222667a   Add partest to run Scala's test suite.
40d51eb  Add basic support for -Ydelambdafy:method.
5222d1c  Add support for SAM treatment of js.FunctionN.
8a56e8a   Upgrade to Scala 2.11.0-M7.
ec9992a  Generalize RhinoBasedRun.
999deb1   Emit Scala lambdas as JS lambdas as much as possible.
dac45fd  fix js.Dictionary.fromAny (add missing type param to cast)
9b7992a  add js-interop phase to compiler and have it tag raw js classes
39760f9   Added doccomments from MDN to Javascript standard library stubs
24d26cf  Add implicit conversions from JS primitives to Rich ops.
30c398e  Fix: avoid to create a js.Try wout catch nor finally.
5f7a8d4   Make JSDesugar.unnest() a bit more clever.
4561cbe  Alternative implem for protection of receivers of raw apply.
ae3801a  More rational usage of exprToStat() and statToExpr().
ca76540   Make sure js.Block() is always created with 2+ elements.
064cd96  Do not print else branch when it is js.Skip().
5973b5e  Improvement on the translation for pattern matching.
6ab2fdb   fix #48 correctly convert negative numbers with x conversion
9f0df36  add SIZE constants to number companions
6901737  fix #46 add padding after prefix in String.format
9d0bda8   add method Integer.numberOfTrailingZeros
45a7280  Auto-publish after successful build on master.
a870bce  Update README.md
68e9639  Towards 0.2.

Enjoy!
Sébastien
Re: Announcing Scala.js v0.2 Sebastian Nozzi 1/6/14 9:27 AM
Awesome release / features!

Congratulations and thanks to everyone making this possible :-)
Re: Announcing Scala.js v0.2 Peluko 1/6/14 1:15 PM
Great work!!
...
Re: Announcing Scala.js v0.2 Benjamin Jackman 1/6/14 1:54 PM
Wow this is awesome, Great job!
...
Re: Announcing Scala.js v0.2 Li Haoyi 1/7/14 11:55 PM
I have Scalatags cross-building and cross-testing (copy&pasted tests) great under Scala 2.10 and ScalaJS 0.2; things are looking great =)

Question: when I do eventually want to put a ScalaTags-Js artifact somewhere where (other people's) SBT can find it, is there some place/process for me to do so? The Scala-JVM artifact's going to maven central, but I seem to remember the consensus being we shouldn't put javascript artifacts on maven central with all the java artifacts.
...
Re: [Scala.js] Re: Announcing Scala.js v0.2 Sebastian Nozzi 1/8/14 1:04 AM
2014/1/8 Li Haoyi <haoy...@gmail.com>
I have Scalatags cross-building and cross-testing (copy&pasted tests) great under Scala 2.10 and ScalaJS 0.2; things are looking great =)

Cool! Type-safe, Scala based HTML templating client-side

Question: when I do eventually want to put a ScalaTags-Js artifact somewhere where (other people's) SBT can find it, is there some place/process for me to do so? The Scala-JVM artifact's going to maven central, but I seem to remember the consensus being we shouldn't put javascript artifacts on maven central with all the java artifacts.

Hmmm... how does webjars do it, then? http://www.webjars.org/

Cheers,
Sebastian
Re: Announcing Scala.js v0.2 Sebastian Nozzi 1/8/14 1:06 AM
2014 will be the year of Scala.js! :-)

[or does it bring bad luck to make such predictions... I just think of "Linux on the desktop" - by the way, writing from an Ubuntu machine ;-)]
Re: [Scala.js] Re: Announcing Scala.js v0.2 Sébastien Doeraene 1/8/14 1:33 AM
We should setup an Artifactory for repo.scala-js.org, I think (currently it's bare sftp). The main issue is finding a server, because Artifactory is too heavy for my personal server. I'll bring this up at the next Scala meeting.

Cheers,
Sébastien


On Wed, Jan 8, 2014 at 10:06 AM, Sebastian Nozzi <sebn...@gmail.com> wrote:
2014 will be the year of Scala.js! :-)

[or does it bring bad luck to make such predictions... I just think of "Linux on the desktop" - by the way, writing from an Ubuntu machine ;-)]

--
You received this message because you are subscribed to the Google Groups "Scala.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-js+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Re: [Scala.js] Re: Announcing Scala.js v0.2 Adriaan Moors 1/10/14 9:51 AM
I'd also consider bintray.