Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Feb 17 23:24
    steinybot commented #21
  • Feb 17 23:23
    steinybot commented #21
  • Feb 17 22:56
    steinybot commented #21
  • Feb 01 11:45
    cquiroz opened #148
  • Jan 28 22:30
    steinybot opened #147
  • Jan 23 11:41
    scala-steward closed #145
  • Jan 23 11:41
    scala-steward commented #145
  • Jan 23 11:41
    scala-steward opened #146
  • Jan 21 10:25
    scala-steward closed #138
  • Jan 21 10:25
    scala-steward commented #138
  • Jan 21 10:25
    scala-steward opened #145
  • Dec 04 2020 19:11
    scala-steward closed #142
  • Dec 04 2020 19:11
    scala-steward opened #144
  • Nov 15 2020 17:01
    scala-steward opened #143
  • Nov 03 2020 15:26
    scala-steward opened #142
  • Oct 15 2020 11:25

    mathieuleclaire on master

    Update sbt-scalajs, scalajs-com… Merge pull request #141 from sc… (compare)

  • Oct 15 2020 11:25
    mathieuleclaire closed #141
  • Oct 15 2020 11:15
    scala-steward opened #141
  • Sep 28 2020 18:17
    ochrons closed #140
  • Sep 28 2020 18:17
    ochrons commented #140
Otto Chrons
@ochrons
that failure was just some jdk9 thing, works on jdk10
elyphas
@elyphas

Hi, someone could tell me? please, why I get this error:

Cannot materialize pickler for non-case class: Either[String,T]. If this is a collection, the error can refer to the class inside.
[error]             val unPickle = Unpickle[Either[String, T]].fromBytes(value)

with this code:

  def searchDescripCatalog[T](id: String, component: Handler[String], resource: String) = {
    val payload = Pickle.intoBytes[String](id)
    val respondWS = client.send(resource :: Nil, payload, SendType.WhenConnected, 30 seconds)
    respondWS.failed.foreach(println)
    respondWS.onComplete {
      case Success(value) =>
        value match {
          case Right(value) =>
            val unPickle = Unpickle[Either[String, T]].fromBytes(value)
            unPickle match {
              case Right(value) => component.onNext(value.descripcion.getOrElse(""))
              case Left(error) =>
                org.scalajs.dom.window.prompt(error)
            }
          case Left(value) =>  org.scalajs.dom.window.prompt(value)
        }
      case Failure(exception) => org.scalajs.dom.window.prompt(exception.getMessage)
    }
  }
Otto Chrons
@ochrons
you don't provide a Pickler[T]
elyphas
@elyphas
Ah, ok thank you
Bjørn Madsen
@aeons
@ochrons ah ok, is there a release on 2.13 on the way?
Otto Chrons
@ochrons
will do tonight
Bjørn Madsen
@aeons
great, thanks! :)
Otto Chrons
@ochrons
published 1.3.1 for 2.13 now :)
Bjørn Madsen
@aeons
:rocket:
Nils Kilden-Pedersen
@nilskp
Does anyone have an example of how to create a pickler for a collection, in my case immutable.TreeMap that contain types that don't already have a pickler?
In other words, I can't seem to pickle any case class that contains a collection with a type not doesn't have default pickler.
Otto Chrons
@ochrons
did you look at the Boopickle source code on how the collection picklers are implemented?
Nils Kilden-Pedersen
@nilskp
No, I was hoping there was an example. Do you have a specific file I should look at?
note the collections changed a lot in 2.13, so there is a different implementation for that version
Nils Kilden-Pedersen
@nilskp
@ochrons is it a known/deliberate limitation, that case classes containing collections with certain types, won't generate automatically? In my case, it's a TreeMap with LocalDate as key and a case class as value. I assume it's the LocalDate that's causing the issue, but even having a LocalDate pickler in scope doesn't seem to resolve the issue.
Otto Chrons
@ochrons
yea, it's a long standing issue, but not something that can be easily resolved
sometimes you just need to supply the pickler manually
Nils Kilden-Pedersen
@nilskp
Is it also an issue with TreeMap, due to the Ordering going along? It cannot use a simple collection.Map pickler for that, as the ordering would be lost.
Otto Chrons
@ochrons
could be, can you make a scalafiddle.io sample of the problem?
jhegedus42
@jhegedus42
can boopickle serialize a Map[String,SomeCaseClass[Any]] ?
Andriy Plokhotnyuk
@plokhotnyuk
Is Any for scala.Any?
jhegedus42
@jhegedus42
hmmm
good question
let's say
more like Map[String,ReferencedValue[_]]
I am not sure what is the difference betwen the two
but basically
actuall
yes
but you know what
i think i just store Map[String,JSON]
and then problem is solved :)
and use circe
Andriy Plokhotnyuk
@plokhotnyuk
Is it required to work with scala.js?
jhegedus42
@jhegedus42
will
well
yeah
ideally :)
Otto Chrons
@ochrons
same as all other serialization libraries, it needs to know the types at compile time and you need to provide picklers for them
Dermot Haughey
@hderms
anyone have any idea how much faster boopickle would be than circe?
especially if boopickle was using binary codecs
we are trying to serialize like 200MB of data
Andriy Plokhotnyuk
@plokhotnyuk
it depends a lot on payload and environment... as an example jsoniter-scala can serialize with speed up to 3Gb/sec... please see the full picture here
Dermot Haughey
@hderms
@plokhotnyuk thanks I'll give it a look
Otto Chrons
@ochrons
for text, Boopickle is not faster, but for something like numbers, especially floating point, it can be much much faster than any JSON codec
Boopickle comes with a performance test suite that you can easily modify to match your data and see the differences
Nils Kilden-Pedersen
@nilskp
@ochrons I'm surprised you write that, as JSON text needs to be escaped, unlike (presumably) Boopickle. At the very least that would lead to per-char checking, which might be cheap, but not free, and any object field will have a String name, which doesn't even exist in a binary codec.
Am I missing something?
Otto Chrons
@ochrons
not sure what you're asking :)
Nils Kilden-Pedersen
@nilskp
@ochrons I'm confused as to why you'd write that "for text, Boopickle is not faster".
It should be faster, since JSON de/serialization requires escaping, which Boopickle, being binary, presumably does not.