Skip to content
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

RocketPants 2.x Planning #38

Open
jsmestad opened this issue Dec 4, 2012 · 16 comments
Open

RocketPants 2.x Planning #38

jsmestad opened this issue Dec 4, 2012 · 16 comments

Comments

@jsmestad
Copy link

jsmestad commented Dec 4, 2012

The "What"

This issue hopefully will help solicit and facilitate a discussion around any proposed changes being incorporated into the 2.x release.

The "Why"

While working with rocket_pants I noticed the lack of support for some semi-standardized (well nothing in API land is truly standard) like content-type based routing and hypermedia-based pagination to name a few. Out of this I released the rocket_shorts gem (see jsmestad/rocket_shorts) that provided this varied functionality through a series of shims and overrides.

After releasing it, I solicited @Sutto for some feedback on the direction, which quickly turned into proposition to merge that work into "the next major version of rocket_pants"

The "Where"

Drafted Proposal: 2.0 Planning

@jsmestad
Copy link
Author

jsmestad commented Dec 4, 2012

@Sutto added 3 items to the planning document. Look forward to your feedback.

@Sutto
Copy link
Owner

Sutto commented Dec 5, 2012

@jsmestad sweet - will take a look this afternoon (also, Have twitter disabled this week so can't reply there).

@adamburmister
Copy link

Could I also suggest referring to http://www.slideshare.net/stormpath/rest-jsonapis for some ideas.

Particularly surrounding hypermedia linking on instances, collections, and meta (pagination, etc).

Other ideas: _expand= param to expand response nodes.

Is there a timeline for v2? I've been researching options for my new Rails based API and think RocketPants is the final choice, so will be in a position to contribute.

@Sutto
Copy link
Owner

Sutto commented Dec 15, 2012

Awesome, thanks!

There isn't a timeline at the moment, but I'm aiming to work on it a bit over the christmas break.

WRT to expand, I'd considered it - the biggest issue with that is it's actually incredibly complex to implement efficiently,
so it's the sort of thing I'd prefer to do from a gem instead.

On 14/12/2012, at 3:33 AM, Adam Burmister notifications@github.com wrote:

Could I also suggest referring to http://www.slideshare.net/stormpath/rest-jsonapis for some ideas.

Particularly surrounding hypermedia linking on instances, collections, and meta (pagination, etc).

Other ideas: _expand= param to expand response nodes.

Is there a timeline for v2? I've been researching options for my new Rails based API and think RocketPants is the final choice, so will be in a position to contribute.


Reply to this email directly or view it on GitHub.

@mbhnyc
Copy link
Contributor

mbhnyc commented Dec 17, 2012

One thing I ran into that I was surprised wasn't covered in rocketpants 1.0 was CORS (Cross-Origin Resource Sharing) support, for example, here's what i had to add to my application_controller to have an API that was accessible from a backbone.js app i'm working on:

before_filter :cor
  def cor
    headers["Access-Control-Allow-Origin"] = "*"
    headers["Access-Control-Allow-Methods"] = %w{GET POST PUT DELETE}.join(",")
    headers["Access-Control-Allow-Headers"] = %w{Origin Accept Content-Type X-Requested-With X-CSRF-Token Authorization}.join(",")
    head(:ok) if request.request_method == "OPTIONS"
  end

Obviously this is pretty permissive, and the Allow-Origin value should be configurable - but responding to an OPTIONS request seems like a good addition to me.

@jsmestad
Copy link
Author

@Sutto what are your thoughts on basing rocket_pants off of rails_api ActionController::API. I am spiking on this was we speak and wanted to get your feedback. One thing I would also like to see is a bit easier to configure what "ActiveModelSerializer" to call. I have begun versioning my serializers is why I bring it up.

@Sutto
Copy link
Owner

Sutto commented Nov 13, 2013

@jsmestad awesome, I like that idea - I haven't had any time at all to work on stuff for a while, so eager to see what you come up with!

@Sutto
Copy link
Owner

Sutto commented Dec 12, 2013

@jsmestad how'd your spike going? I've got some time set aside to work on RocketPants 2.0 right now and figured I'd check in before going ahead :)

@jsmestad
Copy link
Author

@Sutto I will put together a gist of where I made it to. The issue I ran into was trying to make RocketPants use the Responder stuff built into Rails instead of just replacing all of it with a single renderer (like it is now)


Here is a gist. Ignore the name as I just renamed it to Tradesman to avoid conflict with an existing RocketPants install.

https://gist.github.com/jsmestad/8029732

Keep in mind rolled into this is changing versioning to use Accept headers again (just like my rocket_shorts fork). The only thing NOT working is getting the serializer_hash to output in the format of:

{
  account: {
    id: 1,
    name: "Company LLC"
  }
}

when calling respond_with @account and

{
  accounts: [{
    id: 1,
    name: "Company LLC"
  }]
}

when calling respond_with @accounts. Right now it just outputs with no root value which isnt consistent with what AM::Serializers look for.

It should be easy I just ran out of time. I also do versioning via different ActiveModelSerializers rather than other methods. Let me know if you have any feedback or want me to package something up.

@chadwtaylor
Copy link

Most popular and annoying question: "When?"

I am about to consider using Rocket Pants for existing API. I just read that 2.0 is in the works and wondered if I should wait out a bit until 2.0 comes out... or proceed with 1.0. Please advise.

@Sutto
Copy link
Owner

Sutto commented Mar 29, 2014

I'd honestly go with 1.0 for the moment - My goal is going to be to make the transition from 1.0 to 2.0 super easy (read: minimal changes, a built in compatibility layer) - but as you've seen this has dragged on a bit. I'm again spending some time working on it, but I've not been able to historically prioritise this pretty well - so I can't give a hard date on 2.0

@chadwtaylor
Copy link

Thanks for the prompt response! I'll go ahead and work with 1.0, thanks.

@chadwtaylor
Copy link

Eagerly waiting for the 2.0 release - how is that going?

@mbhnyc
Copy link
Contributor

mbhnyc commented May 24, 2014

Order us around @Sutto, maybe we can help :)

@chadwtaylor
Copy link

Eagerly waiting for the 2.0 release... has that been dropped?

@Sutto
Copy link
Owner

Sutto commented Feb 16, 2015

To be brutally honest - It's not been dropped, but I've definitely dropped the ball. All of my time has been very, very focused on my day job (http://gyde.tv) so I've had zero time to work on it. I still want to see 2.0 done (and have a good idea of what needs to be done) - but I've been distracted by work that I haven't been able to get it done - or organising stuff for people to do.

I still want to see 2.0 - I use rocket pants dailly, but we're on an older rails 3.2 app / nothing new has been needed that has given me the excuse to work on it... yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants