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

Unify Json and Ppx_deriving_runtime #36

Open
jchavarri opened this issue Nov 19, 2024 · 3 comments
Open

Unify Json and Ppx_deriving_runtime #36

jchavarri opened this issue Nov 19, 2024 · 3 comments

Comments

@jchavarri
Copy link
Member

Idea by @andreypopp (pls explain more deets if you think I'm missing): Unify Json and Ppx_deriving_runtime modules.

Upside: Shorter name, easier to find.
Downside: might lead to larger JavaScript bundles for people not using the PPX.

To mitigate the downside, maybe we could create a new Melange_json module that includes both? I have always thought that the top level Json module is a bit presumptuous.

cc @anmonteiro

@andreypopp
Copy link
Collaborator

Thanks for opening the issue, @jchavarri. So yeah, I propose to make a single lib which is usable both by user-written code and function as a runtime lib for ppx.

There's already a big overlap between the Json and Ppx_deriving_json_runtime so people who use both now — will have code duplicated in the bundle. So essentially I propose to dedupe code.

Another advantage is that Ppx_deriving_json_runtime now works for code which is compiled both to native and to melange and besides encoding/decoding it also provides functions to parse JSON, classify JSON (useful for custom decoding). So I think Ppx_deriving_json_runtime is useful standalone (without ppx) but is awkward to use because of its name.

At the same time, I agree with @jchavarri that the chosen Json name is too presumptuous, I like Melange_json.

@andreypopp
Copy link
Collaborator

andreypopp commented Nov 21, 2024

I think this also addresses #9

@davesnx
Copy link
Member

davesnx commented Nov 21, 2024

I think JSON is nice ^^

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

No branches or pull requests

3 participants