bwillis / versioncake

:cake: Version Cake is an unobtrusive way to version APIs in your Rails or Rack apps
655 stars 47 forks source link

Opinionated Subtree #106

Open SampsonCrowley opened 3 years ago

SampsonCrowley commented 3 years ago

@bwillis @aantix

I decided I didn't want all of the fancy bells and whistles, and really just wanted a very slimmed down and opinionated version of your fantastic idea. The end result is a brainchild of versioncake and api-versions called api_view_versions

I haven't released it yet on rubygems, but the Repo is now at the point that all tests are fully passing for everything from Rails 4.2 to Rails 6.1; I'd encourage you to steal some of my "improvements" back and reimplement them here!

I would have kept everything as a fork, but then I wouldn't be able to accept issues for the now very differently engineered codebase. I hope to keep the projects as a collaboration though and if you are uncomfortable with me building off of your work just let me know and I will take it down.

Cheers!

bwillis commented 3 years ago

Hey @SampsonCrowley,

This is a pretty tiny library as is, I'm curious, what was the feature set of the library you were looking for or specifically what did you remove? I took a quick look, but couldn't easily tell from the latest commit on the fork.

We use a MIT license here, so you are certainly free to fork expand and create as you see fit!

SampsonCrowley commented 3 years ago

@bwillis one of the slimmings I did was to take out the options for different versioning systems. I was only ever going to use ACCEPT header style versioning, so I was able to boost performance by taking out the ability to use other options.

All of the rewrites that have to do with rails engine versioning however still very much apply to your library and when I was planning to open a PR so that versioncake could be rails 6 compatible as well; but I've had a hard time finding time to write it up

SampsonCrowley commented 3 years ago

@bwillis if you're curious about specific implementation changes, I think most of them were in actionview: https://github.com/SampsonCrowley/api_view_versions/tree/main/lib/api_view_versions/action_view

I'm on my phone rn, and would have to actually get on my computer to get more specific, but I rewrote a lot of logic there for what each version is capable of and what can be shared; and I think it's much cleaner this way

SampsonCrowley commented 3 years ago

https://github.com/SampsonCrowley/api_view_versions/blob/main/lib/api_view_versions/view_additions.rb