-
Notifications
You must be signed in to change notification settings - Fork 105
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
Don't use CrossVersion.for3Use2_13 in Scala.js #1054
Open
JD557
wants to merge
1
commit into
scalacenter:main
Choose a base branch
from
JD557:scala3-js
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be
old3
. The reason is that Scastie can run all Scala versions and 3.0.0 is the one that we can use in all newer versions. If we use stableLTS, we won't be able to use versions below it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good point. I missed that (I thought you could only pick LTS and Next).
I do get an error compiling
apiJS3
when I change that:I'll see if I can find out what's going on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I think I know the reason. So this is caused because the Scala version is lower than some library on classpath.
So the fix has to be something different. The exact cause why we need this cross compilation is for our runtime macros that we use in worksheet to display value decorations. The error you see comes from play json dependency.
If I may suggest something:
Leave the versions
2.12
,2.13
andjs
.Then we should only handle the
runtime-scala
dependency to always cross compile:and handle the others in the way you've changed it to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried that initially, but that causes another problem:
runtime-scala
includesscalajs-dom
, so in this case it would pull the 2.13 versionSo any Scala 3 library that includes scalajs-dom then fails. :(
Maybe one alternative would be to use
"org.scastie" %%% "runtime-scala" % "1.0.0-SNAPSHOT" cross CrossVersion.for3Use2_13
if the scala target is lower than 3.3.0 and"org.scastie" %%% "runtime-scala" % "1.0.0-SNAPSHOT"
otherwise.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a fix for that in my Scala-CLI PR. I dropped play json and it should work. Until then I think there is nothing we can do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I wasn't aware of #997, that looks pretty exciting.
I'll eagerly wait for that, then 🙏