Readit News logoReadit News
aleclarsoniv commented on Show HN: JSON querystring, but compact and human-readable   github.com/alloc/json-qs... · Posted by u/aleclarsoniv
aleclarsoniv · a year ago
Hey HN, I wrote this little library a while back. This may be a bit of a niche thing, since there hasn't been much prior art tackling this problem. Before making json-qs, I was using my fork of juri [1], but it valued compression too much for my taste and, IIRC, I had some issues with it (can't remember the specifics).

If anyone has any feedback on the design, I'd be interested in hearing it. Or if you have questions about design choices, I can answer them. Thanks for reading!

[1]: https://github.com/scrollback/juri

aleclarsoniv commented on Show HN: TypeQuery – SQL query builder library built with TypeScript   github.com/grandimam/type... · Posted by u/grandimam
aleclarsoniv · a year ago
I think it'd be worth looking at what's already out there before you put a lot of effort into this, unless of course this is merely for fun/learning.
aleclarsoniv commented on Cash: A small jQuery alternative for modern browsers   github.com/fabiospampinat... · Posted by u/thunderbong
aleclarsoniv · a year ago
I used this initially in a browser extension I'm building. Ended up migrating to a JSX library instead, because jQuery turns into hard-to-reason-about code pretty quickly once you're past “simple app” territory (and I say this as someone who wrote my own jQuery-inspired library[1]). Right tool for the job, as they say.

[1]: https://github.com/aleclarson/dough

P.S. If you can cope with jQuery in a medium/large app, good for you. But it's not my cup of tea.

aleclarsoniv commented on Show HN: JSON-qs – JSON in query strings, human-readable, compact   github.com/alloc/alien-rp... · Posted by u/aleclarsoniv
nbbaier · a year ago
Is this usable as a package installable from NPM?
aleclarsoniv · a year ago
aleclarsoniv commented on Show HN: JSON-qs – JSON in query strings, human-readable, compact   github.com/alloc/alien-rp... · Posted by u/aleclarsoniv
jzebedee · a year ago
Is there an example where passing full JSON objects as a query string would be the right solution?
aleclarsoniv · a year ago
The most common case is probably complex search queries. It's really nice not having to flatten your data just to get network level caching.

In my case, building an RPC library with REST semantics, it's important to me to not place any restrictions on how developers pass their data to the backend. So removing that arbitrary flattening requirement is a big win. The json-qs specification does it in a way that balances readability and compactness.

u/aleclarsoniv

KarmaCake day71March 5, 2013
About
Just a guy trying to build a startup while doing too much OSS. Building with typescript, node.js, postgresql, and cursor (the IDE).

Currently developing:

* radashi <https://github.com/radashi-org/radashi>

* pg-nano <https://github.com/pg-nano/pg-nano>

* alien-rpc <https://github.com/alloc/alien-rpc>

Currently maintaining:

* jumpgen <https://github.com/alloc/jumpgen>

* alien-dom <https://github.com/alloc/alien-dom>

Previously maintained:

* vite (core team from v0 til v4)

* immer (co-author)

* react-spring (co-author)

View Original