@talend/incubation v1.4.5
IncubationJS
This package contains a PoC of the script to insert an incubated feature into an app, without being too intrusive, and without having to release the app for every feature.
Requirements
The target applications must depend on those libs of features.
@talend/feature-flipping v2.1.0+
@talend/feature-flipping
fetches the LaunchDarkly feature flags. Since v2.1.0, it exposes the flags as global variables, so they can be consumed by other scripts.
Talend CDN
Apps that rely on CDN download an inject.js
that orchestrates the libs to download. The IncubationJS script can be added via this mecanism.
Demo
Concepts
LaunchDarkly feature flags
There are 2 types of flags:
- a global flag to turn off/on all incubation TPI-59-incubation
- a flag per incubated feature (example TPI-59-incubation-anomaly-detection-enabled
Create a new feature flag
- Log into LaunchDarkly via okta
- Clic on the
+FLAG
button - Fill the name and key, following the same pattern as the other flags (
<jira-ticket>-<feature-name>
). Leave the type as boolean - Validate
Enable flag
- Click on the flag to edit
- Check the environment you're editing on the top-left corner of the LaunchDarkly UI
- In
Target individual users
section, add the target tenants. The flag will be available only for them. Example:incubation.talend.com
. - Click on the ON/OFF switch
Flag usage
The flags are exposed as global variable by @talend/feature-flipping v2.1.0+
in the cloud applications. The incubation script consumes them directly.
Code: check if a feature flag is enabled
The global incubation flag
This flag is checked before running any feature code. It's the only global entry point.
Code: check if global flag is enabled
A flag by feature
A flag is created for each feature, and tested before running the specific feature.
Each feature has to expose its flag key to make the incubation script check before running the feature code. Example: Anomaly detection