Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Some docs #2

Open
antonkulaga opened this issue Mar 15, 2014 · 5 comments
Open

Some docs #2

antonkulaga opened this issue Mar 15, 2014 · 5 comments

Comments

@antonkulaga
Copy link
Contributor

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)

@sjrd
Copy link
Owner

sjrd commented Mar 17, 2014

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

@akauppi
Copy link

akauppi commented Jun 28, 2014

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.

@sjrd
Copy link
Owner

sjrd commented Jun 28, 2014

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

@sjrd
Copy link
Owner

sjrd commented Jun 28, 2014

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

@akauppi
Copy link

akauppi commented Jun 28, 2014

Sure. :) mailing list it is

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants