Giter Club home page Giter Club logo

ribs's Introduction

RIBs

Android CI License Maven Central Cocoapods Compatible Carthage Compatible

RIBs is the cross-platform architecture framework behind many mobile apps at Uber. The name RIBs is short for Router, Interactor and Builder, which are core components of this architecture. This framework is designed for mobile apps with a large number of engineers and nested states.

The RIBs architecture provides:

  • Shared architecture across iOS and Android. Build cross-platform apps that have similar architecture, enabling iOS and Android teams to cross-review business logic code.
  • Testability and Isolation. Classes must be easy to unit test and reason about in isolation. Individual RIB classes have distinct responsibilities like: routing, business, view logic, creation. Plus, most RIB logic is decoupled from child RIB logic. This makes RIB classes easy to test and reason about independently.
  • Tooling for developer productivity. RIBs come with IDE tooling around code generation, memory leak detection, static analysis and runtime integrations - all which improve developer productivity for large teams or small.
  • An architecture that scales. This architecture has proven to scale to hundreds of engineers working on the same codebase and apps with hundreds of RIBs.

Documentation

To get started with RIBs, please refer to the RIBs documentation. This describes key concepts on RIBs, from what they are for, their structure and common use cases.

To get more hands on with RIBs, we have written a series of tutorials that run you through the main aspects of the architecture with hands-on examples.

To read about the backstory on why we created RIBs, see this blog post we wrote when releasing RIBs in production the first time and see this short video where we discussed how the RIBs architecture works.

What is the difference between RIBs and MV*/VIPER?

MVC, MVP, MVI, MVVM and VIPER are architecture patterns. RIBs is a framework. What differentiates RIBs from frameworks based on MV*/VIPER is:

  • Business logic drives the app, not the view tree. Unlike with MV*/VIPER, a RIB does not have to have a view. This means that the app hierarchy is driven by the business logic, not the view tree.
  • Independent business logic and view trees. RIBs decouple how the business logic scopes are structured from view hierarchies. This allows the application to have a deep business logic tree, isolating business logic nodes, while maintaining a shallow view hierarchy making layouts, animations and transitions easy.

There are some other novel things about RIBs. However, these could also be implemented with other MV*/VIPER frameworks. These are:

  • Cross-platform approach, allowing iOS and Android architecture to stay in sync.
  • Tooling for easier adoption on larger apps or teams. Tooling we are open sourcing includes IDE plugins for code generation and static code analysis.
  • Strong opinions about how state should be communicated, using DI and Rx. Each RIB defines its dependencies and what dependencies it needs from its parent. Parent components that fulfill a child’s parent dependencies are provided to child Builders as a constructor dependency to allow for hierarchical DI scoping. This means that information is communicated via these dependencies up and down the tree.

Usage

  1. Clone this repository
  2. Integrate using your preferred installation mechanism

For usage of the tooling built around RIBs, please see the Tooling section in our documentation.

Installation for Android

To integrate the recommended minimum setup for RIBs add the following to your build.gradle:

dependencies {
  annotationProcessor 'com.uber.rib:rib-compiler-test:0.16.2'
  implementation 'com.uber.rib:rib-android:0.16.2'
  testImplementation 'com.uber.rib:rib-test:0.16.2'
}

There are a number of extension packages available as well including Kotlin extensions, Jetpack Compose support, Coroutines support

Installation for iOS

CocoaPods

To integrate RIBs into your project add the following to your Podfile:

pod 'RIBs', '~> 0.9'

Carthage

To integrate RIBs into your project using Carthage add the following to your Cartfile:

github "uber/RIBs" ~> 0.9

Related projects

If you like RIBs, check out other related open source projects from our team:

  • Needle: a compile-time safe Swift dependency injection framework.
  • Motif: An abstract on top of Dagger offering simpler APIs for nested scopes.
  • Swift Concurrency: a set of concurrency utility classes used by Uber, inspired by the equivalent java.util.concurrent package classes.
  • Swift Abstract Class: a light-weight library along with an executable that enables compile-time safe abstract class development for Swift projects.
  • Swift Common: common libraries used by this set of Swift open source projects.

