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
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.
Sébastien Doeraene
@sjrd
There should be .nativeConfigure
Eric K Richardson
@ekrich
If it is there, it doesn't seem visible.
If it's in a Build.scala, it might need an explicit import of the autoImport._ members.
Victor Hiairrassary
@vhiairrassary

Hi there :wave: I have a couple of open pull requests for different repositories around Scala.js. Ideally, I would love to get feedbacks & be able to participate in the community. (feel free to discard this comment if it is not in the correct conversation)
scalajs-bundler:

Anyway, thank you to all the people involved in this project and for the time spent!

1 reply
Sébastien Doeraene
@sjrd
Hi @vhiairrassary. Sorry we haven't been responsive so far. I don't put my head into scalajs-bundler or scalajs-dom very often. I'll try to allocate time this week to look at those.
1 reply
Eric K Richardson
@ekrich
@sjrd I was using build.sbt and it is there and works - for some reason Metals does not find it. With the 1.0.0 plugin, everything is like magic - so used to imports, enables, etc.
Andreane Schultz
@Andreane56_gitlab
Thanks yo for posting that it could be just the in thing to give inspiration to someone who need it! Keep up the great work. https://www.myaarpmedicare.review/
Dave Smith
@davesmith00000
Hi @sjrd - I was wondering if I could ask your opinion: I'm going to pass a potentially large nested case class structure (also contains ADTs but could possibly be factored out if that helps) to a Web Worker. What do you think is the most efficient/performant way to convert the structure to JS objects and back? (worker interface takes js.Any I believe)
I'm currently hand rolling it all using js.Dynamic.literal() to produce a crude codec, which is boring but ok, but I'm wondering about the allocate costs of such a thing (?) and thought I'd see if there was a simpler/better solution? I would be doing this 60 times per second...
Sébastien Doeraene
@sjrd
I don't really have a good suggestion. It's either literal()s, or serializing a to an ArrayBuffer. An ArrayBuffer would probably be quicker to allocate, but you have to pay the price of serialization and deserialization. Only measuring can decide which is truly better.
Anton Sviridov
@keynmol

we don't use web workers, but for lots of small objects we do use literals, but our data structures are small and not recursive, so hand cranking those codecs is simple.

In a different usecase with a huge recursive case class I'm using upickle, but the size of the result doesn't please me - so I want to give boopickle a go, which should improve the serialisation roundtrip. I wonder if it can benefit from 1.4.0 typed array improvements?

Dave Smith
@davesmith00000
Thanks both, good to know. 👍
Anton Sviridov
@keynmol
If you do get round to benchmarking - let us know how it goes :)
Dave Smith
@davesmith00000
I will, though don't hold your breath, I'm still in the "gosh I hope this works at all" stage. 😉
Andriy Plokhotnyuk
@plokhotnyuk
@davesmith00000 @keynmol Here are results of parsing and serialization of different data types and message samples in browsers using different JSON libraries, including uPickle. Sources of benchmarks are here, and instructions how to build and run them are here. Feel free to try with your data structures and codecs.
Dave Smith
@davesmith00000
That's a great page, thanks! One slight wrinkle is that I'm trying to avoid macro based systems at the moment since I'm targeting Scala 2 & 3, so I'd need to be carefully about which libraries I used. The other thing is that I'm running on an assumption (always dangerous...) that although full serialisation would be easier (much!), it's probably heavier than a conversion to a native JS objects - no parsing for one thing.
Anton Sviridov
@keynmol
damn @plokhotnyuk that's awesome. I don't have no-macro requirements as Dave does, so I'll check out everything on that page and see how it works out for my particular usecase
Andriy Plokhotnyuk
@plokhotnyuk
@keynmol Cool! Any you feedback will be greatly appreciated! Also, if you can give a description of your usecase please share it in the project chat.
Sébastien Doeraene
@sjrd
All interested: should we create a gitter8 template for Scala.js? And if yes, what should it contain? scala-js/scala-js#4390
Martijn
@martijnhoekstra:matrix.org
[m]
I would love a g8 template that has a shared jvm/js lib project and a js web project, if at all possible cross-building with scala3
Anton Sviridov
@keynmol
I think it's a rad idea, so I put a few ideas on the issue
Hanns Holger Rutz
@Sciss
My understanding is that in 1.4 Array[Byte] will be represented by a typed-array, like Int8Array? Then, if I have an ArrayBuffer, is there a straight forward way to get an Array[Byte] without copying? Like is there a better way than doing new Int8Array(ab).toArray[Byte] (is that even correct?)?
Tobias Schlatter
@gzm0
@Sciss there isn't a way to do this without copying.
Hanns Holger Rutz
@Sciss
ok. is toArray[Byte] correct then?
Tobias Schlatter
@gzm0
Yes, if you need an Array[Byte]. Alternatively, if you use ByteBuffer, you can avoid copying.
Uh, actually, I don't think you need the type parameter. Lemme check.
(btw. all of this is not new in 1.4.0)
Hanns Holger Rutz
@Sciss
ok, thanks. Can't use ByteBuffer in this case.
Tobias Schlatter
@gzm0
Hanns Holger Rutz
@Sciss
cheers
unarist
@unarist
I wonder if supporting Dynamic module loading in sjs 1.4 also means js.import() is compatible with fullLinkJS...
Sébastien Doeraene
@sjrd
It's compatible. But as soon as you choose to emit ES modules, the sbt plugin will deactivate Closure.
unarist
@unarist
oh, I forgot that sjs deactivate closure with ESM outputs
So it means less optimized for size or performance than CJS outputs?
unarist
@unarist
(I've used js.Function to wrap import()calls to use it in CJS outputs though)
Sébastien Doeraene
@sjrd
It's less optimized for size. But it's typically more performant.
It seems ES modules are faster than CommonJS modules, which are themselves faster than scripts.
unarist
@unarist
Oh really? I will take a look later. thanks!
Iurii Malchenko
@yurique
Hi everyone.
Following the footsteps of @lolgab (https://github.com/lolgab/scalajs-snowpack-example — kudos!) I’ve made a more complete example of using the Snowpack with Scala.js: https://github.com/yurique/laminar-snowpack-example
Tobias Schlatter
@gzm0
@yurique @lolgab in case you have any experience with snowpack incremental build times combined with module splitting in SmallestModules mode, I'd love your input on #4327.