@mmapp/react-compiler 0.1.0-alpha.20 → 0.1.0-alpha.21
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/babel/index.js +29 -5
- package/dist/babel/index.mjs +1 -1
- package/dist/chunk-5PM7CGFQ.mjs +550 -0
- package/dist/chunk-AIM5FKMV.mjs +186 -0
- package/dist/chunk-MRCNUYFA.mjs +2921 -0
- package/dist/chunk-NJNAQF5I.mjs +7533 -0
- package/dist/chunk-RTAUTGHB.mjs +248 -0
- package/dist/chunk-YOVAADAD.mjs +175 -0
- package/dist/cli/index.js +29 -5
- package/dist/cli/index.mjs +5 -5
- package/dist/dev-server.js +29 -5
- package/dist/dev-server.mjs +4 -4
- package/dist/envelope.js +29 -5
- package/dist/envelope.mjs +2 -2
- package/dist/index.js +29 -5
- package/dist/index.mjs +6 -6
- package/dist/project-compiler-HNDWIX4J.mjs +10 -0
- package/dist/testing/index.js +29 -5
- package/dist/testing/index.mjs +1 -1
- package/dist/verify-LZXUHOX6.mjs +1833 -0
- package/dist/vite/index.js +29 -5
- package/dist/vite/index.mjs +2 -2
- package/package.json +15 -5
package/dist/index.js
CHANGED
|
@@ -1386,7 +1386,14 @@ function jsxToExperienceNode(node) {
|
|
|
1386
1386
|
}
|
|
1387
1387
|
} else if (t6.isIdentifier(expr)) {
|
|
1388
1388
|
const snakeName = localFieldMap.get(expr.name);
|
|
1389
|
-
|
|
1389
|
+
const setterField = setterToFieldMap.get(expr.name);
|
|
1390
|
+
if (snakeName) {
|
|
1391
|
+
bindings[attrName] = `$local.${snakeName}`;
|
|
1392
|
+
} else if (setterField) {
|
|
1393
|
+
bindings[attrName] = `$action.setLocal("${setterField}")`;
|
|
1394
|
+
} else {
|
|
1395
|
+
bindings[attrName] = `$instance.${expr.name}`;
|
|
1396
|
+
}
|
|
1390
1397
|
} else if (isEventHandlerProp(attrName) && (t6.isArrowFunctionExpression(expr) || t6.isFunctionExpression(expr))) {
|
|
1391
1398
|
const decomposed = decomposeHandlerToSeq(expr);
|
|
1392
1399
|
if (decomposed) {
|
|
@@ -7536,6 +7543,26 @@ function createVisitor(options = {}) {
|
|
|
7536
7543
|
const id = path.node.id;
|
|
7537
7544
|
const init = path.node.init;
|
|
7538
7545
|
if (t25.isArrayPattern(id)) return;
|
|
7546
|
+
if (t25.isObjectPattern(id) && init && t25.isCallExpression(init) && t25.isIdentifier(init.callee) && init.callee.name === "useQuery") {
|
|
7547
|
+
const slug = resolveSlugArg(init.arguments, state);
|
|
7548
|
+
if (slug) {
|
|
7549
|
+
for (const prop2 of id.properties) {
|
|
7550
|
+
if (t25.isObjectProperty(prop2) && t25.isIdentifier(prop2.key) && prop2.key.name === "data") {
|
|
7551
|
+
const alias = t25.isIdentifier(prop2.value) ? prop2.value.name : null;
|
|
7552
|
+
if (alias) {
|
|
7553
|
+
const meta = compilerState.metadata;
|
|
7554
|
+
const dataSources = meta.dataSources;
|
|
7555
|
+
if (dataSources) {
|
|
7556
|
+
const ds = dataSources.find((d) => d.name === slug);
|
|
7557
|
+
if (ds) ds.name = alias;
|
|
7558
|
+
}
|
|
7559
|
+
}
|
|
7560
|
+
break;
|
|
7561
|
+
}
|
|
7562
|
+
}
|
|
7563
|
+
}
|
|
7564
|
+
return;
|
|
7565
|
+
}
|
|
7539
7566
|
if (!t25.isIdentifier(id) || !init || !t25.isExpression(init)) return;
|
|
7540
7567
|
const parentFn = path.getFunctionParent();
|
|
7541
7568
|
if (!parentFn) return;
|
|
@@ -7563,10 +7590,7 @@ function createVisitor(options = {}) {
|
|
|
7563
7590
|
return;
|
|
7564
7591
|
}
|
|
7565
7592
|
if (callee === "useMutation") {
|
|
7566
|
-
registerDerivedVar(id.name, t25.
|
|
7567
|
-
t25.identifier("$action"),
|
|
7568
|
-
t25.identifier("transition")
|
|
7569
|
-
));
|
|
7593
|
+
registerDerivedVar(id.name, t25.identifier("$action"));
|
|
7570
7594
|
return;
|
|
7571
7595
|
}
|
|
7572
7596
|
if (callee === "useServerAction") {
|
package/dist/index.mjs
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
resolveActionReferences,
|
|
14
14
|
resolveImport,
|
|
15
15
|
topologicalSort
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-MRCNUYFA.mjs";
|
|
17
17
|
import {
|
|
18
18
|
decompile,
|
|
19
19
|
decompileProject,
|
|
@@ -21,17 +21,16 @@ import {
|
|
|
21
21
|
} from "./chunk-4FP5DXY4.mjs";
|
|
22
22
|
import {
|
|
23
23
|
createDevServer
|
|
24
|
-
} from "./chunk-
|
|
25
|
-
import "./chunk-PBRBRKIQ.mjs";
|
|
24
|
+
} from "./chunk-5PM7CGFQ.mjs";
|
|
26
25
|
import {
|
|
27
26
|
buildEnvelope
|
|
28
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-AIM5FKMV.mjs";
|
|
29
28
|
import {
|
|
30
29
|
deploy
|
|
31
30
|
} from "./chunk-XUQ5R6F3.mjs";
|
|
32
31
|
import {
|
|
33
32
|
build
|
|
34
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-RTAUTGHB.mjs";
|
|
35
34
|
import {
|
|
36
35
|
computeEnvelopeId,
|
|
37
36
|
createSourceEnvelope,
|
|
@@ -42,6 +41,7 @@ import {
|
|
|
42
41
|
filterByRole,
|
|
43
42
|
generateFsTree
|
|
44
43
|
} from "./chunk-5M7DKKBC.mjs";
|
|
44
|
+
import "./chunk-YOVAADAD.mjs";
|
|
45
45
|
import {
|
|
46
46
|
babelPlugin,
|
|
47
47
|
compilerStateToWorkflow,
|
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
extractStates,
|
|
58
58
|
extractTransitions,
|
|
59
59
|
transformToFrontend
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-NJNAQF5I.mjs";
|
|
61
61
|
import "./chunk-CIESM3BP.mjs";
|
|
62
62
|
|
|
63
63
|
// src/babel/emitters/ir-to-tsx-emitter.ts
|
package/dist/testing/index.js
CHANGED
|
@@ -1268,7 +1268,14 @@ function jsxToExperienceNode(node) {
|
|
|
1268
1268
|
}
|
|
1269
1269
|
} else if (t6.isIdentifier(expr)) {
|
|
1270
1270
|
const snakeName = localFieldMap.get(expr.name);
|
|
1271
|
-
|
|
1271
|
+
const setterField = setterToFieldMap.get(expr.name);
|
|
1272
|
+
if (snakeName) {
|
|
1273
|
+
bindings[attrName] = `$local.${snakeName}`;
|
|
1274
|
+
} else if (setterField) {
|
|
1275
|
+
bindings[attrName] = `$action.setLocal("${setterField}")`;
|
|
1276
|
+
} else {
|
|
1277
|
+
bindings[attrName] = `$instance.${expr.name}`;
|
|
1278
|
+
}
|
|
1272
1279
|
} else if (isEventHandlerProp(attrName) && (t6.isArrowFunctionExpression(expr) || t6.isFunctionExpression(expr))) {
|
|
1273
1280
|
const decomposed = decomposeHandlerToSeq(expr);
|
|
1274
1281
|
if (decomposed) {
|
|
@@ -7305,6 +7312,26 @@ function createVisitor(options = {}) {
|
|
|
7305
7312
|
const id = path.node.id;
|
|
7306
7313
|
const init = path.node.init;
|
|
7307
7314
|
if (t21.isArrayPattern(id)) return;
|
|
7315
|
+
if (t21.isObjectPattern(id) && init && t21.isCallExpression(init) && t21.isIdentifier(init.callee) && init.callee.name === "useQuery") {
|
|
7316
|
+
const slug = resolveSlugArg(init.arguments, state);
|
|
7317
|
+
if (slug) {
|
|
7318
|
+
for (const prop of id.properties) {
|
|
7319
|
+
if (t21.isObjectProperty(prop) && t21.isIdentifier(prop.key) && prop.key.name === "data") {
|
|
7320
|
+
const alias = t21.isIdentifier(prop.value) ? prop.value.name : null;
|
|
7321
|
+
if (alias) {
|
|
7322
|
+
const meta = compilerState.metadata;
|
|
7323
|
+
const dataSources = meta.dataSources;
|
|
7324
|
+
if (dataSources) {
|
|
7325
|
+
const ds = dataSources.find((d) => d.name === slug);
|
|
7326
|
+
if (ds) ds.name = alias;
|
|
7327
|
+
}
|
|
7328
|
+
}
|
|
7329
|
+
break;
|
|
7330
|
+
}
|
|
7331
|
+
}
|
|
7332
|
+
}
|
|
7333
|
+
return;
|
|
7334
|
+
}
|
|
7308
7335
|
if (!t21.isIdentifier(id) || !init || !t21.isExpression(init)) return;
|
|
7309
7336
|
const parentFn = path.getFunctionParent();
|
|
7310
7337
|
if (!parentFn) return;
|
|
@@ -7332,10 +7359,7 @@ function createVisitor(options = {}) {
|
|
|
7332
7359
|
return;
|
|
7333
7360
|
}
|
|
7334
7361
|
if (callee === "useMutation") {
|
|
7335
|
-
registerDerivedVar(id.name, t21.
|
|
7336
|
-
t21.identifier("$action"),
|
|
7337
|
-
t21.identifier("transition")
|
|
7338
|
-
));
|
|
7362
|
+
registerDerivedVar(id.name, t21.identifier("$action"));
|
|
7339
7363
|
return;
|
|
7340
7364
|
}
|
|
7341
7365
|
if (callee === "useServerAction") {
|