json4s / json4s

JSON library
http://json4s.org
Apache License 2.0
1.49k stars 329 forks source link

Dealing with scala.text.Document deprecation #199

Closed rossabaker closed 8 years ago

rossabaker commented 9 years ago

scala.text.Document is deprecated in Scala 2.11. This impacts the future of json4s-native, which depends on it. It's time to either:

  1. Deprecate json4s-native for eventual removal.
  2. Start considering a scala.text.Document replacement, and how to move to it in a minimally breaking fashion.

I don't have a strong opinion, but on the current course, an unhappy surprise is looming in Scala 2.12.

xuwei-k commented 9 years ago

I vote 2 "Start considering a scala.text.Document replacement"

rossabaker commented 9 years ago

A relevant thread from the Scala list.

dozed commented 9 years ago

Are there any reasons to keep json4s-native (and multiple backends)? Having only a single backend would simplify things, but also break existing code.

rossabaker commented 9 years ago

Not breaking existing code is one reason. (Though moving away from scala.text.Document will also break code, to a lesser degree.) The other reason is that -native carries one less dependency that can cause conflicts down the road.

I'm not strongly for or against keeping it. Just presenting the other side.

seratch commented 9 years ago

Although I'm not familiar with json4s-native (because I mainly use json4s-jackson), what do you think about the following option in the scala-lang ML thread?

I know its not the most palatable option, but given that it is a pretty small class, I would suggest to just take the code into your own project: https://github.com/scala/scala/blob/2.11.x/src/library/scala/text/Document.scala

Though this fix may bring users some breaking changes if the package is changed, can that help existing users?

rossabaker commented 9 years ago

That will break both binary and source compatibility, but it's an easy change: adjust scala.text import to org.json4s.native or whatever. If that class is removed from Scala, that's the least breaking change we can make.

sksamuel commented 8 years ago

At the moment scala.text.Document is still in 2.12 (and my guess is won't be removed until 2.13 or later if its not been taken out by M3). So a third option would be to just go with the status quo, and worry about doing something for a future 2.13 release, becuase nothing has actually changed between 2.11 and 2.12. And I'd really like to see a 2.12 build of json4s :)