!kcOuJGXBoqBVSCYYAy:matrix.org

Scala JS

950 Members
Scala.js, the Scala to JavaScript compiler5 Servers

Load older messages


SenderMessageTime
27 Jan 2023
@_discord_192322936219238400:t2bot.ioAly Can you share how you're including the dependencies in your build file 01:50:38
@_discord_754506755307733082:t2bot.iobeees In my build.sbt
lazy val root = project
  .in(file("."))
  .enablePlugins(BuildInfoPlugin, LambdaJSPlugin, Smithy4sCodegenPlugin)
  .settings(
    scalaVersion          := "3.2.1",
    libraryDependencies ++= Seq(
      "org.typelevel"    %%% "cats-effect"         % "3.4.5",
      "org.http4s"       %%% "http4s-ember-client" % "0.23.18",
      // logging
      "com.company.name" %%% "logging-core"        % "0.0.17",
    )
  )
01:54:24
@_discord_192322936219238400:t2bot.ioAly How about in logging-core? 01:55:32
@_discord_754506755307733082:t2bot.iobeees
lazy val loggingCore = crossProject(JSPlatform, JVMPlatform)
  .crossType(CrossType.Pure)
  .in(file("core"))
  .settings(commonSettings)
  .settings(
    name := "logging-core",
    libraryDependencies += catsCore.value,
    libraryDependencies += catsEffect.value,
    libraryDependencies += catsKernel.value,
    libraryDependencies += catsEffectKernel.value,
    libraryDependencies += catsMTL.value,
    libraryDependencies += circeCore.value,
  )
01:56:46
@_discord_192322936219238400:t2bot.ioAly Hmm ok 01:57:08
@_discord_754506755307733082:t2bot.iobeees Where each dependency is
object Dependencies {
  lazy val catsKernel = Def.setting("org.typelevel" %%% "cats-kernel" % Versions.cats)
  ...
01:57:26
@_discord_192322936219238400:t2bot.ioAly If you root/dependencyTree does it show you the offender pulling in JVM fs2? 01:57:34
@_discord_754506755307733082:t2bot.iobeees Oh good idea. Looks like a lot of output so I'll investigate, thanks! 02:00:19
@_discord_192322936219238400:t2bot.ioAly You should be able to search for io_3 being imported by something that's sjs1_3 02:00:53
@_discord_754506755307733082:t2bot.iobeees Hmm, looks like an http4s lib... 02:01:58
@_discord_754506755307733082:t2bot.iobeees Oh no. I think we did miss changing a %% to %%% 🤦 02:03:17
@_discord_754506755307733082:t2bot.iobeees Good looking out! 02:03:29
@_discord_192322936219238400:t2bot.ioAly 🥳 02:05:02
@_discord_754506755307733082:t2bot.iobeees Yes! Was able to compile after another publishLocal, thanks! That's probably the #1 error here isn't it 😅 02:07:51
@_discord_192322936219238400:t2bot.ioAly So common we have https://sca.la/percent for it ;P 02:08:10
@_discord_754506755307733082:t2bot.iobeees 💯 02:09:07
@_discord_754506755307733082:t2bot.iobeees That's amazing. 02:09:10
@_discord_989449122090197005:t2bot.iomichal.przysucha joined the room.12:40:08
@_discord_464856105986555919:t2bot.ioarne#2177 how do I compile my throwaway /tmp/scratch.scala to javascript when experimenting? 13:29:31
@_discord_464856105986555919:t2bot.ioarne#2177 I could not find documentation for a scalac equivalent to compile my single file throw away hello world program 13:30:11
@_discord_904983475847847967:t2bot.iogzm0#3662 there is a cli, but its not easy to use (you need to compile and link). 13:37:30
@_discord_904983475847847967:t2bot.iogzm0#3662 much easier to just dump the 2 boilerplate files into /tmp/ to configure sbt and then run sbt. 13:37:48
@_discord_904983475847847967:t2bot.iogzm0#3662 basically the stuff here: https://www.scala-js.org/doc/tutorial/basic/ 13:38:46
@_discord_116289795570925569:t2bot.ioWiseTree#5397 You could use scala-cli for that, e.g.

potato.sc:
//> using platform "scala-js"
println("hello")


$ scala-cli run potato.sc

Downloading Scala.js CLI
Compiling project (Scala 3.2.0, Scala.js)
Compiled project (Scala 3.2.0, Scala.js)
hello

$ scala-cli package potato.sc
Compiling project (Scala 3.2.0, Scala.js)
Compiled project (Scala 3.2.0, Scala.js)
Wrote /home/dpol/temp/potato.js, run it with
  node ./potato.js

$ node ./potato.js
hello
13:46:54
@_discord_904983475847847967:t2bot.iogzm0#3662 oh, nice, I didn't know that. 13:56:38
@_discord_167571481432162305:t2bot.iopolux joined the room.16:14:26
@_discord_632729825647525922:t2bot.ioekrich#7695 Is the minimum sbt for Scala.js, scripted etc. still 1.1.6? 16:36:02
@_discord_690242411146117177:t2bot.iosjrd#7815 We only test with 1.3.x+ nowadays, but we still compile against the 1.0.0 API. 🤷‍♂️ 17:20:14
@_discord_690242411146117177:t2bot.iosjrd#7815 For cross project you need 1.2.x+, though 17:20:45
@_discord_632729825647525922:t2bot.ioekrich#7695 Thanks, for the info. 23:29:47

There are no newer messages yet.


Back to Room List