mnfst-render 0.3.2 → 0.3.3
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/manifest.render.mjs +3 -2
- package/package.json +1 -1
package/manifest.render.mjs
CHANGED
|
@@ -1797,7 +1797,8 @@ async function runPrerender(config) {
|
|
|
1797
1797
|
// keep x-text/x-bind referencing card/item — Alpine then mutates or errors on the static HTML.)
|
|
1798
1798
|
await page.evaluate(() => {
|
|
1799
1799
|
const loopVarRegex = /^\s*(?:\(\s*([A-Za-z_$][\w$]*)(?:\s*,\s*([A-Za-z_$][\w$]*))?\s*\)|([A-Za-z_$][\w$]*))\s+in\s+/;
|
|
1800
|
-
|
|
1800
|
+
// Include x-init: expanded clones still had x-init="getDescription(article)" etc.; Alpine then throws (article undefined).
|
|
1801
|
+
const bindingAttrRegex = /^(?:x-bind:|:|x-text|x-html|x-show|x-if|x-model|x-effect|x-init|x-on:|@)/;
|
|
1801
1802
|
const hasVar = (expr, varName) => varName && new RegExp(`\\b${varName}\\b`).test(expr || '');
|
|
1802
1803
|
const stripLoopBindings = (el, itemVar, indexVar) => {
|
|
1803
1804
|
const nodes = [el, ...Array.from(el.querySelectorAll('*'))];
|
|
@@ -1891,7 +1892,7 @@ async function runPrerender(config) {
|
|
|
1891
1892
|
// outside their template scope. These throw Alpine errors in live static hosting.
|
|
1892
1893
|
await page.evaluate(() => {
|
|
1893
1894
|
const loopVarRegex = /^\s*(?:\(\s*([A-Za-z_$][\w$]*)(?:\s*,\s*([A-Za-z_$][\w$]*))?\s*\)|([A-Za-z_$][\w$]*))\s+in\s+/;
|
|
1894
|
-
const bindingAttrRegex = /^(?:x-bind:|:|x-text|x-html|x-show|x-if|x-model|x-effect|x-on:|@)/;
|
|
1895
|
+
const bindingAttrRegex = /^(?:x-bind:|:|x-text|x-html|x-show|x-if|x-model|x-effect|x-init|x-on:|@)/;
|
|
1895
1896
|
const hasVar = (expr, varName) => varName && new RegExp(`\\b${varName}\\b`).test(expr || '');
|
|
1896
1897
|
const elementReferencesLoopScope = (el, itemVar, indexVar) => {
|
|
1897
1898
|
if (!el) return false;
|