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
Sébastien Doeraene
@sjrd
@cheriot Yes, that's right.
Christopher Heriot
@cheriot
thx, both! @AugustNagro, the ncurses equivalents on the JVM leave much to be desired so I'm looking at building a terminal app with https://github.com/chjj/blessed :)
August Nagro
@AugustNagro
@cheriot that looks dope. Everyday I am amazed by the quality of npm libs, despite JavaScript the language. There's even wasm ffmpeg these days
Christopher Heriot
@cheriot
100% agreed. I'm floored every time I see a JS lib that's more mature than what I find on the JVM, but it's not a one time thing
aappddeevv
@aappddeevv
@AugustNagro Now that you laid that out, it looks about right. It will be a week or so after scala3 RC1 comes out that I'll have my entire set of libs converted and can see if this fits naturally.
@cheriot I agree. While the libs (and python libs) may not be engineered with perfect architecture/design for those who like that, they target the use case really well and time to market is insanely high for something that can work. It's when scaling up, when scaling is important, that both python and js start getting hard fast.
Don't forget to look at Scurses. I've not used it but I was looking at java/python/js curses options just yesterday for a CLI app.
Anton Sviridov
@keynmol
^ I'd also just mention that a lot of JS libraries look and feel very cool, but many are fragile as hell. My experience with Expo and react native was super nice in the beginning, but then I hit one failure and it completely thrashed everything, constant restarts, exceptions, no logs. Ugh.
aappddeevv
@aappddeevv
Expo is very complex even though it tries to simplify things.
I think when code gets lifted a bit magically into an environment like Expo it gets complex quickly no matter what since it involves build tools and js build tools are very complex.
It's like the no-code movement. Once you deviate, bam, its complex.
Øyvind Raddum Berg
@oyvindberg
I found Expo not too terrible actually. It's true that if you break your app in such a way that it doesn't manage to start react, things are pretty hairy (though there are logs, even if they are hard to find). From there on and out I thought the experience was ok
nnovod-umms
@nnovod-umms
Has anyone found something like d3-graphviz (https://github.com/magjac/d3-graphviz) that's been done for scala.js? I need to dynamically make a DAG and display it (with actions done on nodes selected via mouse clicks) in a simple graphviz like output. I guess I can just create an interface to d3-graphviz but wanted to check if something had already been done.
aappddeevv
@aappddeevv
It's amazing to think that a little web application can build another application that becomes a mobile application in the end available on millions of devices :-)
Christopher Heriot
@cheriot
So I have mill's ScalaJSModule generating an empty .js file where I was hoping to find all the code in this library. Scalajs docs read like I either need a main method or @JSExport* to get code into js land, but I see uPickle and uTest among other libraries that don't seem to have either. Does anyone know what I'm missing?
Sébastien Doeraene
@sjrd
@cheriot If it's a library that is intended for use by other Scala.js projects, then it had no .js file of its own. You publish it to your Artifactory or to Maven Central, as usual. The required JavaScript code will be generated for it by applications that use your library.
Christopher Heriot
@cheriot
Ohhh, I was running the fastLink commands from the docs. It looks like I can publish locally and get *_sjs1_* artifacts. Thanks again
Eric K Richardson
@ekrich
Hi Guys, trying to support jdk11 and 15. I am getting this and would like a pointer if possible.
sbt:sjavatime-root> testSuiteJS/test
[info] compiling 23 Scala sources to /Users/eric/workspace/sjavatime/testSuite/js/target/scala-2.13/test-classes ...
[info] Fast optimizing /Users/eric/workspace/sjavatime/testSuite/js/target/scala-2.13/java-time-testsuite-on-js-test-fastopt
[error] Referring to non-existent method java.time.LocalDate.getEra()java.time.chrono.IsoEra
[error]   called from org.scalajs.testsuite.javalib.time.LocalDateTest.expectedRangeFor(java.time.LocalDate,java.time.temporal.TemporalField)java.time.temporal.ValueRange
[error]   called from org.scalajs.testsuite.javalib.time.LocalDateTest.expectedRangeFor(java.time.temporal.TemporalAccessor,java.time.temporal.TemporalField)java.time.temporal.ValueRange
[error]   called from private org.scalajs.testsuite.javalib.time.TemporalAccessorTest.$anonfun$range$2(java.time.temporal.TemporalAccessor,java.time.temporal.ChronoField)java.lang.Object
[error]   called from private org.scalajs.testsuite.javalib.time.TemporalAccessorTest.$anonfun$range$1(java.time.temporal.TemporalAccessor)void
[error]   called from org.scalajs.testsuite.javalib.time.TemporalAccessorTest.range()void
Sébastien Doeraene
@sjrd
What's the question? Looks like you could simply implement that function.
Eric K Richardson
@ekrich
I think the function is there - I'll check the API again, maybe I missed something. Scala Native actually throws an exception. My adapters are the package private[time] so I'm wondering if that could do something funny.
Sébastien Doeraene
@sjrd
Make sure it returns an IsoEra, and not a subtype thereof for example.
Eric K Richardson
@ekrich
Ok, thanks.
It has a with Era so I will look into that.
Yuriy Yarosh
@yuriy-yarosh

:point_up: January 27, 2021 11:31 PM

@nafg I'm getting value can only be used within a task or setting macro with every %%% even in build.sbt

I'm not quite sure how to initialize a libraryDep setting via lazy val in here

lazy val web: immutable.Seq[ModuleID] = "me.shadaj" %%% "slinky-core" % SlinkyVersion ::                                                    ^
build.sbt:33: error: `value` can only be used within a task or setting macro, such as :=, +=, ++=, Def.task, or Def.setting.
  "me.shadaj" %%% "slinky-web" % SlinkyVersion ::
              ^
Anton Sviridov
@keynmol
The error is guiding you, sort of. Just do lazy val web = Def.setting("me.shadaj" %%% "slinky-core" % SlinkyVersion) and then whenever you need this dependency, use web.value
%%% is unlike the %% and trips up plenty of people with this exact issue :)
Yuriy Yarosh
@yuriy-yarosh
missed .value part
mb
Well, I've get multiple deps with Def.setting in a list ... trying to map 'em via libraryDependencies ++= Dependencies.web.map(_.value), but it gave me long and cryptic exception
 java.lang.IllegalArgumentException: Could not find proxy for x$1: sbt.internal.util.Init#Initialize in List(value x$1, value $anonfun, method $anonfun$testier$4, method testier$lzycompute, object $dd74215a15febad41735, package <empty>, package <root>) (currentOwner= method testier$lzycompute )
    at scala.tools.nsc.transform.LambdaLift$LambdaLifter.searchIn$1(LambdaLift.scala:317)
    at scala.tools.nsc.transform.LambdaLift$LambdaLifter.$anonfun$proxy$4(LambdaLift.scala:322)
    at scala.tools.nsc.transform.LambdaLift$LambdaLifter.searchIn$1(LambdaLift.scala:322)
    at scala.tools.nsc.transform.LambdaLift$LambdaLifter.$anonfun$proxy$4(LambdaLift.scala:322)
