Fork me on GitHub

Clojurians-log, the publicly searchable archive of this Slack community, now renders emoji reactions. With thanks to @mitesh who did the bulk of the work on this. e.g.

🎉 60
👏 18
oxalorg (Mitesh)15:12:31

Thanks, this was super fun to work on and definitely a team effort! parrot If anyone has some cool ideas of what we can do with the logs feel free to create an issue: ^_^

👍 9
🙏 6

[metosin/jsonista "0.3.0"] is out. Jsonista fast JSON decoding & encoding library for Clojure built directly on top of Jackson Databind. • updated to use latest Jackson version, 0.12.0 • BREAKING: Joda-classes are not support by default, register com.fasterxml.jackson.datatype.joda/JodaModule to add support - or use java.time classes instead. • new jsonista.tagged ns for building Transit-style tagged JSON value representations. Users have reported up to 10x better encoding throughput compared to vanilla Transit. • Jsonista just hit 1M downloads on clojars 🎉 Github: Big thanks to all contributors.

🎉 66
parrot 9

Thanks for pouring the json 🍻

Karol Wójcik22:12:03

Will tagged json get support on cljs side?


(-> (keyword "x/z" "y") (j/write-value-as-string mapper) (doto prn) (j/read-value mapper) ((juxt namespace name)))
["x" "z/y"]
using single argument for tagged form of keyword (and symbol as well) could cause problems for keywords slightly violating clojure’s reading rules I would like to suggest this form ["!kw",["namespace","name"]] for namespaced and ["!kw",["name"]] for simple keywords. I did something similar in one of my projects and nether regretted it.


awesome lib btw! I already scheduled some time for “cheshire->jsonista” type of refactoring


Would it make sense to come up with a default scheme that would allow you to serialize EDN via jsonista as an alternative to transit, for full compatibility? Support for sets, uuids, bytes, ...


definitely make sense to me, I will need it anyway



💯 3

@U04V4KLKC good point about the keywords. Just merged in, didn’t check if that resolves the issue


@UJ1339K2B cljs not planned, but interesting idea. Interested in developing the cljs-client? could be just a new ns?


@U055NJ5CC One of the attractive properties of transit is that it is cross-language, not just clj <-> clj. So when using tags in clj, it would be nice to be able to decode this in Go or Ruby, or whatnot. Btw, this is a real problem, not just one I made up.


@U04V15CAJ I think there could be encoders & decoders for all common types. Also, need to handle keys too, the current impl just handles values.


are there any cross-language tagging conventions out there? (besided transit, which hasn’t gained much traction outside of clojure, I believe)


but I guess in Go you could look at your own made up tags and do the custom serialization. Good question. I think JSON schema has something around content types

Karol Wójcik09:12:22

Would love to, but certainly not in this year. To much consumed by studies and work ;( Anyway if this implementation could be faster than transit a lot of companies could benefit from it. Especially when doing SPA SSR.


btw, the tagged-json is faster than nippy in the simple benchmarks. which sounds fishy.


If performance is the goal, one option is to help make the current Transit faster.


great discussion, will start a Clojureverse thread out of this.


I've had this problem for a while which may be low hanging fruit to speed up transit


This is due to too many flushes

delaguardo09:12:52 here is a PR to handle keyword format suggested by me

👍 3

Can this be used to build a new transit server? Then you can use the transit cljs client?


honestly, haven't checked the transit internals for a while. Might be able to do a transit server, but would need to read the spec/source.


transit also does caching of symbols and values which compresses the payload. this is relevant for network traffic, but it may be less good for performance. so it's good take make explicit what you are optimizing for

☝️ 3
delaguardo10:12:07 there are two formats missing in jsonista: • string-based encoding • object-based encoding


I think transit might have ability to represent recursive data structures, which JSON lacks?