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

Swap out rabl for something a bit more manageable #146

Closed
athal7 opened this issue Jul 6, 2015 · 7 comments
Closed

Swap out rabl for something a bit more manageable #146

athal7 opened this issue Jul 6, 2015 · 7 comments
Labels
changelog:solidus_api Changes to the solidus_api gem
Milestone

Comments

@athal7
Copy link

athal7 commented Jul 6, 2015

Rabl is difficult to extend for stores looking to add more information (essentially have to bypass it by adding an attribute to a helper array, or replace the template entirely), is currently used with a caching strategy whereby we still load all of the records from the database on a warm cache, and can swallow errors. Other options that exist can make these issues less difficult, and we can maintain the same api contract as a first pass if we would like so that a major upgrade is not required.

@cbrunsdon
Copy link
Contributor

The general consensus north of the 49 is Rabl was a great decision at the time but has not stood up well to customization or expansion.

Its tough to work with, extend and comprehend. We are for scrapping it's existing interface entirely.

My personal preference for going forward is:

  1. Support the current api endpoints for a while longer exactly where they are
  2. Start up a new API endpoint only for the frontend

We've been following this path in one of our stores to great success, which will soonish be in a shareable state.

@jhawthorn jhawthorn added the changelog:solidus_api Changes to the solidus_api gem label Jul 21, 2015
@jhawthorn jhawthorn added this to the Future milestone Aug 11, 2015
@hhff
Copy link

hhff commented Aug 29, 2015

Hey guys! Just wanted to chime in and say hi! I built Spree Ember and have been chatting with @BenMorganIO about working to support solidus too.

I originally built spree_ams, which inherits all logic from regular API controllers, but simply responds with AMS instead. It's a very simple gem, but I think it's worth checking out. I'd love to stay abrest of this and help out where possible :)

@hhff
Copy link

hhff commented Aug 29, 2015

http://spree-ember.com that is

@BenMorganIO
Copy link
Contributor

@hhff does have a gem that covers the frontend nicely. Its a great starting place IMHO.

There's also lots of discussion about this for Spree RFC #1: spree-contrib/rfcs#1.

@jarednorman
Copy link
Member

Remember that AMS has global configuration, so if stores have AMS already and have it configured it differently that we configure if, this may present a non-trivial upgrade cost to those stores. This is the same reason we can't even consider using something like simple_form on the backend.

@BenMorganIO
Copy link
Contributor

@jarednorman We can add a Solidus::BaseSerializer to "cement" our configuration. That way when someone changes something globally, it won't hurt the serializers.

OR

Also, we could just use the a certain json format via the content type? This way we can explicitly say to the request: hand us this format, and not the main applications: Content-Type: application/prs.solidus+json. See RFC 6838 Section 3.3

OR...

There's also another option where we can make a Solidus::JsonAdapter that can "cement" some of the configuration.

I feel like this cat has many ways of being skinned. Treading carefully on the configuration portion is probably important.

If anyone has any thoughts on this, I can start experimenting with different methods on the https://github.com/wildcardlabs/solidus_json_api and see what turns up.

@kennyadsl
Copy link
Member

This issue was mainly created for using a different tool than RABL, and this has been done with #2147 .

spaghetticode referenced this issue in nebulab/solidus Mar 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:solidus_api Changes to the solidus_api gem
Projects
None yet
Development

No branches or pull requests

7 participants