@lwrjs/shared-utils 0.11.0-alpha.13 → 0.11.0-alpha.14
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/build/cjs/html-meta.cjs +3 -3
- package/build/es/html-meta.js +2 -2
- package/package.json +4 -4
package/build/cjs/html-meta.cjs
CHANGED
|
@@ -65,7 +65,7 @@ function hasHydrationDirective(attrs = {}) {
|
|
|
65
65
|
return Object.keys(attrs).some((attr) => attr === HYDRATE_DIRECTIVE);
|
|
66
66
|
}
|
|
67
67
|
async function extractMetadataFromHtml(htmlSource, viewMetadata, appConfig) {
|
|
68
|
-
const {customElements, assetReferences
|
|
68
|
+
const {customElements, assetReferences} = viewMetadata;
|
|
69
69
|
const {
|
|
70
70
|
bundleConfig: {external = {}}
|
|
71
71
|
} = appConfig;
|
|
@@ -126,9 +126,9 @@ async function extractMetadataFromHtml(htmlSource, viewMetadata, appConfig) {
|
|
|
126
126
|
});
|
|
127
127
|
const inputStream = import_stream.Readable.from(htmlSource);
|
|
128
128
|
inputStream.on("end", () => resolve({
|
|
129
|
+
...viewMetadata,
|
|
129
130
|
customElements: customElements.filter((ce) => !nestedIslands || hasHydrationDirective(ce.props)),
|
|
130
|
-
assetReferences
|
|
131
|
-
serverData
|
|
131
|
+
assetReferences
|
|
132
132
|
}));
|
|
133
133
|
inputStream.on("error", (error) => reject(error));
|
|
134
134
|
inputStream.pipe(parser);
|
package/build/es/html-meta.js
CHANGED
|
@@ -37,7 +37,7 @@ function hasHydrationDirective(attrs = {}) {
|
|
|
37
37
|
* @param htmlSource - An HTML string to parse
|
|
38
38
|
*/
|
|
39
39
|
export async function extractMetadataFromHtml(htmlSource, viewMetadata, appConfig) {
|
|
40
|
-
const { customElements, assetReferences
|
|
40
|
+
const { customElements, assetReferences } = viewMetadata;
|
|
41
41
|
const { bundleConfig: { external = {} }, } = appConfig;
|
|
42
42
|
const externals = Object.keys(external);
|
|
43
43
|
return new Promise((resolve, reject) => {
|
|
@@ -111,9 +111,9 @@ export async function extractMetadataFromHtml(htmlSource, viewMetadata, appConfi
|
|
|
111
111
|
// If nested islands are found, ONLY collect custom elements with the hydration directive
|
|
112
112
|
// Otherwise, just collect top-level custom elements (ie: root components) as usual
|
|
113
113
|
inputStream.on('end', () => resolve({
|
|
114
|
+
...viewMetadata,
|
|
114
115
|
customElements: customElements.filter((ce) => !nestedIslands || hasHydrationDirective(ce.props)),
|
|
115
116
|
assetReferences,
|
|
116
|
-
serverData,
|
|
117
117
|
}));
|
|
118
118
|
inputStream.on('error', (error) => reject(error));
|
|
119
119
|
inputStream.pipe(parser);
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.11.0-alpha.
|
|
7
|
+
"version": "0.11.0-alpha.14",
|
|
8
8
|
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"build/**/*.d.ts"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@lwrjs/diagnostics": "0.11.0-alpha.
|
|
40
|
+
"@lwrjs/diagnostics": "0.11.0-alpha.14",
|
|
41
41
|
"es-module-lexer": "^1.3.0",
|
|
42
42
|
"fast-json-stable-stringify": "^2.1.0",
|
|
43
43
|
"magic-string": "^0.30.0",
|
|
@@ -50,12 +50,12 @@
|
|
|
50
50
|
"slugify": "^1.4.5"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@lwrjs/types": "0.11.0-alpha.
|
|
53
|
+
"@lwrjs/types": "0.11.0-alpha.14",
|
|
54
54
|
"@types/mime-types": "2.1.1",
|
|
55
55
|
"@types/path-to-regexp": "^1.7.0"
|
|
56
56
|
},
|
|
57
57
|
"engines": {
|
|
58
58
|
"node": ">=16.0.0"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "d082cc49d9e2b5024d17a3da2c5c2bf585f811fe"
|
|
61
61
|
}
|