Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 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
  • Jan 31 2019 15:30
    erikvanoosten commented #2665
  • Jan 31 2019 10:41
    sjrd review_requested #3554
Anton Sviridov
@keynmol
@yurique weaver-test is :P
Iurii Malchenko
@yurique
hmm, will JUnit work in scala.js world? :)
weaver-test looks interesting :+1:
Anton Sviridov
@keynmol

used it to test laminar code with dom and cross-built code with node.js.

Need to upgrade it to 1.4.0 and see how things look.

Sébastien Doeraene
@sjrd

hmm, will JUnit work in scala.js world? :)

Yes, it does. enablePlugins(ScalaJSUnitPlugin) on your JS project. That's what we use for Scala.js' own test suite, so it will always be there.

Iurii Malchenko
@yurique

how nice! Thanks Sébastien!

@keynmol weaver artifacts are weird. In the sjs jar there are only *.sjsir files, and IDEA can’t resolve a single class in the weaver package.

Anton Sviridov
@keynmol

Huh, funny that both maintainers don't use IDEA :)

Our publishing is nothing special, we use sbt-projectmatrix and don't set up any settings on SJS publishing.

Should we?

Sébastien Doeraene
@sjrd
There should be nothing special to do, but you should definitely have .class files in the jar. Otherwise they're unusable, even just from the compiler, never mind IDEs.
Anton Sviridov
@keynmol

hm. That's very strange - I do have a public repo using this framework on SJS which builds with GH actions.

@yurique I'll take a look at 3.x artifacts to see if there's anything wrong with them

Iurii Malchenko
@yurique
So another bit here: the jvm jar looks empty O_o
image.png
  libraryDependencies ++= Seq(
    "com.disneystreaming" %%% "weaver-core" % "0.6.0-M5" % Test
  )
I might be doing something wrong, I suppose.
Anton Sviridov
@keynmol

o_O ok I wonder if something on sonatype went wrong - I'll check the jars, but we can move this to https://gitter.im/disneystreaming/weaver-test room if you see this weirdness even in jvm jars.

M4 was definitely fine, M5 was released today, no idea what happened

Eric K Richardson
@ekrich
@sjrd JUnit even looks better now that the new version of Scala Native will have it too :smile:
Anton Sviridov
@keynmol
(update: 'twas indeed a IDEA issue with 3.0.0-M3 specifically, the jars contain .class, .sjsir and .tasty files)
Iurii Malchenko
@yurique

JUnit works like a charm.

For anyone following, here’s how to enable it:

.enablePlugins(ScalaJSJUnitPlugin)

(there was a J missing before the Unit — doesn’t work that way =) )

I was too soon, when I ran the tests with ++3.0.0-M3, this happened:

Error while loading test class app.tulz.tuplez.TupleCompositionTests failed: java.lang.ClassNotFoundException: Cannot find app.tulz.tuplez.TupleCompositionTests$scalajs$junit$bootstrapper$,

(tests ran successfully for 2.13 and 2.12)

though I’m getting this message for both JS and JVM with 3.0.0-M3
Iurii Malchenko
@yurique
I take the last one back – I had the ScalaJSJUnitPlugin enabled for the jvm project as well. Now, I removed it and
jvm+3.0.0-M3: tests run
js+3.0.0-M3+ScalaJSJUnitPlugin: tests won’t run, with the above error
Iurii Malchenko
@yurique

oh boy, so this all came from me adding a check for scala version when setting the scalacOptions and putting this into the build.sbt:

  scalacOptions := (CrossVersion.partialVersion(scalaVersion.value) match { … }

:= instead of ++= 🤦

Jeff Lewis
@lewisjkl
@yurique re: tailwind do you have any examples on hand that I could look at? Also any reason specific why you choose webpack directly rather than using ScalaJS bundler?
And thanks for the response :)
Iurii Malchenko
@yurique

@lewisjkl as for not using the bundler – it was quite a while ago, I can barely remember… maybe I couldn’t customize something I wanted to, or something like that, and found it easier back then to handle webpack manually.

Also, as of now I like it better this way: running ~fastLinkJS in one terminal and webpack serve in another :) (thinking to try the snowpack)

