-
Notifications
You must be signed in to change notification settings - Fork 544
Doc improvements #488
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
Doc improvements #488
Conversation
Current coverage is 81.26% (diff: 100%)@@ master #488 diff @@
==========================================
Files 80 80
Lines 2199 2199
Methods 2090 2090
Messages 0 0
Branches 109 109
==========================================
+ Hits 1786 1787 +1
+ Misses 413 412 -1
Partials 0 0
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks again @jonas—I've got a couple of minor comments but this looks good to me.
@@ -6,7 +6,7 @@ position: 1 | |||
|
|||
# Parsing JSON | |||
|
|||
Circe includes a parsing module, which is a wrapper around the [Jawn][jawn] JSON parser. | |||
Circe includes a parsing module, which is on the JVM is a wrapper around the [Jawn][jawn] JSON parser and for JavaScript uses the built-in [`JSON.parse`][json.parse]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: "which is on the JVM is".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
## Warnings and known issues | ||
|
||
For Scala.js, the result of parsing JSON is restricted to the expressiveness of | ||
the JavaScript types. In particular numerical values may [loose precision][#393] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/loose/lose/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops
|
||
For Scala.js, the result of parsing JSON is restricted to the expressiveness of | ||
the JavaScript types. In particular numerical values may [loose precision][#393] | ||
when decoded by [`JSON.parse`][json.parse] to a JavaScript number. For example: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure "JavaScript number" is exactly the right phrasing here—it seems more like the problem is that you're trying to decode to a Scala type like Long
that has its own semantics, even if it's implemented using JavaScript numbers on Scala.js. I'm happy to work on details like this in a follow-up PR, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I've tried to clarify further. On Scala.js Long
s are represented with high/low pair to ensure the Scala semantics and StringLike.toLong
and java.lang.long.parseLong
works correctly for the issue mentioned in #393. My understanding is that JSON.parse coerces the value into a double at which point circe's JSON AST converter cannot do anything about it.
@@ -8,3 +8,4 @@ target/ | |||
.project | |||
.classpath | |||
tmp/ | |||
docs/src/main/tut/contributing.md |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks—I keep meaning to open a PR for this but hadn't yet.
9d5eba9
to
1b473e4
Compare
1b473e4
to
c19331f
Compare
👍 |
As discussed on Gitter a few minor tweaks to the Scaladoc and document limitation regarding parsing of numerical values on Scala.js.