8000 Doc improvements by jonas · Pull Request #488 · circe/circe · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 4 commits into from
Dec 1, 2016
Merged

Doc improvements #488

merged 4 commits into from
Dec 1, 2016

Conversation

jonas
Copy link
Contributor
@jonas jonas commented Dec 1, 2016

As discussed on Gitter a few minor tweaks to the Scaladoc and document limitation regarding parsing of numerical values on Scala.js.

@codecov-io
Copy link
codecov-io commented Dec 1, 2016

Current coverage is 81.26% (diff: 100%)

Merging #488 into master will increase coverage by 0.04%

@@             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          

Powered by Codecov. Last update 198d257...1b473e4

Copy link
Member
@travisbrown travisbrown left a 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].
Copy link
Member

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".

Copy link
Contributor Author

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]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/loose/lose/

Copy link
Contributor Author

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:
Copy link
Member

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.

Copy link
Contributor Author
@jonas jonas Dec 1, 2016

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 Longs 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
Copy link
Member

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.

@travisbrown
Copy link
Member

👍

@travisbrown travisbrown merged commit 07f1a4a into circe:master Dec 1, 2016
@jonas jonas deleted the doc-improvements branch December 1, 2016 17:46
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 this pull request may close these issues.

3 participants
0