Anton Sviridov
@keynmol
You can put entire Seq into Def.setting and call .value on the whole thing
Yuriy Yarosh
@yuriy-yarosh

Yup that works... ended up with

 libraryDependencies ++=
      // shared with jvm
      (tests.value ++ units.value ++ cats.value ++ fs2.value ++ refined.value) ++
        // everything else
        slinky.value

not pretty, but at least something...

felher
@felher

Hey folks.

I just noticed that using ScalaJS crossProject, ScalaJS seems to set trackInternalDependecies to something other than TrackAlways. I wanted to change that to TackAlways, but since TackAlways is already the default, I think there might be a good reason for ScalaJS deviating from the default.

What dragons and other beasts am I prone to run into when I change it back to TrackAlways?

felher
@felher
Or maybe I'm just mistaken... Not sure anymore crossProject really changes trackInternalDependcies
Sébastien Doeraene
@sjrd
No, crossProject doesn't manipulate trackInternalDependencies.
felher
@felher
@sjrd Thanks for confirming... seems like I have a sbt rabbit hole to fall into... ;)
João Costa
@JD557
is that any sbt task that runs fullOptJs and opens a browser window with the result (in a basic index.html, like the one from the getting started example)?
Sébastien Doeraene
@sjrd
Not for the main method. But for tests, there is testHtml
felher
@felher

Hello again.

I want to generate sources in an scalajs cross build into the shared subproject. Only thing: I think shared is not really a subproject? If I add to sourceGenerators of both the js and jvmprojects and aggregate them, do the source files get generated twice (mabye with weird effects when both are generated at the same time)?

Tobias Schlatter
@gzm0
If you add them to sourceGenerators, yes, they will be generated twice, but now "weird effects" will happen.
(we use this in many places in the Scala.js build itself)
Tobias Schlatter
@gzm0
Hahaha, that should have been no "weird effects".
August Nagro
@AugustNagro

For some reason this wouldn't compile

class A:
  private var _value: Int = 0
  def value_=(newValue: Int): Unit = _value = newValue
  def value: Int = _value

class B:
  val a = A()
  def handleEvent(e: js.Dynamic): Unit =
    a.value = e.event.target.value.asInstanceOf[Int]

It was giving me "method selectDynamic in trait Dynamic does not take type parameters"

When it happened first, I made the above reproducer. Then it reproduced. Then I changed to

class A:
  private var _value: Int = 0
  def value_=(newValue: Int): Unit = _value = newValue
  def value: Int = _value

class B:
  val a = A()
  def handleEvent(e: js.Dynamic): Unit =
    val newValue = e.event.target.value
    a.value = newValue.asInstanceOf[Int]

And it worked. But.. when I changed it back to the original form.. it's working again.

Weird dotty bug is my guess?

Sébastien Doeraene
@sjrd
Definitely a weird dotty bug. If you manage to have a reliable reproduction (even if it involves several steps), please open an issue on the dotty repo.
August Nagro
@AugustNagro
:+1:
Artsiom Miklushou
@mikla
Hello,
Is there some ways / tools that can help to analyze scala.js output bundle? Currently I have about 70Mb of raw fastopt and 7.7Mb of fullopt.
Anton Sviridov
@velvetbaldmime:matrix.org
[m]
Artsiom Miklushou
@mikla
Thanks!
Hanns Holger Rutz
@Sciss

What are my options for working with HTML5 Canvas element?

val canvas: Element = dom.document.getElementById("canvas").asInstanceOf[HTMLCanvasElement]
val ctx = canvas.getContext("2d")   // no method getContext

Is the API available in some library?