!JjzcHCLEPukevAquAy:matrix.org

com-lihaoyi

353 Members
3 Servers

Load older messages


SenderMessageTime
28 Jan 2023
@_discord_448877036098813952:t2bot.iololgab#6138 I tried and it doesn't seem to work in mixed Scala/Java projects 16:44:48
@_discord_448877036098813952:t2bot.iololgab#6138 Can you open an issue in Mill? Does this work with Sbt? 16:45:27
@_discord_448877036098813952:t2bot.iololgab#6138 I tried and it doesn't work in Sbt as well... Probably this is not supported by the zinc toolchain.. 16:47:13
@_discord_448877036098813952:t2bot.iololgab#6138 If you switch to a JavaModule it works 17:03:17
@_discord_336897607882506242:t2bot.ioOverride#2623 i can't it's a scala module 🤔 22:51:14
@_discord_336897607882506242:t2bot.ioOverride#2623 well didn't need module-infos finally 22:51:29
29 Jan 2023
@_discord_1068887992158134292:t2bot.io10.varunshah changed their display name from 10.varunshah to 10.varunshah#0212.07:31:10
@_discord_1068887992158134292:t2bot.io10.varunshah changed their display name from 10.varunshah#0212 to 10.varunshah.07:31:15
@_discord_996899496233549844:t2bot.iochuong joined the room.14:23:42
@_discord_597155328022413313:t2bot.ioebo#9022 joined the room.15:05:05
@_discord_597155328022413313:t2bot.ioebo#9022 Hi, this is a very outdated SO question but one that I think deserves some dusting off with fresh new answers:

https://stackoverflow.com/questions/35847332/best-way-to-convert-a-case-class-to-a-js-object


I've managed using trait or class that extends js.Object in my Scalajs code, and everything is happy until you really, really want a case class (e.g. for copy, equality checks, JVM support, macros, etc.)

So to that end, the options for converting case class into js.Object seem pretty limited... One person mentioned using uPickle but it got downvoted! Circe also has a fairly performant approach.

I get that you'll never beat the speed of native js.Object, but what do people recommend presuming speed is not everything?
15:05:05
@_discord_597155328022413313:t2bot.ioebo#9022 based on my own reading, it seems circe has generic.auto._ for automatic implicit serdes definitions, which is nice. Whereas with uPickle, it's documented as faster (even compared to circe-jawn?) but requires explicit serdes defined in companion objects.

So, I'd lean towards the less code option (circe) but wanted to hear thoughts people have on this. Any other pros/cons to weigh in on the matter?
15:09:22
@_discord_845013677816021083:t2bot.ioarmanbilge#6192
even compared to circe-jawn
circe-jawn won't help in this case, it's for serializing/deserializing JSON, not js Objects
15:24:56
@_discord_845013677816021083:t2bot.ioarmanbilge#6192 however, you can look at circe-scalajs 15:25:06
@_discord_184666861974192128:t2bot.ioButanium joined the room.15:50:15
@_discord_597155328022413313:t2bot.ioebo#9022 yes that's what I'm using. My understanding (from reading the code) is circe-scalajs serializes case classes to JSON then encodes as js.Object. So that's why I thought it would help.

And, thanks to you, I saw they recently merged circe-jawn as a replacement to JSON.parse 🙂
15:50:27
@_discord_845013677816021083:t2bot.ioarmanbilge#6192
My understanding (from reading the code) is circe-scalajs serializes case classes to JSON then encodes as js.Object
yes, that's correct. basically, everything in Circe works with Json type. That is the common abstraction that the entire library is built around
15:51:38
@_discord_336897607882506242:t2bot.ioOverride#2623 Hey do you know a way to make mill print steps ? because they are useless in workflows 20:27:36
@_discord_336897607882506242:t2bot.ioOverride#2623image.png
Download image.png
20:27:54
@_discord_448877036098813952:t2bot.iololgab#6138 Do you want to disable these prints? If yes, you can pass --disable-ticker to the mill cli 20:34:19
@_discord_336897607882506242:t2bot.ioOverride#2623 kay thanks 20:46:09
@_discord_336897607882506242:t2bot.ioOverride#2623 * okay thanks 20:57:56
@_discord_336897607882506242:t2bot.ioOverride#2623 * yes, thank you it worked 🙂 20:58:18
@_discord_336897607882506242:t2bot.ioOverride#2623 * Hey do you know a way to make mill avoid print steps ? because they are useless in workflows 20:58:38
30 Jan 2023
@_discord_374513658056671233:t2bot.ioEnglishGent joined the room.08:06:04
@_discord_330764682204020737:t2bot.ioJoeyh021 changed their display name from Joeyh021 to Joeyh021#4140.12:15:54
@_discord_330764682204020737:t2bot.ioJoeyh021 changed their display name from Joeyh021#4140 to Joeyh021.12:16:06
@_discord_1069628806417104906:t2bot.ioSerenaSkov joined the room.14:48:15
@_discord_248556648237367297:t2bot.ioSpaceCowboy joined the room.15:50:59
@_discord_197205766841696266:t2bot.iotryangul joined the room.21:31:26

There are no newer messages yet.


Back to Room List