@speedkit/cli 2.87.0 → 2.89.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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [2.89.0](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v2.88.0...v2.89.0) (2025-07-04)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **wizard:** ssr custom element handling ([ef8a297](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/ef8a297d7dd094a5b1f5614b1ccaed817e35574e))
|
|
7
|
+
|
|
8
|
+
# [2.88.0](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v2.87.0...v2.88.0) (2025-06-19)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **customer-config:** suppress ecConversion tracking event for Shopify customers ([bad89dd](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/bad89ddaeca4e535c37ca1f36ab490d03eb2813e))
|
|
14
|
+
|
|
1
15
|
# [2.87.0](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v2.86.0...v2.87.0) (2025-06-04)
|
|
2
16
|
|
|
3
17
|
|
package/README.md
CHANGED
|
@@ -419,6 +419,8 @@ export const post = async (db, req, res) => {
|
|
|
419
419
|
* Overrides the window.customElements.define method to add custom code before calling the original function.
|
|
420
420
|
*/
|
|
421
421
|
function overrideDefine() {
|
|
422
|
+
/* global HTMLElement, window, customElements */
|
|
423
|
+
|
|
422
424
|
// Store the original function
|
|
423
425
|
// eslint-disable-next-line no-undef
|
|
424
426
|
let originalDefine = window.customElements.define;
|
|
@@ -426,59 +428,89 @@ export const post = async (db, req, res) => {
|
|
|
426
428
|
// Create new function
|
|
427
429
|
// eslint-disable-next-line no-undef
|
|
428
430
|
window.customElements.define = function (e, o, options) {
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
super();
|
|
434
|
-
}
|
|
431
|
+
if (options?.is && options?.is.length > 0) {
|
|
432
|
+
// eslint-disable-next-line no-undef
|
|
433
|
+
return originalDefine.call(window.customElements, e, o, options);
|
|
434
|
+
}
|
|
435
435
|
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
436
|
+
const lifeCycleCallbacks = [
|
|
437
|
+
"connectedCallback",
|
|
438
|
+
"disconnectedCallback",
|
|
439
|
+
"adoptedCallback",
|
|
440
|
+
"connectedMoveCallback",
|
|
441
|
+
"attributeChangedCallback",
|
|
442
|
+
"formAssociatedCallback",
|
|
443
|
+
"formResetCallback",
|
|
444
|
+
"formDisabledCallback",
|
|
445
|
+
"formStateRestoreCallback",
|
|
446
|
+
];
|
|
447
|
+
|
|
448
|
+
let preventInit = false;
|
|
449
|
+
let skProxy = function () {
|
|
450
|
+
// This constructor is invoked for every custom element.
|
|
451
|
+
// However, we can return a new instance in this constructor which is then used for upgrading the element.
|
|
452
|
+
// We are using the Reflect.construct method to prevent invoking the original constructor
|
|
453
|
+
// initialization code if we are in the static rendered DOM tree of Speed Kit
|
|
454
|
+
let instance;
|
|
455
|
+
if (preventInit) {
|
|
456
|
+
instance = Reflect.construct(HTMLElement, arguments, skProxy);
|
|
457
|
+
instance.__skStatic = preventInit;
|
|
458
|
+
} else {
|
|
459
|
+
instance = Reflect.construct(o, arguments, skProxy);
|
|
442
460
|
}
|
|
443
461
|
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
if (this.hasAttribute("data-sk-static")) {
|
|
447
|
-
return;
|
|
448
|
-
}
|
|
449
|
-
// normal functionality
|
|
450
|
-
super.disconnectedCallback();
|
|
451
|
-
}
|
|
462
|
+
return instance;
|
|
463
|
+
};
|
|
452
464
|
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
465
|
+
// create a dynamic proxy class which si overwriting all lifecycle hooks of the original class
|
|
466
|
+
skProxy.prototype = Object.create(o.prototype, {
|
|
467
|
+
constructor: {
|
|
468
|
+
value: skProxy,
|
|
469
|
+
writable: true,
|
|
470
|
+
configurable: true,
|
|
471
|
+
},
|
|
472
|
+
...Object.fromEntries(
|
|
473
|
+
lifeCycleCallbacks
|
|
474
|
+
.map((callbackName) => [callbackName, o.prototype[callbackName]])
|
|
475
|
+
.filter(([, hasCallback]) => hasCallback)
|
|
476
|
+
.map(([callbackName, callback]) => {
|
|
477
|
+
return [
|
|
478
|
+
callbackName,
|
|
479
|
+
{
|
|
480
|
+
value: function () {
|
|
481
|
+
if (!this.__skStatic) {
|
|
482
|
+
return callback.apply(this, arguments);
|
|
483
|
+
}
|
|
484
|
+
},
|
|
485
|
+
writable: true,
|
|
486
|
+
configurable: true,
|
|
487
|
+
},
|
|
488
|
+
];
|
|
489
|
+
}),
|
|
490
|
+
),
|
|
491
|
+
});
|
|
461
492
|
|
|
462
|
-
|
|
463
|
-
// for sk-shadow-root don't do anything
|
|
464
|
-
if (this.hasAttribute("data-sk-static")) {
|
|
465
|
-
return;
|
|
466
|
-
}
|
|
467
|
-
// normal functionality
|
|
468
|
-
super.attributeChangedCallback(name, oldValue, newValue);
|
|
469
|
-
}
|
|
493
|
+
Object.setPrototypeOf(skProxy, o);
|
|
470
494
|
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
495
|
+
const skContainer = document.querySelector(".speed-kit-shadow-app-root");
|
|
496
|
+
let skContainerParentNode;
|
|
497
|
+
let skContainerNextNode;
|
|
498
|
+
if (skContainer) {
|
|
499
|
+
skContainerParentNode = skContainer.parentNode;
|
|
500
|
+
skContainerNextNode = skContainer.nextSibling;
|
|
501
|
+
skContainer.remove();
|
|
502
|
+
}
|
|
478
503
|
|
|
479
|
-
//
|
|
480
|
-
//
|
|
504
|
+
// Control the upgrade of the sk static dom tree by temporary removing the tree while
|
|
505
|
+
// defining the new custom element. Do then a controlled upgrade of the sk dom tree by
|
|
506
|
+
// preventing the constructor invocation of the custom element class
|
|
481
507
|
originalDefine.call(window.customElements, e, skProxy, options);
|
|
508
|
+
if (skContainer) {
|
|
509
|
+
preventInit = true;
|
|
510
|
+
skContainerParentNode.insertBefore(skContainer, skContainerNextNode);
|
|
511
|
+
customElements.upgrade(skContainer);
|
|
512
|
+
preventInit = false;
|
|
513
|
+
}
|
|
482
514
|
};
|
|
483
515
|
}
|
|
484
516
|
|
|
@@ -34,7 +34,10 @@ import { PredictivePreloading } from 'predictive-preloading/predictivePreloading
|
|
|
34
34
|
{{/if}}
|
|
35
35
|
{{#if useGATracking}}
|
|
36
36
|
new GAEcommerceTrackingPlugin({
|
|
37
|
-
defaultCurrency: defaultCurrency
|
|
37
|
+
defaultCurrency: defaultCurrency,
|
|
38
|
+
{{#if isShopify}}
|
|
39
|
+
trackConfirmation: false, // No ecConversion tracking as it is already handled by the Speed Kit Extension for Shopify
|
|
40
|
+
{{/if}}
|
|
38
41
|
}),
|
|
39
42
|
{{/if}}
|
|
40
43
|
|
|
@@ -341,27 +344,8 @@ import { PredictivePreloading } from 'predictive-preloading/predictivePreloading
|
|
|
341
344
|
// }
|
|
342
345
|
// },
|
|
343
346
|
// },
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
on: ShopifyReady,
|
|
347
|
-
set: function() {
|
|
348
|
-
var confirmationPage = location.pathname.indexOf('/thank_you') > -1;
|
|
349
|
-
if (
|
|
350
|
-
confirmationPage &&
|
|
351
|
-
window.Shopify?.checkout
|
|
352
|
-
) {
|
|
353
|
-
var orderId = window.Shopify.checkout.order_id;
|
|
354
|
-
var orderCurrency = window.Shopify.checkout.currency;
|
|
355
|
-
var orderValue = window.Shopify.checkout.total_price;
|
|
356
|
-
|
|
357
|
-
return {
|
|
358
|
-
id: orderId,
|
|
359
|
-
currencyCode: orderCurrency || defaultCurrency,
|
|
360
|
-
revenue: Number(orderValue),
|
|
361
|
-
};
|
|
362
|
-
}
|
|
363
|
-
},
|
|
364
|
-
},
|
|
347
|
+
|
|
348
|
+
// No custom ecConversion tracking event as it is already handled by the Speed Kit Extension for Shopify
|
|
365
349
|
{{else}}
|
|
366
350
|
|
|
367
351
|
{
|
package/oclif.manifest.json
CHANGED