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

Publish for 2.12/2.13? #159

Closed
armanbilge opened this issue Jul 4, 2022 · 3 comments · Fixed by #162
Closed

Publish for 2.12/2.13? #159

armanbilge opened this issue Jul 4, 2022 · 3 comments · Fixed by #162

Comments

@armanbilge
Copy link
Contributor

armanbilge commented Jul 4, 2022

Thrilled to discover this project yesterday! It scratches a real itch :)

I understand the codec derivation features rely on Scala 3, but I assume it should be straightforward to cross-compile the parser and Node AST for Scala 2.12/2.13? The parser and Node AST is sufficient to enable a circe-yaml frontend for example.

Happy to do the work to split into version-specific sources if 👍

Discussion on the importance of 2.12 (and 2.13) support is in:

I noticed that the advice in #102 (comment) is to use CrossVersion.for2_13Use3 but the consensus seems to be to avoid this technique for libraries. See also:

Thanks!

@armanbilge
Copy link
Contributor Author

Yeah, AFAICT for2_13Use3 just doesn't work. Example:

//> using scala "2.13.8"
//> using lib "org.virtuslab:scala-yaml_3:0.0.4"
//> using option "-Ytasty-reader"

object Main {
  val myYaml = """foo: - bar"""
  def main(args: Array[String]): Unit =
    org.virtuslab.yaml.asNode(myYaml)
}
Compiling project (Scala 2.13.8, JVM)
[error] ./bug.scala:8:5: object asNode is not a member of package org.virtuslab.yaml
[error] did you mean Node?
[error]     org.virtuslab.yaml.asNode(myYaml)
[error]     ^^^^^^^^^^^^^^^^^^^^^^^^^
Error compiling project (Scala 2.13.8, JVM)

@kpodsiad
Copy link
Contributor

kpodsiad commented Jul 6, 2022

Hey @armanbilge, feel free to do it. Scala 2 is still the largest piece of cake in ecosystem and enabling to work with YAML in ScalaJS and ScalaNative might be useful for some people. Piggybacking on circe encoders should cover almost all of use cases.

This was more a fun & research project, but I don't see a reason why not shape it into more mature and stable one.

@armanbilge
Copy link
Contributor Author

@kpodsiad thanks! I opened #162.

This was more a fun & research project, but I don't see a reason why not shape it into more mature and stable one.

It was? 😅 looks fairly serious to me actually, but maybe you folks have a different idea of fun 😛

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

Successfully merging a pull request may close this issue.

2 participants