scala-js-jquery icon indicating copy to clipboard operation
scala-js-jquery copied to clipboard

Some docs

Open antonkulaga opened this issue 11 years ago • 5 comments

It would be nice to see at least a code snippet (or a link to appropriate part of scalajs docs if you prefer to keep it in one place) about getting started (if I imported latest jquery 2, how should I use if with scala, from which trait to inherit?) as well as warnings of what is implemented and what is not. What about defining additional type alias for ??? that will be used to avoid confusion between defining a trait for existing JS library and "not implemented mark" (as most of the people got used to such ??? meaning)

antonkulaga avatar Mar 15 '14 19:03 antonkulaga

I agree. I'm piling that up, and hopefully I'll find some time to do it this week.

sjrd avatar Mar 17 '14 13:03 sjrd

Hi Sébastien, in your ScalaDays talk you said that "luckily, it's easy for you (the audience) to contribute".. So I wonder if any of the pile can be exposed now? :) (July 2014 in 2 days)

I'm okay to crawl in code. What I would like to have is:

  • how to make scala-js-jquery "self test" after git clone
  • a walk-through of the src/.../JQuery.scala file (it seems tremendously simple - Is That All?)
  • knowledge of other people interested in bridging JavaScript libraries to scala-js (and a forum to discuss common issues and teach the tricks)

As I've mentioned to you privately, my aim is the wonderful http://snapsvg.io aka bringing vector graphics to Scala.

akauppi avatar Jun 28 '14 20:06 akauppi

Hi @akauppi. I believe the mailing list is the best place to discuss this. Would you mind resending this there?

sjrd avatar Jun 28 '14 20:06 sjrd

That said, to get you started:

To compile, just use

> compile

in sbt. That's about all that can be done to "test" this thing, unfortunately. Because actually there isn't any behavior in this library. Everything is implemented in the original jquery.js. The code in JQuery.scala only provides types to the API implemented by jquery.js. Of course, one could write a test suite for jQuery, implemented in Scala.js, using this static API. But that does not seem like a good thing to do. I really don't know how we could test the facade to jQuery.

As for a walkthrough, well, it's very simple: it's only a Scala definition for the types of the API described in the jQuery documentation. There isn't anything else. The definitions are written by following the rules about facade types documented here: http://www.scala-js.org/doc/calling-javascript.html

sjrd avatar Jun 28 '14 20:06 sjrd

Sure. :) mailing list it is

akauppi avatar Jun 28 '14 22:06 akauppi