-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Scala.js #90
Comments
it would be nice to have support for scalajs. I have not looked at it. |
@ngbinh @johnynek I managed to create the .sjsir files in https://gist.github.com/muller/728f3d4c45ec593f1fde4fce19d686ea. I am working now on execute the linking part with a genrule, what should give me the JavaScript file. |
thanks! |
Nice work! It would be great to have this be an easy option we could set up with a scala toolchain #170 |
note that with #380 we can probably think about how to do this again. We might need to look at adding scalajs support to scala_import. |
Sounds interesting! What do you mean by scala.js support in scala_import?
…On Thu, 4 Jan 2018 at 21:41 P. Oscar Boykin ***@***.***> wrote:
note that with #380 <#380>
we can probably think about how to do this again.
We might need to look at adding scalajs support to scala_import.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#90 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABUIF2zFn_rY64T_0ACMX_dnwX4KgQ8yks5tHSf-gaJpZM4J2CCw>
.
|
scala.js uses maven jars for its compiled code. So, for scala_import, you could also say this scala library exists for jvm and js (and maybe later, native). Then when we go to compile a library that we want scalajs for, we make sure all dependencies are scala, or transitively depend on scala_import with js. That might work. |
I too have had luck getting rules_scala to build me .sjsir files, with the following in my scala_maven_import_external(
name = "org_scala_js_scalajs_compiler",
artifact = "org.scala-js:scalajs-compiler_2.12.8:0.6.28",
licenses = ["notice"],
server_urls = [
"https://repo.maven.apache.org/maven2/",
],
)
bind(
name = 'jar/org/scala_js/scalajs_compiler_2_12_8_0_6_28',
actual = '@org_scala_js_scalajs_compiler//jar'
) and in my plugins = ["@org_scala_js_scalajs_compiler//jar"] is all that's needed to make scala emit a .jar file with .sjsir files inside it. The linker program above worked perfectly, even to I'd love to have support for scalajs, and AFAICT this involves adding support for scalajs by changing If i have time in the coming weeks, i'll format this stuff out as a PR |
Amazing that it is so easy! I'd love to see a PR with docs, or better a small example that we can add to the tests. It would be interesting to think about how to not have to define two separate build targets. It could be that aspects could be useful here. If a target only defines scala dependencies, then we could possibly generate all the internal scalajs_library targets with an aspect. |
Btw,
A co-worker at Wix has an internal scala.js back-office application built
and deployed to production for a few months now
…On Tue, Sep 10, 2019 at 6:06 AM P. Oscar Boykin ***@***.***> wrote:
Amazing that it is so easy! I'd love to see a PR with docs, or better a
small example that we can add to the tests.
It would be interesting to think about how to not have to define two
separate build targets. It could be that aspects could be useful here. If a
target only defines scala dependencies, then we could possibly generate all
the internal scalajs_library targets with an aspect.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#90?email_source=notifications&email_token=AAKQQFZSPYNXKOYLTLCYUZ3QI4FKBA5CNFSM4COYECYKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6JVJIA#issuecomment-529749152>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAKQQF3TKPXNXBS5E5H4FTTQI4FKBANCNFSM4COYECYA>
.
|
I've completed a linker to turn the SJSIR/class files into js, and have added some checks to make it successfully build JS. I'm going to clean up my code and submit a PR soon - need to finish
|
Thanks!
Very interesting. Please take into account that in the next 2-3 weeks we
won’t be able to accept contributions since we’re merging a huge refactor
PR which changes the architecture of the rules.
After it’s in and you’ll readjust to it’s pattern I’d love to review.
On Sun, 24 Nov 2019 at 3:32 Dhash Shrivathsa ***@***.***> wrote:
I've completed a linker to turn the SJSIR/class files into js, and have
added some checks to make it successfully build JS. I'm going to clean up
my code and submit a PR soon - need to finish
1. Tests
2. Removing hacks
3. Passing arguments to the linker
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#90?email_source=notifications&email_token=AAKQQF52G36ZZA4AW7YN4ZTQVHKQ3A5CNFSM4COYECYKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEFABR4Q#issuecomment-557848818>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKQQF5WDPQJOVZQGKPYRCLQVHKQ3ANCNFSM4COYECYA>
.
--
*Ittai Zeidman*
Cell: 054-6735021
40 Hanamal street, Tel Aviv, Israel
<http://www.wix.com>
|
@ittaiz any progress around scalajs integration? |
Hi everyone, I'm interested in playing with this, but I wanted to see if anyone had done any work before getting in too deep. I'm mostly hoping to get scalapb and 🤞 scalapb-grpcweb working, the latter of which depends on a very new version of scala.js (1.5.0). I was able to get a simple build working (no scalapb) with @muller 's gist + an updated scala.js linker: https://gist.github.com/2201dda3b4acdeb0a9206f5073060745. If anyone has pointers or suggestions, please drop em here! |
No update but I wish you a lot of luck! |
I was able to get things mostly working! It's still quite rough and definitely not ready for review, as there are many open questions, but if anyone is interested in taking a look / making suggestions, the |
Scala.js http://www.scala-js.org/ has been very popular in Scala community. At work we are having a very large code base in both Scala (backend) and Scala.js (frontend). I am wondering if anyone has tried to compile scala.js using bazel?
The text was updated successfully, but these errors were encountered: