Carlos update

If you don’t know what is Carlos, head over here first, or here for the Github repo.

New release

Yesterday I closed the last open issue in the 0.4 milestone. Here are the highlights (since 0.3):

  • Introduced the Fetcher protocol so that it’s easier now to create custom fetchers that don’t have write
  • Speaking about fetchers, you can now transform the output value of a fetcher through OneWayTransformer objects, as opposed to the required TwoWayTransformer objects when transforming the values of a full-blown CacheLevel for set support
  • Speaking about transformers, you can now compose transformers as well (both OneWayTransformer and TwoWayTransformer are supported)! Operators and functions are the same as for composing cache levels
  • More about transformers! Added a JSONTransformer that transforms NSData to AnyObject (to support both arrays and dictionaries) and back to NSData that you can pipe to a NetworkFetcher to get JSON out of it. This also means now there is a CacheProvider.JSONCache in case you’re lazy about it :)
  • Last thing about transformers, or about post processing to be more specific: it’s now possible to apply a post-processing to the output of a CacheLevel through a OneWayTransformer that doesn’t change the type of the CacheLevel. As an example, you could resize images or sanitize the output in general
  • Last but not least, added support for both WatchOS 2 AND tvOS (yes, already!)

What is the future development?

We have a lot of ideas in mind for future versions of Carlos. Some of them will break its API, since the project is so young and there is no concept of stable API yet. But they will also make the library even better, easier to use, and more powerful at the same time.

If you’re curious, head over here.

The biggest idea we’re currently designing is the abstraction of cache levels and key/value transformers. We would like them to work the same way, so that one can not only compose cache layers, but actually chain them too.

How can I contribute?

Contributions are welcome! We’re in the early stage of development so your contributions could shape the design of Carlos.

If you want to contribute to the project, please:

  • Create an issue explaining your problem and your solution
  • Create a branch with the issue number and a short abstract of the feature name
  • Implement your solution
  • Write tests (untested features won’t be merged)
  • When all the tests are written and green, create a pull request, with a short description of the approach taken

Thanks for reading! I’m really excited about the future of Carlos!