Twirl templates no longer import TemplateN traits in Play 3.0.3 for Scala 3. #12643
Replies: 2 comments
-
Thanks for reporting this, this is an interesting use case. (Good to see HMRC sticking to Play btw 👍)
For me starting with Scala 2.13 the error messages are much clear now, thanks to so you now end up with e.g.
so I actually thought to totally remove
(and of course the twirl sbt plugins is still Scala 2.12 because sbt 1.0 uses Scala 2.12) (Hmm... thinking out loud, actually why didn't I drop it for Scala 2.13 then?) Now... thinking about your use case, we can go the opposite direction and re-add What do you think? I will come up with a pull request in the twirl repo and ping you from there. I could cut a twirl release quite fast so you can make use of it and not have to wait for the next Play 3.0.4 patch release. |
Beta Was this translation helpful? Give feedback.
-
This sounds great for us. We certainly don't have anywhere near 22 parameters. We'd be happy to wait for the 3.0.4 release - since the trait is just used in tests we can stick with 3.0.2 for now. |
Beta Was this translation helpful? Give feedback.
-
Generated twirl templates no-longer import the
TemplateN
traits (which are still present in the jar) in Play 3.0.3 for Scala 3 (This commit)Is there a particular reason for this? I appreciate that most twirl users will probably not be affected by this change, but we have tests that generically check that our twirl components render the expected html.
They look something like
Note, we have been unable to use structural typing to access the render function (which is still present)
since this gives
If these traits are no longer going to be implemented by the templates, are there any recommended alternatives?
Beta Was this translation helpful? Give feedback.
All reactions