Coder Social home page Coder Social logo

cloudkitfeatureflags's Introduction

CloudKitFeatureFlags

Swift

Features (hah!):

  • Rollouts in 10% increments (10%, 20%, 30% etc.)
  • A unique statistical approach, we don't need to store a large number of records or do lots of operations to rollback/deploy feature flags.
  • Most operations typically involve editing one row in your CK Public database.
  • All operations take place via the public databse, so no worrying about users running out of iCloud space.
  • Tests to ensure rollouts are reasonably accurate (there's tests to ensure rollouts are at least 0.5% accurate on user populations of 100k users, and 1% accurate on 10k users)
  • (Coming soon) Release features to specific allow-listed users - such as app reviewers
  • (Coming Soon) Admin interface to create and deploy feature flags
  • (Coming Soon) Gate feature flags to avoid leaking features currently in development, may require a CloudKit Schema migration

Broad ideas and implementation ideas here: https://www.craft.do/s/VIzO95A9chLeoW

Test application here: https://github.com/codeOfRobin/TestingCloudKitFeatureFlags (requires setting up a CloudKit container and changing the signing capabilities with your ๏ฃฟ Developer account)

Guide

Installation

Add to your project via Swift Package manager, package URL: https://github.com/codeOfRobin/CloudKitFeatureFlags. Since we're still early along, it's recommended to use the main branch.

Usage

  • Create feature flags somehow You can use the test app, or simply do it via the CloudKit dashboard. This is roughly the schema you're looking for (I'm working on making this experience better, feel free to open an issue if you need help!)
  • In your app, install the package and create an instance of CloudKitFeatureFlagsRepository
let container = CKContainer(identifier: "your container goes here, please make sure it's correctly set up in the "Signing and Capabilities section in Xcode")

lazy var featureFlags = CloudKitFeatureFlagsRepository(container: container)

/// For Combine reasons
var cancellables = Set<AnyCancellable>()
  • Use the featureFlagsRepository to query the status of a feature flag. In the future (coming soon!) it'll update realtime via a CKSubscription
featureFlags.featureEnabled(name: "some_feature_flag").sink(receiveCompletion: { (_) in }) { (value) in
  /// use `value` to change your UI imperatively, or bind the publisher directly!
  print(value)
}.store(in: &cancellables)
  • And that's it! You can control feature flags and rollouts directly from the CloudKit dashboard ๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰

cloudkitfeatureflags's People

Contributors

codeofrobin 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

Watchers

 avatar  avatar  avatar

cloudkitfeatureflags's Issues

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.