Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scala JS always uses CrossVersion.for3Use2_13 #1024

Open
JD557 opened this issue Jan 13, 2024 · 0 comments · May be fixed by #1054
Open

Scala JS always uses CrossVersion.for3Use2_13 #1024

JD557 opened this issue Jan 13, 2024 · 0 comments · May be fixed by #1054

Comments

@JD557
Copy link
Contributor

JD557 commented Jan 13, 2024

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

def renderSbt(lib: ScalaDependency): String =
s"${renderSbtCross(lib)} cross CrossVersion.for3Use2_13"

Maybe it should look like

def renderSbt(lib: ScalaDependency): String = {
if (Some(lib) == runtimeDependency) renderSbtDouble(lib)
else if (lib.target.binaryScalaVersion.startsWith("2.13"))
s"${renderSbtDouble(lib)} cross CrossVersion.for3Use2_13"
else renderSbtDouble(lib)
}
? Not sure.

Screenshot ( Optional )

No response

Version

Scastie website

What browsers are you seeing the problem on?

No response

Relevant log output

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant