@podium/podlet 5.2.0-next.3 → 5.2.0-next.5

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
+ # [5.2.0-next.5](https://github.com/podium-lib/podlet/compare/v5.2.0-next.4...v5.2.0-next.5) (2024-09-29)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * sharpen up shadow dom usage assertion ([a47c8bc](https://github.com/podium-lib/podlet/commit/a47c8bc7bb33bc6c685d882a7f922cd39914a874))
7
+
8
+ # [5.2.0-next.4](https://github.com/podium-lib/podlet/compare/v5.2.0-next.3...v5.2.0-next.4) (2024-09-22)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * tag asset type when sending hint headers ([56c8614](https://github.com/podium-lib/podlet/commit/56c86144207956c63c7ce1d1103efe4f8ff7d7bf))
14
+
1
15
  # [5.2.0-next.3](https://github.com/podium-lib/podlet/compare/v5.2.0-next.2...v5.2.0-next.3) (2024-09-10)
2
16
 
3
17
 
package/README.md CHANGED
@@ -93,7 +93,9 @@ const podlet = new Podlet(options);
93
93
 
94
94
  #### name
95
95
 
96
- The name the podlet identifies itself by. This value must be in camelCase.
96
+ The name the podlet identifies itself by. This value can contain upper and lower case letters, numbers, the - character and the \_ character. No spaces.
97
+ When shadow DOM is used, either via the `useShadowDOM` constructor option or via the `wrapWithShadowDOM` method, the name must comply with custom element naming rules.
98
+ See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry/define#valid_custom_element_names) for more information.
97
99
 
98
100
  _Example:_
99
101
 
@@ -268,6 +270,7 @@ const podlet = new Podlet({ ..., useShadowDOM: true });
268
270
  ```
269
271
 
270
272
  Please note the following caveats when using this feature:
273
+
271
274
  1. You must name your podlet following custom element naming conventions as explained here: https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry/define#valid_custom_element_names
272
275
  2. In order to style your content, you will need to include your CSS inside the shadow DOM wrapper. You can do this using one of the following 2 options:
273
276
 
package/lib/podlet.js CHANGED
@@ -843,7 +843,7 @@ export default class PodiumPodlet {
843
843
  wrapWithShadowDOM(data) {
844
844
  assert.ok(
845
845
  customElementRegex.test(this.name),
846
- 'When using the constructor argument "useShadowDOM", podlet.name must conform to custom element naming conventions: https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry/define#valid_custom_element_names',
846
+ `When using the constructor argument "useShadowDOM" or the method podlet.wrapWithShadowDOM, podlet.name must conform to custom element naming conventions. The name "${this.name}" does not comply. See https://developer.mozilla.org/en-US/docs/Web/API/CustomElementRegistry/define#valid_custom_element_names for more information.`,
847
847
  );
848
848
 
849
849
  const styles = this.cssRoute
@@ -935,11 +935,15 @@ export default class PodiumPodlet {
935
935
  await this.httpProxy.process(incoming);
936
936
  }
937
937
 
938
- // @ts-ignore
939
- const js = incoming.js.map((asset) => asset.toHeader());
938
+ const js = incoming.js.map(
939
+ // @ts-ignore
940
+ (asset) => asset.toHeader() + '; asset-type=script',
941
+ );
940
942
 
941
- // @ts-ignore
942
- const css = incoming.css.map((asset) => asset.toHeader());
943
+ const css = incoming.css.map(
944
+ // @ts-ignore
945
+ (asset) => asset.toHeader() + '; asset-type=style',
946
+ );
943
947
 
944
948
  // Send early hints to layout client in the form of a 103 status code and a link header with js/css asset information.
945
949
  // Always send this. If no assets present, send an empty string.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@podium/podlet",
3
- "version": "5.2.0-next.3",
3
+ "version": "5.2.0-next.5",
4
4
  "type": "module",
5
5
  "description": "Module for building page fragment servers in a micro frontend architecture.",
6
6
  "license": "MIT",
@@ -37,7 +37,7 @@
37
37
  "@metrics/client": "2.5.3",
38
38
  "@podium/proxy": "5.0.24",
39
39
  "@podium/schemas": "5.0.6",
40
- "@podium/utils": "5.2.0",
40
+ "@podium/utils": "5.2.1",
41
41
  "abslog": "2.4.4",
42
42
  "ajv": "8.17.1",
43
43
  "objobj": "1.0.0"