@vesk/vesk-cli 0.2.34 → 0.2.35

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.
Files changed (2) hide show
  1. package/dist/cli.js +30 -5
  2. package/package.json +5 -5
package/dist/cli.js CHANGED
@@ -2762,6 +2762,12 @@ var init_hydrate = __esm({
2762
2762
  }
2763
2763
  const el = tm.comment.nextElementSibling;
2764
2764
  if (this.isAlreadyAdopted(tm, el)) continue;
2765
+ if (el === null && tm.identity !== null && tm.identity.charAt(0) === "c") {
2766
+ tm.state = "claimed";
2767
+ tm.comment.remove();
2768
+ this.idx++;
2769
+ continue;
2770
+ }
2765
2771
  if (tag && el && el.tagName.toLowerCase() !== tag) {
2766
2772
  reportMiss(
2767
2773
  "tag-mismatch",
@@ -2778,6 +2784,7 @@ var init_hydrate = __esm({
2778
2784
  }
2779
2785
  this.recordAdopted(adopted);
2780
2786
  this.retireAliases(adopted);
2787
+ this.retireAliasesOf(adopted);
2781
2788
  tm.state = "claimed";
2782
2789
  return adopted;
2783
2790
  }
@@ -2807,6 +2814,12 @@ ${String(this.root.outerHTML).slice(0, 800)}` : ""),
2807
2814
  }
2808
2815
  const el = tm.comment.nextElementSibling;
2809
2816
  if (this.isAlreadyAdopted(tm, el)) continue;
2817
+ if (el === null && tm.identity !== null && tm.identity.charAt(0) === "c") {
2818
+ tm.state = "claimed";
2819
+ tm.comment.remove();
2820
+ this.idx++;
2821
+ continue;
2822
+ }
2810
2823
  if (tag && el && el.tagName.toLowerCase() !== tag) {
2811
2824
  reportMiss(
2812
2825
  "tag-mismatch",
@@ -2823,6 +2836,7 @@ ${String(this.root.outerHTML).slice(0, 800)}` : ""),
2823
2836
  }
2824
2837
  this.recordAdopted(adopted);
2825
2838
  this.retireAliases(adopted);
2839
+ this.retireAliasesOf(adopted);
2826
2840
  tm.state = "claimed";
2827
2841
  return adopted;
2828
2842
  }
@@ -19976,6 +19990,13 @@ function getReturnArgument(node) {
19976
19990
  }
19977
19991
  return null;
19978
19992
  }
19993
+ function getReturnStatement(node) {
19994
+ if (node.type === "ReturnStatement") return node;
19995
+ if (node.type === "BlockStatement" && node.body.length === 1 && node.body[0].type === "ReturnStatement") {
19996
+ return node.body[0];
19997
+ }
19998
+ return null;
19999
+ }
19979
20000
  function isStatementMode(bodyStmts) {
19980
20001
  if (bodyStmts.some((s) => s.type === "JSXElement" || s.type === "JSXExpressionContainer" || s.type === "JSXFragment")) return true;
19981
20002
  for (const stmt of bodyStmts) {
@@ -20105,9 +20126,9 @@ function processStatementModeBody(source, bodyStmts, filename) {
20105
20126
  const refName = getComponentRefName(stmt);
20106
20127
  if (refName) nodes.push(new ComponentRef(refName));
20107
20128
  } else if (stmt.type === "IfStatement") {
20108
- const guardArg = !stmt.alternate ? getReturnArgument(stmt.consequent) : null;
20109
- if (guardArg) {
20110
- const consequent = exprToIR(source, guardArg);
20129
+ const guardReturn = !stmt.alternate ? getReturnStatement(stmt.consequent) : null;
20130
+ if (guardReturn) {
20131
+ const consequent = guardReturn.argument ? exprToIR(source, guardReturn.argument) : [];
20111
20132
  const alternate = processStatementModeBody(source, bodyStmts.slice(i + 1), filename);
20112
20133
  nodes.push(new OpaqueDynamicRegion(toExpression(source, stmt.test), consequent, alternate));
20113
20134
  break;
@@ -28719,7 +28740,9 @@ function emitComponentCall(ctx2, node, tracked2, effectsVar, parentVar, compPref
28719
28740
  ctx2.push(`return $f; })();`);
28720
28741
  propsEntries.push(`children: ${frag}`);
28721
28742
  }
28722
- ctx2.push(`const ${v} = ${awaitKw}${access}(${callArgs()}, __registry, ${walkerArg});`);
28743
+ ctx2.push(`let ${v} = undefined;`);
28744
+ ctx2.push(`if (__hydrate) __hydrate.childFrame = (__hydrate.childFrame || 0) + 1;`);
28745
+ ctx2.push(`try { ${v} = ${awaitKw}${access}(${callArgs()}, __registry, ${walkerArg}); } finally { if (__hydrate) __hydrate.childFrame--; }`);
28723
28746
  maybeReplace(v);
28724
28747
  maybeRetire();
28725
28748
  return v;
@@ -42825,7 +42848,9 @@ function emitComponentCall2(ctx2, node, tracked2, effectsVar, parentVar, compPre
42825
42848
  ctx2.push(`return $f; })();`);
42826
42849
  propsEntries.push(`children: ${frag}`);
42827
42850
  }
42828
- ctx2.push(`const ${v} = ${awaitKw}${access}(${callArgs()}, __registry, ${walkerArg});`);
42851
+ ctx2.push(`let ${v} = undefined;`);
42852
+ ctx2.push(`if (__hydrate) __hydrate.childFrame = (__hydrate.childFrame || 0) + 1;`);
42853
+ ctx2.push(`try { ${v} = ${awaitKw}${access}(${callArgs()}, __registry, ${walkerArg}); } finally { if (__hydrate) __hydrate.childFrame--; }`);
42829
42854
  maybeReplace(v);
42830
42855
  maybeRetire();
42831
42856
  return v;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vesk/vesk-cli",
3
- "version": "0.2.34",
3
+ "version": "0.2.35",
4
4
  "type": "module",
5
5
  "description": "Vesk — compiler-first framework for the post-VDOM web. vesk dev, vesk build.",
6
6
  "bin": {
@@ -8,10 +8,10 @@
8
8
  },
9
9
  "main": "./dist/cli.js",
10
10
  "dependencies": {
11
- "@vesk/adapter": "^0.2.34",
12
- "@vesk/compiler": "^0.2.34",
13
- "@vesk/plugin-tailwind": "^0.2.34",
14
- "@vesk/runtime": "^0.2.34",
11
+ "@vesk/adapter": "^0.2.35",
12
+ "@vesk/compiler": "^0.2.35",
13
+ "@vesk/plugin-tailwind": "^0.2.35",
14
+ "@vesk/runtime": "^0.2.35",
15
15
  "esrap": "^2.3.0",
16
16
  "typescript": "^5.8.0",
17
17
  "ws": "^8.18.0",