License

Copyright (C) 2017 Uber Technologies

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

ribs's People

Contributors

artman avatar attwellbrian avatar edrew08 avatar franaguilera avatar gergelyorosz avatar idanakav avatar jarinosuke avatar jbarr21 avatar kovpas avatar lucas34 avatar lukaciko avatar mathieubrousseido avatar msridhar avatar neakor avatar oliviernotteghem avatar oronbz avatar pavlodavydiuk avatar psteiger avatar rafaeltoledo avatar rendecano avatar rudro avatar sanchezz93 avatar sbarow avatar sergeysmykovskyi avatar solace-studios avatar thekirankumar avatar tyvsmith avatar uoooo avatar yuanlu-0 avatar zacsweers avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ribs's Issues

[iOS] Sanity check tutorial #1 and tutorial #2

I just updated tutorial #1 and tutorial #2 in terms of language, more helpful explanations and missing code snippets and ran through them to make sure that they work. Could someone do a second sanity check and just run through the tutorials to make sure that they make sense? If you find any problems or spelling mistakes, feel free to update the wiki directly.

Release to maven central

Spent a couple hours trying to get this work without success. To meet our deadlines I think someone that already has their keys setup should do this.

Ie, @hzsweers

[android] figure out how to do licensing for "uava" classes

Some uava Optional classes are inlined into this project in order to support workflows. What is the current source code license to use for these? Or, is there a smarter way we can have the workflow classes depend on our uava classes?

[iOS] Integrate with Travis

Integrate Ribs to build on travis whenever a PR is issued or updated. Builds should run on multiple versions of iOS.

[iOS] Fix swift format script

Currently script is not actually being run on the swift files.

Header is also incorrect, should be updated to be:

//
//  Copyright (c) 2017. Uber Technologies
//
//  Licensed under the Apache License, Version 2.0 (the "License");
//  you may not use this file except in compliance with the License.
//  You may obtain a copy of the License at
//
//  http://www.apache.org/licenses/LICENSE-2.0
//
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS,
//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//  See the License for the specific language governing permissions and
//  limitations under the License.
//

Check tutorial #3

The language we use in tutorial #3 needs upgrading and we should run through it to make sure it produces a working project without any problems.

Update the README.md

The README.md should be selling the architecture and needs to be updated to be really selling. Also, we'll need an icon for RIBs to make the README stand out.

Android Checkstyle Story

This repo is using a confusing mix of Uber's old codestyle (4 spaces) and the new style (2 spaces). As a result checkstyle has been disabled.

Should update the checkstyle files and re-enable checkstyle.

[iOS] Swift Package Manager support

Already implemented in #106. Since SPM doesn't support UIKit imports, I had to #if os(iOS) bunch of code, which is not ideal. We have to get back to this once SPM supports iOS builds.

[android] setup linter for autodispose usage

This is one of the things that makes RIBs so resilient to memory leaks. It is also a cool tech demo.

Could either hook up error prone. Or just write a quick psi linter as a tech demo.

Figure out how to publish intellij plugin

I've ported over a fork of the intellij plugin (we probably won't be able to create a single source of truth for the intellij plugin since the internal intellij plugin does tonnes of things). However, I haven't touched the module in Uber's mono-repo responsible for deploying the intellij plugin. Our internal code didn't handle public deploys.

[android] finalize tutorial1

I think we should have an example application for iOS & Android using RIBs. Optionally a getting started guide could walk through key steps of the building of the application.

Thoughts on going forward with this? And if we do, what should the application be?

slack for RIBs community

Hi guys,
One of the most powerful things within the RxSwift community is communication (no pun intended) with slack.

How are you maintainers and other contributors feeling about creating a slack server for RIBs?

I personally think this could speed up the advancement and maturity of this project, along with people who will be there to clear things up and make RIBs integration an ease.

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.