Code Monkey home page Code Monkey logo

ribs's Introduction

RIBs

Version Build Status License

Why should I care about this?

Practical implementation of ideas presented in this DroidconUK 19 talk:

The immense benefits of not thinking in screens

RIBs as a pattern

Single-activity approach

Your view hierarchy is already a tree - RIBs gives you a way to compose your application in a similar way.

Simplicity

Break down the complexity of your project into manageable chunks. Compose them together to create abstractions on higher levels. Different levels - same approach.

Cohesive, reusable modules

RIB = business logic + UI + all related functionality packaged together, hiding all implementation details.

Screen-agnostic modules

Use the same approach that works on any level of view-hierarchy:

  • sections of the screen
  • full-screen
  • multi-screen flows
  • pure business logic without any view

Reusability on steroids

Achieve bare minimum coupling: RIBs are not coupled to their parents or siblings, and are easy to move around. Just provide dependencies to a Builder, and you are ready to go.

Deep scope trees

Fine-grained control over object lifetimes. Want to go more specific than a single @Singleton and @Activity scope? RIBs tree lends a natural and easy way to do this.

Instumentation testing in isolation

RIBs can be tested in isolation even in instrumentation tests

RIBs as an implementation

Builders

Compile-time safety over runtime crashes: you construct RIBs yourself, and can leverage constructor dependency injection.

Remote control

Workflows allow you to chain operations of individual RIBs together. You can then trigger workflows from e.g.:

  • console
  • push notifications from deep links

Use it to easily move your app to specific states.

About Badoo's fork

Badoo RIBs is an evolution of Uber RIBs, with notable differences and additions

Addressing key issues

  • Tree structure is saved / restored automatically
  • Reduced boilerplate code for Router by using routing actions and declarative routing
  • Added back stack for routing with back stack operations (push, pop, replace, etc.)
  • Back stack is saved / restored automatically
  • Separated View lifecycle from logical Node lifecycle, which adds many new interesting possibilities (e.g. RIBs with business logic still alive in back stack, RIBs hosted in an AlertDialog)
  • Support for Android lifecycle events

Making it even smoother

  • Happily integrated with MVICore
  • Enjoy full support for state management with async loading, one-time events, time-travel debugging, and more. Check documentation for a full list features.
  • First-class support for unidirectional data-flow: one-liners for connecting endpoints
  • Providing customisations for RIBs
  • Template generator plugin compiled from live code templates
  • Kotlin

Roadmap to 1.0

See here

Tutorials

See here. Check back later for more, as only basic functionality is covered as of yet. In the meantime, you can also check out the app-example module.

WIP warning

This is an in-progress, preview version.

Bugs are probably less of an issue, as the framework is pretty well covered with unit tests, but API can change until 1.0.

ribs's People

Contributors

zsoltk avatar lukaville avatar shikasd avatar attwellbrian avatar antonshilov avatar cherryperry avatar mapm14 avatar artman avatar rhoadster91 avatar neakor avatar gergelyorosz avatar kovpas avatar sbarow avatar yuanlu-0 avatar lachlanmckee avatar jlmd avatar edrew08 avatar msridhar avatar rendecano avatar jarinosuke avatar zacsweers avatar dzzh avatar journeyman avatar serejahh avatar oronbz avatar lukaciko avatar lucas34 avatar kiliankoe avatar ibrahimkteish avatar kronik avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.