-
Notifications
You must be signed in to change notification settings - Fork 3
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
Port ppx from andreypopp/ppx_deriving #10
Conversation
I renamed all appearances of
I tried cleaning this up but didn't see any obvious / easy things to remove. For now I just moved I also updated the ppx readme to remove custom opam repo addition as it won't be needed anymore, added a changelog entry, and fixed the 4.14 compatibility. The last remaining thing that I can think of is fixing CI for nix, @anmonteiro could you give me a hand with that please? 🥺 |
another thought on naming, maybe for ppx it's better to have ppx in its name?
I quite often use |
Yes, I like that naming much more. It's also consistent with other ppxs in Melange ecosystem, like the pervasive |
@andreypopp I did the renaming in d3c6e5d.
I wasn't sure how to use the same name for both (there can only exist one public lib name at the moment), so I went with |
Actually |
ah, yeah, not possible to have clashes in public names, but not a big deal, these libs will be added by dune automatically once you use a corresponding ppx |
I'm also wondering what your preference is regarding the ppx being its own package, e.g.
No strong preference here, just providing an alternative |
I pushed a commit fixing this |
few more points:
|
other options:
the nice thing about splitting away native ppx is that we won't impose yojson dep on melange users and we won't impose melange dep on native users |
@andreypopp could you elaborate on how this unification would look like?
I prefer the "single package, until proved otherwise" approach. Having a single package makes things easier for maintainers and users. The "until proved otherwise" means that if some user some day (or ourselves), comes with a legit use case where separate packages are needed, then we can always split. Otherwise, it seems like a preoptimization. A couple of examples where multi package made things harder for us in the past (in this case, it's
Maybe I am missing what are the main upsides of having multiple packages? The "worst" part of single package is that as a user I am downloading and installing deps that I am not using, but all things considered it doesn't outweight the downsides imo. |
Done in 3a31039. |
@jchavarri the ppx runtime uses this exception and melange-json has DecodeError, so I think ppx runtime should also use DecodeError — that way if users would want to catch the exception and recover — they will only have to do this for DecodeError. |
The README still mentions yojson/native. By the way, should we move docs from this README to the main project README, why have two? |
updated the ppx to use
both should be fixed in 19fcb09. |
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.
All looks good to me, thank you!
CHANGES: - Port PPX from @andreypopp/ppx_deriving_json ([melange-community/melange-json#10](melange-community/melange-json#10))
CHANGES: - Port PPX from @andreypopp/ppx_deriving_json ([melange-community/melange-json#10](melange-community/melange-json#10))
This PR ports @andreypopp's PPX to this repo.
For now, the current state is "Edit: all issues have now been fixed.dune build
works" 😅 . But it's a good point to open discussion.Proposal
The idea is to offer the json PPX as part of the
melange-json
package. As an addition, native compatibility is offered as well through Yojson.Having everything in a single repo / package makes maintenance easier for maintainers, and usage more straight forward for users.
(As a nice side effect, we got GH actions workflow for opam 💰 )
Questions
-native
? I personally think it's cleaner to leave the current approach with its own ppx / exeppx_deriving_json_browser
browser
andnative
suffixes (suffices?) ok?TODO