91.0.0
v91.0.0 (2022-01-31)
Nimbus FML
What's New
- The Nimbus FML can now generate swift code for the feature manifest. (#4780)
- It can be invoked using:
$ nimbus-fml <FEATURE_MANIFEST_YAML> -o <OUTPUT_NAME> ios features
- You can check the support flags and options by running:
$ nimbus-fml ios --help
- The generated code exposes:
- a high level nimbus object, whose name is configurable using the
--classname
option. By default the object isMyNimbus
. - All the enums and objects defined in the manifest as idiomatic Swift code.
- a high level nimbus object, whose name is configurable using the
- Usage:
- To access a feature's value:
// MyNimbus is the class that holds all the features supported by Nimbus // MyNimbus has an singleton instance, you can access it using the `shared` field: let nimbus = MyNimbus.shared // Then you can access the features using: // MyNimbus.features.<featureNameCamelCase>.value(), for example: let feature = nimbus.features.homepage.value()
- To access a field in the feature:
// feature.<propertyNameCamelCase>, for example: assert(feature.sectionsEnabled[HomeScreenSection.topSites] == true)
- To access a feature's value:
⚠️ Breaking Changes ⚠️
-
Android only: Accessing drawables has changed to give access to the resource identifier. (#4801)
- Migration path to the old behaviour is:
let drawable: Drawable = MyNimbus.features.exampleFeature.demoDrawable
becomes:
let drawable: Drawable = MyNimbus.features.exampleFeature.demoDrawable.resource