@fictjs/compiler 0.10.0 → 0.11.0

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.cjs CHANGED
@@ -16719,10 +16719,12 @@ function convertJSXMemberExpr(node) {
16719
16719
  };
16720
16720
  }
16721
16721
 
16722
- // src/fine-grained-dom.ts
16722
+ // src/ir/dependency-key.ts
16723
16723
  function normalizeDependencyKey(name) {
16724
- return name.split(".").map((part) => part.replace(/_\d+$/, "")).join(".");
16724
+ return name.split(".").map((part) => getSSABaseName(part)).join(".");
16725
16725
  }
16726
+
16727
+ // src/fine-grained-dom.ts
16726
16728
  function applyRegionMetadata(state, options) {
16727
16729
  if (!options.region) return;
16728
16730
  const region = options.region;
@@ -24215,7 +24217,7 @@ function extractKeyFromMapCallback(callback) {
24215
24217
 
24216
24218
  // src/ir/codegen-overrides.ts
24217
24219
  function normalizeDependencyKey2(name) {
24218
- return name.split(".").map((part) => deSSAVarName(part)).join(".");
24220
+ return normalizeDependencyKey(name);
24219
24221
  }
24220
24222
  function getDependencyPathFromNode(node, t4) {
24221
24223
  if (t4.isIdentifier(node)) {
@@ -33839,9 +33841,18 @@ function isInsideLoop(path2) {
33839
33841
  );
33840
33842
  }
33841
33843
  function isInsideConditional(path2) {
33842
- return !!path2.findParent(
33843
- (p) => p.isIfStatement?.() || p.isConditionalExpression?.() || p.isSwitchCase?.()
33844
- );
33844
+ let current = path2;
33845
+ while (current?.parentPath) {
33846
+ const parent = current.parentPath;
33847
+ if (parent.isIfStatement?.() || parent.isConditionalExpression?.() || parent.isSwitchCase?.()) {
33848
+ return true;
33849
+ }
33850
+ if (parent.isLogicalExpression?.() && current.key === "right") {
33851
+ return true;
33852
+ }
33853
+ current = parent;
33854
+ }
33855
+ return false;
33845
33856
  }
33846
33857
  function isInsideJSX(path2) {
33847
33858
  return !!path2.findParent((p) => p.isJSXElement?.() || p.isJSXFragment?.());
package/dist/index.js CHANGED
@@ -16704,10 +16704,12 @@ function convertJSXMemberExpr(node) {
16704
16704
  };
16705
16705
  }
16706
16706
 
16707
- // src/fine-grained-dom.ts
16707
+ // src/ir/dependency-key.ts
16708
16708
  function normalizeDependencyKey(name) {
16709
- return name.split(".").map((part) => part.replace(/_\d+$/, "")).join(".");
16709
+ return name.split(".").map((part) => getSSABaseName(part)).join(".");
16710
16710
  }
16711
+
16712
+ // src/fine-grained-dom.ts
16711
16713
  function applyRegionMetadata(state, options) {
16712
16714
  if (!options.region) return;
16713
16715
  const region = options.region;
@@ -24200,7 +24202,7 @@ function extractKeyFromMapCallback(callback) {
24200
24202
 
24201
24203
  // src/ir/codegen-overrides.ts
24202
24204
  function normalizeDependencyKey2(name) {
24203
- return name.split(".").map((part) => deSSAVarName(part)).join(".");
24205
+ return normalizeDependencyKey(name);
24204
24206
  }
24205
24207
  function getDependencyPathFromNode(node, t4) {
24206
24208
  if (t4.isIdentifier(node)) {
@@ -33824,9 +33826,18 @@ function isInsideLoop(path2) {
33824
33826
  );
33825
33827
  }
33826
33828
  function isInsideConditional(path2) {
33827
- return !!path2.findParent(
33828
- (p) => p.isIfStatement?.() || p.isConditionalExpression?.() || p.isSwitchCase?.()
33829
- );
33829
+ let current = path2;
33830
+ while (current?.parentPath) {
33831
+ const parent = current.parentPath;
33832
+ if (parent.isIfStatement?.() || parent.isConditionalExpression?.() || parent.isSwitchCase?.()) {
33833
+ return true;
33834
+ }
33835
+ if (parent.isLogicalExpression?.() && current.key === "right") {
33836
+ return true;
33837
+ }
33838
+ current = parent;
33839
+ }
33840
+ return false;
33830
33841
  }
33831
33842
  function isInsideJSX(path2) {
33832
33843
  return !!path2.findParent((p) => p.isJSXElement?.() || p.isJSXFragment?.());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fictjs/compiler",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "Babel plugin for Fict Compiler",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -48,7 +48,7 @@
48
48
  "@types/babel__helper-plugin-utils": "^7.10.3",
49
49
  "@types/babel__traverse": "^7.28.0",
50
50
  "tsup": "^8.5.1",
51
- "@fictjs/runtime": "0.10.0"
51
+ "@fictjs/runtime": "0.11.0"
52
52
  },
53
53
  "scripts": {
54
54
  "build": "tsup src/index.ts --format cjs,esm --dts",