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

Adds FromJSON instances to enable Share Persistent JSON caching. #5576

Merged
merged 2 commits into from
Feb 11, 2025

Conversation

ChrisPenner
Copy link
Contributor

@ChrisPenner ChrisPenner commented Feb 11, 2025

Overview

I'm adding a persistent caching layer for JSON values on Share, see unisoncomputing/share-api#35
, and for that we need to be able to round-trip a bunch of stuff that previously only needed to be rendered.

This adds the matching FromJSON instances for types which previously only had ToJSON.

Implementation notes

Adds FromJSON instances.

Interesting/controversial decisions

Nope

Test coverage

I tested roundtripping Term Definitions and rendered docs in Share here: unisoncomputing/share-api#35

@ChrisPenner ChrisPenner marked this pull request as ready for review February 11, 2025 17:20
@ChrisPenner
Copy link
Contributor Author

I think this is ready, but CI is failing due to binary caches so it's hard to tell

@@ -329,10 +329,21 @@ instance ToCapture (Capture "namespace" Path.Path) where
"E.g. base.List"

instance ToJSON Path.Path where
toJSON p = Aeson.String (tShow p)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Using Show in a ToJSON kinda makes me nervous, so I found the explicit combinator it was calling.

@aryairani aryairani merged commit 8d287d6 into trunk Feb 11, 2025
32 checks passed
@aryairani aryairani deleted the cp/json-caching branch February 11, 2025 18:21
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.

2 participants