-
Notifications
You must be signed in to change notification settings - Fork 83
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
mdoc.js is brittle to Scala.js updates #601
Comments
This sounds like a good starting point to address this issue without infrastructural changes.
This also sounds like a good approach to mitigate problems. The sbt plugin can add any custom sbt settings/tasks similar to how it already updates libraryDependencies
We've gone back and forth on whether mdoc should include the full Scala version in the binary name. Because mdoc only touches a small part of the public scala-compiler API (trigger compilation, read diagnostics) that rarely breaks we concluded it was better to not go that route because 1) it would dramatically complicate the mdoc build and 2) require users to bump up their mdoc version every time they upgrade Scala. |
Thanks for the response.
I agree with the trade-offs here, except we are already in this sort of not-so-nice situation :) e.g. consider the situation in outwatch/outwatch#573 (comment) which requires lots of manual intervention and magic versions. Although I suspect solving problem (2) well would make problem (3) go away. |
I agree. Full cross-compilation is helpful when you depend directly on source compatible but binary incompatible APIs. That’s not the case here because my understanding is that the APIs we touch from Scala.js are binary compatible. |
I need to study exactly what triggers the |
Are there any sbt settings we could inject with the plugin to resolve the cross-version conflicts? |
i would prefer to erase the dependency from the sbt plugin side. Many people use mdoc outside of sbt |
I think we can do what we need with an mdoc/mdoc-sbt/src/main/scala/mdoc/MdocPlugin.scala Lines 90 to 95 in 3078e6f
|
To be able to access the user's Scala.js version in the mdoc plugin, we'd need to add a dependency to the Scala.js plugin. @olafurpg would that be ok? |
I am currently working on this. |
We should avoid the direct scala-js dependency from sbt-mdoc if we can avoid it. You can often avoid the direct dependency by either using sbt reflection ( mdoc/mdoc-sbt/src/main/scala/mdoc/MdocPlugin.scala Lines 186 to 190 in 3120b1d
|
Yes it's in good hands. Although @keynmol I think the sbt reflection thing might be better if possible. |
Using mdoc.js is fantastic :) However, there is some friction surrounding updates. Here are some thoughts/notes.
scalaJSVersion
from sbt-scalajs in the user's build, and bring in the right version of its dependencies. Otherwise, publishing for every Scala.js (minor) release is necessary, or users will have to apply a workaround (see 3 below)._2.13
, however it includes a dependency to the Scala.js compiler with the full suffix e.g._2.13.6
. This created errors when I attempted to manually add the latest Scala.js linker/compiler dependencies in my 2.13.7 project, as a workaround for problem (2).The text was updated successfully, but these errors were encountered: