Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Alba: Why, How and What's So Interesting

Alba: Why, How and What's So Interesting

https://connpass.com/event/339170/

The talk was given in Japanese, but the deck is in English so it's great if you want to know about Alba.

Masafumi Okura

January 17, 2025
Tweet

More Decks by Masafumi Okura

Other Decks in Programming

Transcript

  1. self.pretty_print • Name: OKURA Masafumi • Work: Freelance web developer

    • Activities: Kaigi on Rails, TokyoWomen.rb, Rubygems code reading club, organizing Regional.rb and the Tokyo Metropolis
  2. Agenda • 0. What is Alba? • 1. Why did

    I create Alba? • 2. How was it achieved? • 3. What’s so interesting about it?
  3. What is Alba? • https://github.com/okuramasafumi/alba • A JSON serializer for

    Ruby, JRuby and Truf fl eRuby • Core values: Performance, easy-to-use, feature-rich • Total download: About 1,350,000 • GitHub Stars: About 960
  4. Minimal API to serialize objects into JSON • `attributes` DSL

    to use underlying object’s attribute directly • `attribute` DSL to compute the result from object’s attribute • `root_key` DSL to de fi ne root key • `association` DSL to embed other serializers’ result
  5. Advanced features of Alba • Type support • “Typelizer” gem

    adds the ability to generate TypeScript types • Conditional attributes • Serializing heterogeneous collections • Filtering • etc.
  6. use case driven development • It’s one of the forms

    of TDD (Test Driven Development) • Follow these steps: 1. Write use cases as test cases 2. Consider if Alba should support these use cases 3. If yes, implement it
  7. 833