create-kywi-app 0.12.1 → 0.13.0
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.
- package/assets/agent-patterns.md +54 -39
- package/package.json +1 -1
package/assets/agent-patterns.md
CHANGED
|
@@ -356,7 +356,7 @@ authored elsewhere in the admin).
|
|
|
356
356
|
|
|
357
357
|
| `name` | Purpose |
|
|
358
358
|
|---|---|
|
|
359
|
-
|
|
|
359
|
+
| ~~`variantContainer`~~ | **Retired in 0.13.0** — the raw-HTML module. Use the `moduleVariantContainer` NODE (§8) or `personalize_module`. Existing placements still render |
|
|
360
360
|
| `personalizationBadge` | Optional inline status pill that opens the global transparency panel — not needed on ordinary pages (§8) |
|
|
361
361
|
| `socialShare` | Share links for a URL/title across networks |
|
|
362
362
|
| `map` | Embedded map at a lat/lng or address |
|
|
@@ -517,47 +517,62 @@ If no, skip it — the machinery is there when they grow into it.
|
|
|
517
517
|
|
|
518
518
|
### Variant containers: pick the right shape
|
|
519
519
|
|
|
520
|
-
|
|
521
|
-
interchangeable.
|
|
522
|
-
|
|
523
|
-
- **Section-level
|
|
524
|
-
`variants[].sections`). Resolved **on the server** from
|
|
525
|
-
or experiment arm, so the first paint is already
|
|
526
|
-
page is complete with JavaScript off.
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
520
|
+
Three different things have been called `variantContainer`, and they are not
|
|
521
|
+
interchangeable. Two of them are current.
|
|
522
|
+
|
|
523
|
+
- **Section-level `variantContainer`** — a *region* node, sibling of sections
|
|
524
|
+
(`defaultSections` + `variants[].sections`). Resolved **on the server** from
|
|
525
|
+
the visitor's audience or experiment arm, so the first paint is already
|
|
526
|
+
correct: no flash, and the page is complete with JavaScript off. Reach for it
|
|
527
|
+
when a whole band varies. Since kywi-cms#119 the owner does not need an agent
|
|
528
|
+
to author it: the section chrome — in the admin layout editor and the
|
|
529
|
+
front-of-site overlay alike — offers **Personalize** / **A/B test** actions
|
|
530
|
+
that wrap the section on the spot, seeding the default variant from its
|
|
531
|
+
current content and opening straight into its config.
|
|
532
|
+
- **Module-level `moduleVariantContainer`** (kywi-cms#161) — a *column* node,
|
|
533
|
+
sibling of modules (`defaultModule` + `variants[].module`, exactly one
|
|
534
|
+
module per arm; arm module types may differ, so an image arm can face a
|
|
535
|
+
text arm). Also resolved **entirely on the server** — same no-flash,
|
|
536
|
+
JS-off-complete guarantee. Reach for it when ONE element varies inside a
|
|
537
|
+
section that otherwise stays put: a headline, a CTA, a pricing card. The
|
|
538
|
+
owner reaches it from the module's own hover chrome or its props rail (the
|
|
539
|
+
same two actions), and an agent reaches it with **`personalize_module`**
|
|
540
|
+
(kywi-cms#162), which does the read-modify-write wrap and hands back the
|
|
541
|
+
container and arm ids. It always seeds one variant arm — a detached copy of
|
|
542
|
+
the module's current content — whether or not `audienceId` is passed: pass
|
|
543
|
+
it to bind the arm immediately, or omit it and the arm starts unbound
|
|
544
|
+
(`''`, serving nobody) until something binds it later.
|
|
545
|
+
- **The legacy `variantContainer` MODULE** — retired in 0.13.0 (kywi-cms#163).
|
|
546
|
+
Its arms were raw HTML strings revealed client-side by `@kywi-software/js`.
|
|
547
|
+
It is gone from the palette and from `list_module_types`, and
|
|
548
|
+
`personalize_module` is what you want instead. **Existing placements keep
|
|
549
|
+
rendering and stay editable** — nothing was deleted and no migration is
|
|
550
|
+
forced — so a page that already has one is not broken, it is simply not the
|
|
551
|
+
shape to add more of.
|
|
552
|
+
|
|
553
|
+
**Neither container ever nests.** Not one inside the other, not one inside
|
|
554
|
+
itself. A module already sitting in a personalized section's arm cannot be
|
|
555
|
+
promoted — the editor withholds the action, `personalize_module` returns a
|
|
556
|
+
structured error saying why, and `update_layout` rejects the shape outright.
|
|
557
|
+
|
|
558
|
+
**`ab_test` mode needs its own `experimentId`, and it must be FRESH.** Both
|
|
559
|
+
container kinds refuse to validate without one, and both the editors and
|
|
560
|
+
`personalize_module` mint a new id per container. Copying an experiment id
|
|
561
|
+
between pages silently enrols a second page's container in the first page's run.
|
|
548
562
|
|
|
549
563
|
Four traps, each of which fails silently:
|
|
550
564
|
|
|
551
|
-
1. **
|
|
552
|
-
(`core/src/components/personalization/`)
|
|
553
|
-
the skeleton and nothing else — a JS-off
|
|
554
|
-
and its `ab_test` path draws a fresh
|
|
555
|
-
visitor sees a different arm on
|
|
556
|
-
(`VariantContainerModule`) always renders
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
565
|
+
1. **Don't reach for the retired `variantContainer` module, or the React
|
|
566
|
+
component.** `VariantContainer.tsx` (`core/src/components/personalization/`)
|
|
567
|
+
has a loading branch that renders the skeleton and nothing else — a JS-off
|
|
568
|
+
visitor gets an empty container — and its `ab_test` path draws a fresh
|
|
569
|
+
`Math.random()` per render, so the same visitor sees a different arm on
|
|
570
|
+
every refresh. The layout module (`VariantContainerModule`) always renders
|
|
571
|
+
the default arm.
|
|
572
|
+
2. (Legacy module only.) **Leave `skeleton` off.** With `skeleton: true` the
|
|
573
|
+
container ships `aria-busy="true"` and only the client runtime clears it —
|
|
574
|
+
a JS-off visitor sits in a loading state forever.
|
|
575
|
+
3. **An audience match beats the experiment.** `selectVariantArm` returns the
|
|
561
576
|
audience arm first, so a visitor who matches an audience never enters the
|
|
562
577
|
split. Don't run an experiment and an audience variant on the same container.
|
|
563
578
|
4. **The client runtime needs `/kywi.js`.** Self-ID, behavioral re-evaluation
|
package/package.json
CHANGED