
Modern Ruby Serializers - todsacerdoti
https://vasilakisfil.social/blog/2020/01/20/modern-ruby-serializers/
======
cguess
I'm surprised there was no mention of Blueprinter
([https://github.com/procore/blueprinter](https://github.com/procore/blueprinter)),
a format-agnostic, maintained serializer that's very obviously a successor to
the ActiveModelSerializer that is mentioned.

Personally, I don't like fast_jsonapi because it's impossible to retrofit an
app that already exists to it. The standard is so specific (and, in my opinion
overkill unless you're Netflix) that it's just not the right fit for a lot of
APIs.

~~~
syspec
Agreed. I used fast_jsonapi on a project, and while I liked it, I felt that I
had to change my project to work a round it and not the other way around.

For my next project, I used `blueprinter`, which seems to be pretty fast in
its own right (there was no discernible difference from what I could tell).

Overall I i'd like to give fast_jsonapi another try, but only once I see
serialization is my bottleneck

------
cooljacob204
fast_jsonapi appears to be abandoned. Community fork can be found here:
[https://github.com/jsonapi-serializer/jsonapi-
serializer](https://github.com/jsonapi-serializer/jsonapi-serializer)

~~~
save_ferris
Stuff like this frustrates me from a corporate open source stewardship
perspective.

Companies love to talk about how they support FOSS during recruiting, but they
can't even be bothered to formally update the repository with a deprecation
notice when they decide it's no longer in their interest to support a project.
And in this case, a lot of people rely on this package.

I don't necessarily think that companies should be expected to maintain OS
packages they write forever, but respecting the community by openly
communicating their plans for the project instead of making end users figure
it out should be the bare minimum for acceptable stewardship.

Just abandoning this project without a heads up is some bush league BS by
Netflix.

------
zrail
If I were writing an API in Ruby today I would define my output types as
Sorbet structs and call `serialize.to_json` on them at render time. I haven't
benchmarked it against anything but it seems reasonably fast.

~~~
cooljacob204
While I have heard a lot of good things about Sorbet I would still hesitate to
use it with Ruby 3 and it's type language RBS around the corner.

------
sandstrom
I really like Graphiti, it’s an excellent serializer that works with JSON API.

[https://www.graphiti.dev/guides/](https://www.graphiti.dev/guides/)

------
unixhero
What is to serialize? When do I need to do that?

~~~
nitrogen
[https://en.wikipedia.org/wiki/Serialization](https://en.wikipedia.org/wiki/Serialization)

It's a fancy name for turning internal program data into a stream of bytes
(thus the "serial" for "sequential") you can send to another program/computer
or save to disk.

