@speedkit/cli 2.79.0 → 2.81.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,18 @@
1
+ # [2.81.0](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v2.80.0...v2.81.0) (2025-02-25)
2
+
3
+
4
+ ### Features
5
+
6
+ * **wizard:** handle different use-cases of PredictivePreloading library ([3c6f10e](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/3c6f10ebb74bdc5efed8872c9b3483bedd2851f0))
7
+
8
+ # [2.80.0](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v2.79.0...v2.80.0) (2025-02-19)
9
+
10
+
11
+ ### Features
12
+
13
+ * **wizard:** add ssr default container as prerender so its not removed and body as db can be used ([3c4702f](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/3c4702fa13aad2619a6c6c5266de4abc53014676))
14
+ * **wizard:** extend ssr handling by handling customElements better, remove unneeded code ([f686e1a](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/f686e1aed720351375f3f834d3797ef573e87cf7))
15
+
1
16
  # [2.79.0](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v2.78.0...v2.79.0) (2025-02-12)
2
17
 
3
18
 
package/README.md CHANGED
@@ -21,7 +21,7 @@ $ npm install -g @speedkit/cli
21
21
  $ sk COMMAND
22
22
  running command...
23
23
  $ sk (--version)
24
- @speedkit/cli/2.79.0 linux-x64 node-v20.18.3
24
+ @speedkit/cli/2.81.0 linux-x64 node-v20.18.3
25
25
  $ sk --help [COMMAND]
26
26
  USAGE
27
27
  $ sk COMMAND
@@ -214,14 +214,6 @@
214
214
  {
215
215
  host: ["www.paypal.com", "www.paypalobjects.com"],
216
216
  },
217
- {
218
- // CORS LCP Image Domain / CORS Image Domain with missing timing-allow-origin header:
219
- host: [
220
- // TODO: add CORS image domains if domain provides LCP resource or timing-allow-origin header is missing
221
- // – remove whole block if there are no domains to be listed
222
- ],
223
- contentType: ["image"],
224
- },
225
217
  {{#if isShopify}}
226
218
 
227
219
  // Shopify specific:
@@ -389,12 +389,16 @@ export const post = async (db, req, res) => {
389
389
  */
390
390
  async function waitForCallback() {
391
391
  const undefinedElements = document.querySelectorAll(":not(:defined)");
392
+ // need to be defined here as they are sent to the lambda function
393
+ const customElementNames = [
394
+ // TODO add correct custom element names (find them by executing document.querySelectorAll(":not(:defined)"))
395
+ ];
392
396
 
393
397
  const promises = [...undefinedElements]
394
- .filter((button) => button.localName.startsWith("{{shadowDomCustomElementPrefix}}"))
395
- .map((button) => {
398
+ .filter((element) => customElementNames.some((name) => element.localName.includes(name)))
399
+ .map((element) => {
396
400
  // eslint-disable-next-line no-undef
397
- return customElements.whenDefined(button.localName);
401
+ return customElements.whenDefined(element.localName);
398
402
  });
399
403
 
400
404
  return await Promise.race([
@@ -499,7 +503,6 @@ export const post = async (db, req, res) => {
499
503
  function walkPreRenderedElements(document) {
500
504
  const customShadowElements = getCustomShadowElements(document);
501
505
  walkElements(customShadowElements, (element) => {
502
- addStaticContextForPrerenderedElements(element);
503
506
  // TODO extend if shadow-doms should be modified, as access to the shadow dom is not possible via querySelectors from the outside
504
507
  });
505
508
  }
@@ -520,21 +523,6 @@ export const post = async (db, req, res) => {
520
523
  }
521
524
  });
522
525
  }
523
-
524
- /**
525
- * Adds static context for prerendered elements.
526
- *
527
- * @param {Element} element The element to add static context for.
528
- */
529
- function addStaticContextForPrerenderedElements(element) {
530
- if (
531
- "name" in element &&
532
- element.name !== undefined &&
533
- element.name.startsWith("{{shadowDomCustomElementPrefix}}")
534
- ) {
535
- element.setAttribute("data-sk-static", "1");
536
- }
537
- }
538
526
  {{else}}
539
527
  {{/if}}
540
528
  {{/if}}
@@ -10,16 +10,14 @@
10
10
  // keep aligned with DocumentHandler's config.ignoreAssets
11
11
  ],
12
12
  },
13
+ // ssr container
14
+ prerendered: [{ selector: "body > .speed-kit-shadow-app-root" }],
13
15
  {{/if}}
14
16
 
15
17
  blocks: [
16
18
  // TODO: adjust/replace this exemplary list
17
19
  {
18
- {{#if addPreRendering}}
19
- selector: ".prerendered-top-level-element",
20
- {{else}}
21
20
  selector: "body",
22
- {{/if}}
23
21
  detectChanges: [
24
22
  // Main Headline:
25
23
  {
@@ -72,19 +70,12 @@
72
70
  }],
73
71
  },
74
72
  // Cover all the other high-level Shopify sections:
75
- {{#if addPreRendering}}
76
- {
77
- selector: "body > .shopify-section[id]",
78
- idAttribute: "id",
79
- },
80
- {{else}}
81
73
  // TODO: activate if body is not the main block
82
74
  // {
83
75
  // selector: "body > .shopify-section[id]",
84
76
  // idAttribute: "id",
85
77
  // },
86
78
  {{/if}}
87
- {{/if}}
88
79
  {{#if isPlentymarkets}}
89
80
 
90
81
  // Plentymarkets specific:
@@ -617,7 +617,12 @@ import { PredictivePreloading } from 'predictive-preloading/predictivePreloading
617
617
  }
618
618
  {{/if}}
619
619
 
620
+ {{#if hasSoftNavigations}}
620
621
  new PredictivePreloading({
621
- // TODO: configure according to the needs of the customer
622
+ // TODO: configure according to the needs of the customer e.g. preload API-calls, soft-nav to hard-nav conversion...
622
623
  });
624
+ {{else}}
625
+ // TODO: check if prerendering needs to be scoped to certain pages
626
+ new PredictivePreloading({ prerender: true });
627
+ {{/if}}
623
628
  }();
@@ -712,5 +712,5 @@
712
712
  ]
713
713
  }
714
714
  },
715
- "version": "2.79.0"
715
+ "version": "2.81.0"
716
716
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@speedkit/cli",
3
3
  "description": "Speed Kit CLI",
4
- "version": "2.79.0",
4
+ "version": "2.81.0",
5
5
  "author": {
6
6
  "name": "Baqend.com",
7
7
  "email": "info@baqend.com"