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 3 support plans? #390

Closed
rossabaker opened this issue Jan 5, 2021 · 13 comments
Closed

Scala 3 support plans? #390

rossabaker opened this issue Jan 5, 2021 · 13 comments

Comments

@rossabaker
Copy link

Are there plans to cross-publish Twirl for Scala 3? We have an http4s integration I'd like to keep alive, and we're trying to identify the correct repo structure as we reorganize ourselves.

Thanks for the great tool!

(Bonus keyword: Dotty)

@SethTisue
Copy link
Member

is there anyone watching the repo who would like to take a stab at a PR, even just to see what issues arise? you wouldn't need to commit to seeing it through to the end, any amount of progress would be helpful

@rossabaker
Copy link
Author

I was able to keep it working for now thusly:

      libraryDependencies.value.map {
        case module if module.name == "twirl-api" =>
          module.withDottyCompat(scalaVersion.value)
        case module => module
      }

I don't recommend publishing libraries on withDottyCompat, but it seems a fair interim solution for applications.

@SethTisue
Copy link
Member

There is a WIP PR at #394 that I intend to return to... hoping for May. We're a bit backed up dealing with the Bintray situation :-/

@SethTisue
Copy link
Member

I am sorry, but I think at this point I need to just admit that I'm unlikely to return to this, so I'm going to close my PR. Someone else is free to tackle it.

@brbrown25
Copy link
Contributor

I'd be willing to pick up work on this. I should have some availability next week

@mkurz
Copy link
Member

mkurz commented Nov 12, 2021

@brbrown25 That would be great! Is there anything I can help you with?

@brbrown25
Copy link
Contributor

@brbrown25 That would be great! Is there anything I can help you with?

I'll start hacking away at it and give you an update next week, just need to familiarize myself with the source as I've mostly been an end user of twirl!

@mkurz
Copy link
Member

mkurz commented Nov 12, 2021

@brbrown25 Thanks, if you need guidance please let me know.

@brbrown25
Copy link
Contributor

Update, making some good progress. Gonna push up my WIP draft tomorrow. I got most of the basics in place, just need to work through the compiler pieces!

@brbrown25
Copy link
Contributor

Update, the WIP pr has the correct structure and the most of the cross compilation works. Only thing outstanding is updating the scala 3 version of the compiler module. There's some notes in the discussion on the pr what places will be to be updated. Also the majority of warnings have been resolved except for the CollectionConverts helper

@shannonbarnes
Copy link

shannonbarnes commented Feb 25, 2022

I was able to keep it working for now thusly:

      libraryDependencies.value.map {
        case module if module.name == "twirl-api" =>
          module.withDottyCompat(scalaVersion.value)
        case module => module
      }

I don't recommend publishing libraries on withDottyCompat, but it seems a fair interim solution for applications.

This is how I am currently getting a project that uses twirl to cross-compile based on the above help.

libraryDependencies := {
      CrossVersion.partialVersion(scalaVersion.value) match {
        case Some((2, _)) => libraryDependencies.value
        case _ =>
          libraryDependencies.value.map {
            case module if module.name == "twirl-api" =>
              module.cross(CrossVersion.for3Use2_13).exclude("org.scala-lang.modules", "scala-xml_2.13")
            case module => module
          } ++ Seq("org.scala-lang.modules" %% "scala-xml" % "2.0.1")
      }
    }

@brbrown25
Copy link
Contributor

brbrown25 commented Feb 25, 2022

I was able to keep it working for now thusly:

@shannonbarnes the pr should hopefully get merged soon and then the interim solution can be replaced with the latest version :)

brbrown25 added a commit to brbrown25/twirl that referenced this issue Mar 16, 2022
mkurz added a commit that referenced this issue Mar 28, 2022
feat(scala3): WIP working on scala 3 cross compilation. #390.
@mkurz
Copy link
Member

mkurz commented Mar 28, 2022

Implemented in #461, please watch out for the twirl 1.6.0-M2 release coming this week, to help use test and give feedback.

@mkurz mkurz closed this as completed Mar 28, 2022
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

No branches or pull requests

5 participants