The future of AMS

2,494 views
Skip to first unread message

Steve Klabnik

unread,
Jul 25, 2014, 8:18:26 PM7/25/14
to rails-a...@googlegroups.com
Hey everyone,

So. There has been a _number_ of false starts here, and so I'm here to
finally write a definitive answer on this topic. Whew. I apologize for
the lack of communication here, I have failed you as a maintainer.
I've literally been 'just about' to write this email for almost a full
three weeks, and that's why communication has been sparse over the
last few months. It's been hard to find the time.

Here is the TL;DR: I am looking to recruit a new core team of AMS
contributors. I do not have the time to give AMS the full attention it
deserves, but I'm willing to give it some, because I love and care
about AMS, specifically. Lots of other people do to, from the
conversations I've had in the past weeks. So, this is an explicit call
for help maintaining the gem.

Now: When the AMS re-write, 0.9, was supposed to happen, it was
originally intended to move to a 'adapters' style architecture. This
didn't happen. So. What I'm proposing is this: We assemble a core
team, then we work together on a 0.10 that's super awesome and
amazing. I am willing to do the maintenance work on both the 0.8 and
0.9 branches, to take care of any problems that people have currently.
From the number of open pull requests, it seems that people have been
using master, even though it hasn't been released, and I don't want to
abandon you.

The idea with using adapters is basically this: a Serializer class,
like we've all been using, should
control what needs to be serialized. An adapter class will control
_how_ that model is serialized. I'd like to ship AMS 0.10 (to then
later be 1.0) with adapters for JSON API, "old school" AMS, and HAL.
If people want more adapters, cool.

I have a teeny bit of work up on my fork here:
https://github.com/steveklabnik/active_model_serializers

This does all of the Rails integration, and has the beginnings of the
serializer code, and a NullAdapter that doesn’t do any
transformations. My intention is to make this branch be 0.10 on the
real repo when it's farther along.

How does this sound to you all? Who wants to help?

locks

unread,
Jul 25, 2014, 8:25:07 PM7/25/14
to rails-a...@googlegroups.com
I'll take the HAL adapter :)

Tom C

unread,
Jul 25, 2014, 8:38:24 PM7/25/14
to rails-a...@googlegroups.com
I would be happy to help contribute in any way possible. I am in NYC if you want to get together and talk.

Joshua Kelly

unread,
Jul 25, 2014, 8:45:18 PM7/25/14
to rails-a...@googlegroups.com
I use AMS in both personal open source projects and professionally. Writing a Rails API? I'm using AMS. 

I'm sure others in the Ember community (including companies like DockYard) share similar dependencies on AMS, so we might be successful in seeking maintainers there (I see Locks is already here ;D)

Jordan Faust

unread,
Jul 25, 2014, 8:57:46 PM7/25/14
to rails-a...@googlegroups.com
I would be interested in helping with the JSON API adapter. Currently attempting to slowly adopt that standard at work and hacking AWS to get it to work. Having AWS support this out of the box would really help move things forward.

Matt Jones

unread,
Jul 25, 2014, 9:19:57 PM7/25/14
to rails-a...@googlegroups.com


On Friday, 25 July 2014 20:18:26 UTC-4, Steve Klabnik wrote:
How does this sound to you all? Who wants to help? 

We use AMS for tons of stuff (internal + client projects) at work, and we've got dedicated time for doing things like contributing back.

Would be interested in helping with the "classic" adapter, as we've got masses of Ember code to feed JSON to. :)

--Matt Jones
Neo Innovation 

Kelly Sutton

unread,
Jul 25, 2014, 10:46:50 PM7/25/14
to rails-a...@googlegroups.com
Just about everything we do at LayerVault uses AMS in some capacity. 

We've got functional but ugly, feature-complete JSON API adapter/serializer and are willing to adapt our work to a new serializer-adapter pattern.

It seems like before work is done on adapters, the serializer layer should be solidified a bit. Are there any docs/specs around that?

Santiago Pastorino

unread,
Jul 28, 2014, 10:13:25 AM7/28/14
to rails-a...@googlegroups.com
This is great news, thanks a lot!.

As I told before I'm currently not using AMS and not having time to work on it anymore, but I'm willing to provide support over #rails-api IRC channel. If you start using something else than IRC please let me know.

Feel free to ping me.

Steve Klabnik

unread,
Jul 28, 2014, 11:14:44 AM7/28/14
to Santiago Pastorino, rails-a...@googlegroups.com
> It seems like before work is done on adapters, the serializer layer should be solidified a bit. Are there any docs/specs around that?

Basically, I would like to retain basic compatibility with AMS's
existing serializers, with one extension: a `url` directive for any
URLs that hypermedia-enabled formats use. But I like the existing DSL
already, and it seems other people do too.

Thanks for all the responses everyone! I guess next steps are to start
hacking away. PRs very welcome. I'll try to review the open PRs on the
current master, as well.

Joshua Kelly

unread,
Jul 28, 2014, 3:19:53 PM7/28/14
to rails-a...@googlegroups.com
I started an annotation/doc branch here: https://github.com/steveklabnik/active_model_serializers/pull/2  I'm also idling in #rails-api now. 

Seems obvious that Adapters should be duck typed. I'll try pushing on an old school AMS adapter and see what makes sense.

Interestingly, this Serializer/Adapter architecture is present in this, large JS project: https://github.com/emberjs/data

Arne Brasseur

