scalacenter / scastie

An interactive playground for Scala
https://scastie.scala-lang.org
Apache License 2.0
433 stars 103 forks source link

Scala JS always uses CrossVersion.for3Use2_13 #1024

Open JD557 opened 7 months ago

JD557 commented 7 months ago

Describe the bug

Scala JS always uses CrossVersion.for3Use2_13, even for libraries that only work with Scala 3.

Scastie snippet link

No response

To Reproduce

  1. Create a Scala.js project
  2. Set the Scala version to Scala 3
  3. Add a Scala 3 only library
  4. Notice that the library is included with CrossVersion.for3Use2_13

Expected behavior

When the selected Scala version is Scala 3, scastie should use Scala 3 libraries.

I think the issue is https://github.com/scalacenter/scastie/blob/0e1f7bfd66dca4b239ef05d5e597de33fc68e4e6/api/src/main/scala/com.olegych.scastie.api/ScalaTarget.scala#L211-L212

Maybe it should look like https://github.com/scalacenter/scastie/blob/0e1f7bfd66dca4b239ef05d5e597de33fc68e4e6/api/src/main/scala/com.olegych.scastie.api/ScalaTarget.scala#L286-L291 ? Not sure.

Screenshot ( Optional )

No response

Version

Scastie website

What browsers are you seeing the problem on?

No response

Relevant log output

No response