I’ve made this g8 template a while ago (it’s a bit outdated – it's on my TODO, but the tailwind stuff has barely changed since then): https://github.com/yurique/scala-js-laminar-starter.g8

Jeff Lewis
@lewisjkl
Thanks for the info and the g8! I used snowpack on my last front end and it was pretty awesome. Definitely a rougher road to travel since there are less resources when something goes wrong. Cool stuff though and excited for Snowpack 3
Jack Koenig
@jackkoenig
Can Scalac or the Scala 3 compiler themselves be compiled with ScalaJS?
I'm imagining something like ScalaFiddle that runs completely in your browser
Sébastien Doeraene
@sjrd
No, they can't. They rely too much on JVM-only stuff like synchronous file access and Java libraries.
Michael Pilquist
@mpilquist

I'm running in to some issues when upgrading FS2 to sjs 1.4.0. Some are self inflicted due to use of .isInstanceOf[Int], which I've fixed. However now I'm seeing runtime exceptions like this:

Exception: scala.scalajs.js.JavaScriptException: TypeError: dest.u.set is not a function

Looking in the compiled js, I see:

$ac_I.prototype.copyTo = (function(srcPos, dest, destPos, length) {
  $arraycopyCheckBounds(this.u.length, srcPos, dest.u.length, destPos, length);
  dest.u.set(this.u.subarray(srcPos, ((srcPos + length) | 0)), destPos)
});
Sébastien Doeraene
@sjrd
Hum, you may be running into a bug in the new Array encoding.
That method you see is used for System.arraycopy calls. It seems dest might not be an Array value.
It could be our fault, but it could also be on your side if you call System.arraycopy with a 3rd parameter than is not an Array value.
Michael Pilquist
@mpilquist
thanks, I definitely have some System.arraycopy calls, I'll poke around there
stuff like:
def copyToArray[O2 >: O](xs: Array[O2], start: Int): Unit =
      if (xs.isInstanceOf[Array[AnyRef]])
        System.arraycopy(values, offset, xs, start, length)
      else {
        values.iterator.slice(offset, offset + length).copyToArray(xs, start)
        ()
      }
repeat for each primitive type -- guessing one of those isInstanceOf calls changed behavior
Sébastien Doeraene
@sjrd
They shouldn't have. If they have, that's a bug on our side.
aappddeevv
@aappddeevv
I put together a scala.js, react lazy loading, dynamic modules example. Let me know if it does not work for you: https://github.com/aappddeevv/scalajs-dynamic-modules
Sébastien Doeraene
@sjrd
Oh cool :)
aappddeevv
@aappddeevv
It worked the first time, which is always wonderful.
Sébastien Doeraene
@sjrd
@mpilquist If you manage to minimize the bug or even just give a reproduction, I'd be happy to see a bug report :)
Michael Pilquist
@mpilquist
yep, will do -- i confirmed that commenting out all the arraycopy calls in fs2.Chunk fixes, will narrow it down more and update you one way or another
Sébastien Doeraene
@sjrd
Thanks!
Michael Pilquist
@mpilquist

Alright, I narrowed it down to this, which "worked" on 1.3.1 and throws on 1.4.0:

    val src: Array[Int] = new Array[Int](10)
    val dest: Array[AnyRef] = new Array[AnyRef](10)
    System.arraycopy(src, 0, dest, 0, 10)

Seems fair to me as this throws ArrayStoreException on the jvm

Sébastien Doeraene
@sjrd
Ah! That makes sense, indeed. In that case I'm afraid it's a bug in your code indeed, since it doesn't work on the JVM.
It worked by chance before.
Michael Pilquist
@mpilquist
yep
aappddeevv
@aappddeevv
I need to pass an async iterator to a js API. Has anyone found any patterns in scala.js that can help interface to this type of requirement? I need this server-side/node.js so I'm wondering if a package like https://github.com/achingbrain/it could help with interfacing to scala.js.
Iurii Malchenko
@yurique
does anyone know if it possible to enable a plugin only for .js project when using crossProject(…).crossType(Pure)? (for the ScalaJSJUnitPlugin)
Sébastien Doeraene
@sjrd
.jsConfigure(_.enablePlugins(...))
Iurii Malchenko
@yurique
Thank you! (how did I miss that?.. 🤔)
Eric K Richardson
@ekrich
Is there a parallel one for Scala Native? I couldn't find one.