unread,
Jul 29, 2014, 2:11:45 AM7/29/14
to Joshua Kelly, rails-a...@googlegroups.com
> Basically, I would like to retain basic compatibility with AMS's
existing serializers, with one extension: a `url` directive for any
URLs that hypermedia-enabled formats use. But I like the existing DSL
already, and it seems other people do too.

How about `link` instead of `url`? That way AMS and Yaks stay mostly syntax-compatible.



--
You received this message because you are subscribed to the Google Groups "rails-api-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rails-api-cor...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Steve Klabnik

unread,
Aug 13, 2014, 1:34:10 PM8/13/14
to Arne Brasseur, Joshua Kelly, rails-a...@googlegroups.com
Josh, it's not that interesting ;) (The symmetry is intentional)

Arne, Rails uses 'url' and 'path' for its url helpers, and doesn't
really use 'link' at all. I'd rather stick to the rails-y terms.

So, here's the plan: At the end of next week, I'm going to cut 0.9.0.
Whichever PRs haven't been rebased by then won't make it in, and I'll
be looking to go through and handle stale issues and such. On the
release, master will become the 0.9.0 branch, and my fork will be
promoted to new master, and I'll start working on implementing more
things.

What I'm doing with this 're-write' is largely looking at 0.8's code,
and retrofitting it into the new architecture. It's been a while since
I've done into the guts of AMS, and so I'm re-building it bit by bit
so that I fully grok all of the pieces.

As always, any help is very appreciated.

Steve Klabnik

unread,
Aug 23, 2014, 12:05:11 PM8/23/14
to Arne Brasseur, Joshua Kelly, rails-a...@googlegroups.com
0.9 has been released, my fork is now the master branch. Woo!

Jean-Philippe Boily

unread,
Aug 23, 2014, 8:25:48 PM8/23/14
to st...@steveklabnik.com, arne.b...@gmail.com, jdjk...@gmail.com, rails-a...@googlegroups.com
Excellent, thanks!

<3

Jean-Philippe Boily
Human. Ruby developer.  | http://jipiboily.com/

Jean-Philippe Boily
Human. Ruby developer.  | http://jipiboily.com/


On Sat, Aug 23, 2014 at 12:05 PM, Steve Klabnik <st...@steveklabnik.com> wrote:

0.9 has been released, my fork is now the master branch. Woo!

Tema Bolshakov

unread,
Aug 25, 2014, 3:02:28 AM8/25/14
to rails-a...@googlegroups.com
Hello folks, 
I wish to participate. With what can I help you?

суббота, 26 июля 2014 г., 4:18:26 UTC+4 пользователь Steve Klabnik написал:

Steve Klabnik

unread,
Aug 25, 2014, 12:57:10 PM8/25/14
to Tema Bolshakov, rails-a...@googlegroups.com
Two things:

1. I cleaned up the issue tracker significantly. Fixing those issues
would help existing AMS users a lot.
2. The rebuild on master. Sumitting PRs to re-implement functionality
that we're missing would be great.

thank you so much! Any help much appreciated.

David Muto

unread,
Aug 25, 2014, 8:43:34 PM8/25/14
to rails-a...@googlegroups.com, twee...@gmail.com
Been loving this so far. I'm definitely in to helping out. I have at least PR I'll submit shortly. 

Anything in particular you want help with?

Steve Klabnik

unread,
Aug 25, 2014, 9:25:51 PM8/25/14
to David Muto, rails-a...@googlegroups.com, Artyom Bolshakov
Nothing specific. It all needs help.

L. Preston Sego III

unread,
Oct 11, 2014, 12:03:36 PM10/11/14
to rails-a...@googlegroups.com
Hey, do you need help? I opened a ticket a few months ago about the lack of versioned API support with AMS. If work hasn't been started, I'd like to implement that real quick. 
https://github.com/rails-api/active_model_serializers/issues/562

Carles Jove i Buxeda

unread,
Nov 25, 2014, 5:17:25 AM11/25/14
to rails-a...@googlegroups.com
Hello,

I had a brief conversation with Steve over email. I'm getting involved in the Collection+JSON format and I will to work on Ruby implementations. It'd be really cool to write an adapter for AMS, but I'm not sure if it is possible right now, since CJ has some top-level objects that, I think, cannot be implemented with the current DSL/macros/API or however they're called. I can think of at least one needed macro, for write templates. I haven't really taken the time to deeply analyse this, but I think that I'd get stuck here if I start writin and adapter rigth now.

I'm aware that 0.10 is in current development and it has been for some time, and I wouldn't like to slow the process too much. I am willing to do some work on AMS before I get into writing a CJ adapter, so here goes an idea:

I guess that, like CJ, there'll be other formats that require macros beyond the current `attributes`, `associations` or `url`. So would it make sense that adapters could add macros to the base Serializer? Since the base Serializer already knows about the Adapter, I guess this'd be doable, right? That way, AMS could have some generic macros that presumably all adapters want to use, but also leave room for particular needs.

Does it make sense? I'd be willing to do work on this.






Dermot Haughey

unread,
Feb 3, 2015, 3:13:10 PM2/3/15
to rails-a...@googlegroups.com
What is on the roadmap for 0.10.0? I think AMS is a great gem, and I think letting everyone use adapters is going to go a long way towards making it more usable. I'd love to help, I'm just struggling to figure out what needs to be done before it can be released?
Reply all
Reply to author
Forward
0 new messages