@absolutejs/absolute 0.19.0-beta.151 → 0.19.0-beta.153

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/dist/build.js CHANGED
@@ -202757,7 +202757,7 @@ ${stubs}
202757
202757
  ` var snap = {};`,
202758
202758
  ` for (var k in result) {`,
202759
202759
  ` var v = result[k];`,
202760
- ` if (v && typeof v === "object" && "value" in v && typeof v.value !== "function") {`,
202760
+ ` if (v && typeof v === "object" && "value" in v && !v.effect && typeof v.value !== "function") {`,
202761
202761
  ` snap[k] = v.value;`,
202762
202762
  ` }`,
202763
202763
  ` }`,
@@ -202766,7 +202766,7 @@ ${stubs}
202766
202766
  ` var old = __hmr_prev[name][idx];`,
202767
202767
  ` for (var k in old) {`,
202768
202768
  ` var nv = result[k];`,
202769
- ` if (nv && typeof nv === "object" && "value" in nv && typeof nv.value === typeof old[k]) {`,
202769
+ ` if (nv && typeof nv === "object" && "value" in nv && !nv.effect && typeof nv.value === typeof old[k]) {`,
202770
202770
  ` nv.value = old[k];`,
202771
202771
  ` }`,
202772
202772
  ` }`,
@@ -202780,10 +202780,36 @@ ${stubs}
202780
202780
  let result = runtime + `
202781
202781
  ` + code;
202782
202782
  for (const name of useExports) {
202783
- const exportPattern = new RegExp(`(export\\s+var\\s+${name}\\s*=\\s*)`, "g");
202784
- result = result.replace(exportPattern, `$1__hmr_wrap(${JSON.stringify(name)}, `);
202785
- const closingPattern = new RegExp(`(export\\s+var\\s+${name}\\s*=\\s*__hmr_wrap\\([^)]+,\\s*)([\\s\\S]*?)(;\\s*(?:export\\s|$))`, "");
202786
- result = result.replace(closingPattern, `$1$2)$3`);
202783
+ const marker = new RegExp(`export\\s+(?:const|var|let)\\s+${name}\\s*=\\s*`);
202784
+ const match = marker.exec(result);
202785
+ if (!match)
202786
+ continue;
202787
+ const insertPos = match.index + match[0].length;
202788
+ let depth = 0;
202789
+ let inString = false;
202790
+ let endPos = insertPos;
202791
+ for (let i = insertPos;i < result.length; i++) {
202792
+ const ch = result[i];
202793
+ if (inString) {
202794
+ if (ch === inString && result[i - 1] !== "\\")
202795
+ inString = false;
202796
+ continue;
202797
+ }
202798
+ if (ch === '"' || ch === "'" || ch === "`") {
202799
+ inString = ch;
202800
+ continue;
202801
+ }
202802
+ if (ch === "{" || ch === "(")
202803
+ depth++;
202804
+ if (ch === "}" || ch === ")")
202805
+ depth--;
202806
+ if (depth === 0 && ch === ";") {
202807
+ endPos = i;
202808
+ break;
202809
+ }
202810
+ }
202811
+ const funcBody = result.slice(insertPos, endPos);
202812
+ result = result.slice(0, insertPos) + `__hmr_wrap(${JSON.stringify(name)}, ${funcBody})` + result.slice(endPos);
202787
202813
  }
202788
202814
  return result;
202789
202815
  }, svelteExternalCss, svelteCompiler = null, vueCompiler = null, warmCompilers = async (frameworks) => {
@@ -205145,5 +205171,5 @@ export {
205145
205171
  build
205146
205172
  };
205147
205173
 
205148
- //# debugId=0F563F1AF03F4FFC64756E2164756E21
205174
+ //# debugId=009AF50099FA2AF364756E2164756E21
205149
205175
  //# sourceMappingURL=build.js.map