@embeddables/cli 0.6.9 → 0.6.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -510,6 +510,18 @@ Conditions control visibility of components and pages based on User Data. The `C
510
510
 
511
511
  **Storage**: Conditions are stored in the component/page JSON and preserved in config.json (not in React/CSS/JS files).
512
512
 
513
+ ### Experiments and conditions
514
+
515
+ When visibility is gated by an experiment (a key in `connected_experiments`, otherwise the experiment is not connected and will not work, and which controls the variants as well), conditions that use that experiment key must cover both:
516
+
517
+ 1. **Control variant** – Use the control variant value (e.g. `"control"`) in condition values so the control experience is shown when that variant is assigned.
518
+ 2. **No value** – Use the special value `_no_value` in condition values so users who are not yet assigned a variant (user data has no value for that experiment key) see the intended default experience—typically the same as control.
519
+ 3. Other variant keys.
520
+
521
+ #1 and #2 should be on the same conditions as each other, whereas all other variants (#3) can be on other conditions.
522
+
523
+ Example: for experiment key `hero_test` with variants `control` and `variant_b`, the control experience might use a condition like `key: "hero_test", operator: "==", values: ["control", "_no_value"]` so both control users and users with no assignment see the control. The variant experience would use `values: ["variant_b"]`.
524
+
513
525
  ## Config.json Structure
514
526
 
515
527
  The `config.json` file contains the reduced Embeddable JSON with:
@@ -613,7 +625,7 @@ The `config.json` file contains the reduced Embeddable JSON with:
613
625
 
614
626
  5. **Global Components**: Must use the filenames to replace the `_location` property.
615
627
 
616
- 6. **Conditions**: Stored in config.json, applied at runtime. Multiple values in one condition = OR, multiple conditions = AND.
628
+ 6. **Conditions**: Stored in config.json, applied at runtime. Multiple values in one condition = OR, multiple conditions = AND. For experiment-gated conditions, when setting the control variant's conditions always include both the control variant value and `_no_value` so both control and unassigned users see the intended default.
617
629
 
618
630
  7. **CSS Selectors**: Must follow exact structure with proper spacing (trailing space on breakpoints, leading space on sub-elements).
619
631
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@embeddables/cli",
3
- "version": "0.6.9",
3
+ "version": "0.6.10",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "embeddables": "./bin/embeddables.mjs"