Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Apr 18 19:06
    @sjrd banned @Amitgup48798297_twitter
  • Mar 29 07:47
    @sjrd banned @quangs
  • Jan 23 06:34
    @sjrd banned @Rebeka58_gitlab
  • Jun 08 2020 20:43
    @sjrd banned @sw7240614
  • Sep 29 2019 08:35
    @sjrd banned @8bitpitRBX_twitter
  • May 23 2019 13:44
    @sjrd banned @BIGCRYPTO001_gitlab
  • May 01 2019 14:31
    @sjrd banned @Certificates1_gitlab
  • Apr 22 2019 15:31
    @sjrd banned @lerbatax
  • Jan 31 2019 23:04
    sjrd commented #3555
  • Jan 31 2019 22:56
    sjrd review_requested #3555
  • Jan 31 2019 22:56
    sjrd opened #3555
  • Jan 31 2019 21:06

    sjrd on 0.6.x

    Remove dead code: specific coll… Adapt the signature of `js.Arra… Merge pull request #3554 from s… (compare)

  • Jan 31 2019 21:06
    sjrd closed #3554
  • Jan 31 2019 20:54
    erikvanoosten commented #2665
  • Jan 31 2019 16:33
    sjrd commented #3538
  • Jan 31 2019 15:54

    sjrd on master

    Fix analyzer cycle detection to… Add toString methods to analyze… Do not provide linked ClassInfo… and 1 more (compare)

  • Jan 31 2019 15:54
    sjrd closed #3552
  • Jan 31 2019 15:54

    sjrd on master

    Remove Logger.success It is un… Make level helpers final Clean-up ScalaConsoleLogger cod… and 1 more (compare)

  • Jan 31 2019 15:54
    sjrd closed #3553
  • Jan 31 2019 15:33
    sjrd commented #2665
Lorenzo Gabriele
@lolgab
@Jacob_Bogers_twitter Scala on JVM and JS are mostly the same language. If you plan to use Scala on the frontend i'd say, why not?
I personally learned it on the JVM because I was coming from Java, if you're coming from a frontend/nodejs background I think starting with Scala.js is totally cool!
Jacob Bogers
@Jacob_Bogers_twitter
I know Java up to 6 (done it full time up to that point), I was a but put off by the toolchain, but maybe I am reading to much into things, yes, I would like to use scala front/backend all the way if possible
I will start with scala.js , super thanks
Lorenzo Gabriele
@lolgab
No worries, you can ask here or on Discord #scala-js if you have any doubt. I really like to have Scala.js full-stack. I currently use Google firebase on a toy project where everything is Scala.js (cloud functions and SPA) :)
rhazn
@rhanarion_twitter
Hello, I am having a look at compiling an existing lib with scala-js but running into an error setting up the testing framework ("SyntaxError: Unexpected token 'export'" as I configure ScalaJS to export an ESModule). Is there an easy way to turn of the testing for a start? I am not that familiar with sbt :/
Sébastien Doeraene
@sjrd
@rhanarion_twitter If you don't run the test command, it won't test. I'm not sure what you mean by "turn of the testing for a start"?
rhazn
@rhanarion_twitter
I have tests for scala that run when I use test. When I enable the scala-js plugin in the sbt file it also adds it's own tests to the test command. I would like to keep everything I have done (compile the scala lib to javascript) but keep the test command as it was (testing only scala code).
Sébastien Doeraene
@sjrd
Are you using a crossProject?
rhazn
@rhanarion_twitter
Not that I know of but my sbt knowledge is sadly limited.
Sébastien Doeraene
@sjrd
If you just have one project and you add an enablePlugins(ScalaJSPlugin) on it, then it's not a JVM project anymore. There's no JVM code to test.
If you want to keep the JVM part, you need to use a crossProject to build, in fact, 2 projects: one for the JVM and one for JS.

@renghen

I am doing some experiments around javascript and cps

Does https://github.com/scala/scala-async address your use case?

rhazn
@rhanarion_twitter
But if I run sbt package it still creates a jar file, what is in that file? :eyes:
Sébastien Doeraene
@sjrd
The thing that can be published for it to be used as a Scala.js library.
rhazn
@rhanarion_twitter
Ah, interesting.
renghen
@renghen
rhazn
@rhanarion_twitter
Mhm with cross building (from here https://www.scala-js.org/doc/project/cross-build.html) sbt does no longer find my annotations, even with scalajs-stubs in the jvm dependencies :/
Sébastien Doeraene
@sjrd
Shared code goes in the shared/ subdirectory by default. You may have to move your src directory inside shared/. Or use .crossType(CrossType.Pure) on your crossProject.
rhazn
@rhanarion_twitter
Ah I see
I think my grasp of the whole setup is a bit too small to make it work quickly so I'll have to shelf it for now
But thank you for the help, it made what happens a lot clearer already :thumbsup:
Kirill A. Korinsky
@catap
Any plans to release scalajs-dom for scala3?
Sébastien Doeraene
@sjrd
Probably not. The 2.13 version can be used. And if we publish a version for 3, then one could get both the 3 and 2.13 versions in the classpath through transitive dependencies, leading to bad issues.
On the other hand, it might be nice to look at how we could design a version 2.x of that library which would leverage Scala 3 features.
Nikita Gazarov
@raquo

one could get both the 3 and 2.13 versions in the classpath through transitive dependencies, leading to bad issues.

scala-js-dom aside, is this a concern for libraries that are cross published for 2.13 and 3.0.0 with the same codebase (not scalaVersion-specific)? If so, what would the symptoms be, the usual binary incompatibility errors like "non-existent method"?

Sébastien Doeraene
@sjrd
Yes, that is the most likely symptom.
Kirill A. Korinsky
@catap
@sjrd one future question: dose somebody working on biginteger inside sjs?
Sébastien Doeraene
@sjrd
What do you mean? We have BigInteger in Scala.js. Nobody's "working on it"; it's done already.
Kirill A. Korinsky
@catap
thanks
Rich
@Rich2
So this could be my error, as its the first time I've tried to build a Scala.js artifact under Scala 3, but I'm getting
libraryDependencies += "org.scala-js" %%% "scalajs-dom" % "1.1.0",

not found: /home/rich/.ivy2/localorg.scala-js/scalajs-dom_sjs1_3/1.1.0/ivys/ivy.xml
[error]   not found: https://repo1.maven.org/maven2/org/scala-js/scalajs-dom_sjs1_3/1.1.0/scalajs-dom_sjs1_3-1.1.0.pom
Anton Sviridov
@velvetbaldmime:matrix.org
[m]

@Rich2 scalajs-dom is not published for Scala 3, but it works fine with using a 2.13 version.

Which version of SBT are you using?

Rich
@Rich2
I'm on 1.5.2.
Anton Sviridov
@velvetbaldmime:matrix.org
[m]

("org.scala-js" %%% "scalajs-dom" % "1.1.0").cross(CrossVersion.for3Use2_13)

Should get you there then :)

For the official confirmation from Sebastien see scala-js/scala-js-dom#422 (the solution uses withDottyCompat which is not needed on your SBT version)
Rich
@Rich2
Ah thanks, its finding that, but I'm now getting 2 errors that I'm not seeing when I compile the same code for Scala 3 Jvm.
Anton Sviridov
@velvetbaldmime:matrix.org
[m]

scalajs-dom is not published for JVM - is that the cause?

Or something in the build errors?

Rich
@Rich2
No the errors are in common code for Jvm and Scala.js.
Anton Sviridov
@velvetbaldmime:matrix.org
[m]

Given that scalajs-dom doesn't exist for JVM, I don't think that artifact should be pulled into the compilation in the first place.

What sort of errors?

Rich
@Rich2
-- Error: /Common/openstrat/Graphics/src/Trans/ProlignMatrix.scala:48:18 -------
[error] 48 |    (obj, offset) => obj.map(ev.prolignObj(_, offset))(new AnyBuild[A])
[error]    |                  ^
[error]    |bridge generated for member method prolignObj(obj: ostrat.Arr[A], offset: ostrat.geom.ProlignMatrix): ostrat.Arr[A] in anonymous class Object with ostrat.geom.Prolign {...}
[error]    |which overrides method prolignObj(obj: A, prolignMatrix: ostrat.geom.ProlignMatrix): A in trait Prolign
[error]    |clashes with definition of the member itself; both have erased type (obj: Object, offset: ostrat.geom.ProlignMatrix): Object."
[error] -- Error: /Common/openstrat/Graphics/src/Trans/Slate.scala:28:84 ---------------
[error] 28 |  implicit def arrImplicit[A](implicit ev: Slate[A]): Slate[Arr[A]] = (obj, dx, dy) => obj.smap(ev.SlateXYT(_, dx, dy))
[error]    |                                                                                    ^
[error]    |bridge generated for member method SlateXYT(obj: ostrat.Arr[A], dx: Double, dy: Double): ostrat.Arr[A] in anonymous class Object with ostrat.geom.Slate {...}
[error]    |which overrides method SlateXYT(obj: T, xDelta: Double, yDelta: Double): T in trait Slate
I'll check my source folders in Sbt, that's probably the reason.
I haven't tried to build the Scala.js sub projects for some time, so an error has probably crept into my Sbt file.
Anton Sviridov
@velvetbaldmime:matrix.org
[m]

yeah, run show sourceDirectories and show allDependencies on them projects to see if there's something unexpected there, which is usually the case.

I've never actually seen "bridge generated" sort of error before, which is interesting

Rich
@Rich2
I removed the scala.js specific src folder and the dom dependency and the errors still remain, while seemingly exactly the same code compiles fine for Scala 3 on the Jvm.
Anton Sviridov
@velvetbaldmime:matrix.org
[m]
If the behaviour is different with the Scala.js in the mix, that might be worth an issue
Rich
@Rich2
Here's the source if you're interested.
That's still running under 2.13. I haven't committed or pushed the upgrade to 3.0.0.
Rich
@Rich2
I've paired the sub projects down, so the Jvm sub project and the Js one are using the same two source folders, I deleted the target directories to make sure, there was no caching issues and it definitely compiles under Scala 3 for Jvm but not for Js.
Sébastien Doeraene
@sjrd
Please file an issue with a reproduction in the dotty repo 🙂
John Ewart
@johnewart
Hey all! The SBT plugin for 2.13 seems to be absent from maven central (there is one for 2.12); am I missing something obvious?
Eric K Richardson
@ekrich
Sbt plugins all are using 2.12 as that is the version used by sbt itself. How you trying to use the plugin?