The lite client wraps serialized toggles, and provides an api that is similar to the full library to enable usage consistency within your application, with a much smaller bundle size.
The smart feature toggles library can be used on both node and web environments. When using the serialization feature to transfer toggles to the browser environemnt, you typically will only use a subset of the features in the browser.
To keep browser bundle sizes small, you can configure your application to load a lite version of the library. This version of the library only supports deserialisating toggles and therefore omits code related to:
- Dependencies: serialized toggles are already evaluated, and do not have dependencies.
- Housekeeping: serialized toggles do not carry health handlers.
- Serialization: the lite client can deserialize toggles, but does not contain the logic to serialize them.
- AutoResets: serialized toggles are not dynamic, so resetting toggles makes no sense.
You can load the lite version of the library by calling:
const FeatureToggles = require('smart-feature-toggles/lite');