@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/index.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) => {
@@ -205807,5 +205833,5 @@ export {
205807
205833
  ANGULAR_INIT_TIMEOUT_MS
205808
205834
  };
205809
205835
 
205810
- //# debugId=BA74A87B2B45F5CB64756E2164756E21
205836
+ //# debugId=949F7B3D5DEE33AF64756E2164756E21
205811
205837
  //# sourceMappingURL=index.js.map