@lime-bundles/widget 3.0.0 → 3.1.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/dist/index.cjs +4 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -6
- package/dist/index.js.map +1 -1
- package/dist/lime-bundle.global.js +11 -11
- package/dist/lime-bundle.global.js.map +1 -1
- package/docs/react-nextjs.md +1 -11
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -4183,19 +4183,17 @@ var LimeBundleElement = class extends HTMLElement {
|
|
|
4183
4183
|
* Resolve the visitor's A/B bucket for every bundle with an active test
|
|
4184
4184
|
* and merge Variant B overrides where applicable. Runs in parallel; any
|
|
4185
4185
|
* assignment failure logs internally but still renders Variant A (safe
|
|
4186
|
-
* default). The `getABTestAssignment` helper
|
|
4187
|
-
*
|
|
4188
|
-
* analytics.
|
|
4186
|
+
* default). The `getABTestAssignment` helper persists the bucket via a
|
|
4187
|
+
* first-party cookie; variant attribution is recorded server-side from
|
|
4188
|
+
* the analytics events the widget already emits.
|
|
4189
4189
|
*/
|
|
4190
4190
|
async applyABVariants() {
|
|
4191
|
-
if (
|
|
4191
|
+
if (this.bundles.length === 0) return;
|
|
4192
4192
|
const results = await Promise.all(
|
|
4193
4193
|
this.bundles.map(async (bundle) => {
|
|
4194
4194
|
if (!bundle.abTestId || !bundle.abVariantB) return bundle;
|
|
4195
4195
|
try {
|
|
4196
4196
|
const assignment = await (0, import_core8.getABTestAssignment)(
|
|
4197
|
-
this.appUrl,
|
|
4198
|
-
this.shopDomain,
|
|
4199
4197
|
bundle.abTestId,
|
|
4200
4198
|
bundle.id
|
|
4201
4199
|
);
|