@mmapp/react-compiler 0.1.0-alpha.19 → 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-4FP5DXY4.mjs +3456 -0
- package/dist/chunk-5PM7CGFQ.mjs +550 -0
- package/dist/chunk-AIM5FKMV.mjs +186 -0
- package/dist/chunk-EYLOSECJ.mjs +544 -0
- package/dist/chunk-I6SSPILI.mjs +550 -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-U6F7CTHK.mjs +550 -0
- package/dist/chunk-XUQ5R6F3.mjs +213 -0
- package/dist/chunk-YOVAADAD.mjs +175 -0
- package/dist/cli/index.js +42 -14
- package/dist/cli/index.mjs +9 -9
- package/dist/deploy-VAHWALWB.mjs +9 -0
- package/dist/dev-server.js +40 -12
- package/dist/dev-server.mjs +4 -4
- package/dist/envelope.js +29 -5
- package/dist/envelope.mjs +2 -2
- package/dist/index.js +41 -13
- package/dist/index.mjs +8 -8
- package/dist/init-AVZJHZYY.mjs +538 -0
- package/dist/project-compiler-HNDWIX4J.mjs +10 -0
- package/dist/project-decompiler-QCZYY4TW.mjs +7 -0
- package/dist/pull-5WJ4LW4U.mjs +109 -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/mm-dev.db +0 -0
- package/package.json +15 -5
package/dist/vite/index.js
CHANGED
|
@@ -1257,7 +1257,14 @@ function jsxToExperienceNode(node) {
|
|
|
1257
1257
|
}
|
|
1258
1258
|
} else if (t6.isIdentifier(expr)) {
|
|
1259
1259
|
const snakeName = localFieldMap.get(expr.name);
|
|
1260
|
-
|
|
1260
|
+
const setterField = setterToFieldMap.get(expr.name);
|
|
1261
|
+
if (snakeName) {
|
|
1262
|
+
bindings[attrName] = `$local.${snakeName}`;
|
|
1263
|
+
} else if (setterField) {
|
|
1264
|
+
bindings[attrName] = `$action.setLocal("${setterField}")`;
|
|
1265
|
+
} else {
|
|
1266
|
+
bindings[attrName] = `$instance.${expr.name}`;
|
|
1267
|
+
}
|
|
1261
1268
|
} else if (isEventHandlerProp(attrName) && (t6.isArrowFunctionExpression(expr) || t6.isFunctionExpression(expr))) {
|
|
1262
1269
|
const decomposed = decomposeHandlerToSeq(expr);
|
|
1263
1270
|
if (decomposed) {
|
|
@@ -7294,6 +7301,26 @@ function createVisitor(options = {}) {
|
|
|
7294
7301
|
const id = path.node.id;
|
|
7295
7302
|
const init = path.node.init;
|
|
7296
7303
|
if (t21.isArrayPattern(id)) return;
|
|
7304
|
+
if (t21.isObjectPattern(id) && init && t21.isCallExpression(init) && t21.isIdentifier(init.callee) && init.callee.name === "useQuery") {
|
|
7305
|
+
const slug = resolveSlugArg(init.arguments, state);
|
|
7306
|
+
if (slug) {
|
|
7307
|
+
for (const prop of id.properties) {
|
|
7308
|
+
if (t21.isObjectProperty(prop) && t21.isIdentifier(prop.key) && prop.key.name === "data") {
|
|
7309
|
+
const alias = t21.isIdentifier(prop.value) ? prop.value.name : null;
|
|
7310
|
+
if (alias) {
|
|
7311
|
+
const meta = compilerState.metadata;
|
|
7312
|
+
const dataSources = meta.dataSources;
|
|
7313
|
+
if (dataSources) {
|
|
7314
|
+
const ds = dataSources.find((d) => d.name === slug);
|
|
7315
|
+
if (ds) ds.name = alias;
|
|
7316
|
+
}
|
|
7317
|
+
}
|
|
7318
|
+
break;
|
|
7319
|
+
}
|
|
7320
|
+
}
|
|
7321
|
+
}
|
|
7322
|
+
return;
|
|
7323
|
+
}
|
|
7297
7324
|
if (!t21.isIdentifier(id) || !init || !t21.isExpression(init)) return;
|
|
7298
7325
|
const parentFn = path.getFunctionParent();
|
|
7299
7326
|
if (!parentFn) return;
|
|
@@ -7321,10 +7348,7 @@ function createVisitor(options = {}) {
|
|
|
7321
7348
|
return;
|
|
7322
7349
|
}
|
|
7323
7350
|
if (callee === "useMutation") {
|
|
7324
|
-
registerDerivedVar(id.name, t21.
|
|
7325
|
-
t21.identifier("$action"),
|
|
7326
|
-
t21.identifier("transition")
|
|
7327
|
-
));
|
|
7351
|
+
registerDerivedVar(id.name, t21.identifier("$action"));
|
|
7328
7352
|
return;
|
|
7329
7353
|
}
|
|
7330
7354
|
if (callee === "useServerAction") {
|
package/dist/vite/index.mjs
CHANGED
package/mm-dev.db
ADDED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mmapp/react-compiler",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.21",
|
|
4
4
|
"description": "Babel plugin + Vite integration for compiling React workflows to Pure Form IR",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -66,8 +66,9 @@
|
|
|
66
66
|
"@babel/plugin-syntax-typescript": "^7.24.0",
|
|
67
67
|
"@babel/traverse": "^7.24.0",
|
|
68
68
|
"@babel/types": "^7.24.0",
|
|
69
|
-
"@mmapp/player-core": "
|
|
70
|
-
"glob": "^10.3.10"
|
|
69
|
+
"@mmapp/player-core": "workspace:*",
|
|
70
|
+
"glob": "^10.3.10",
|
|
71
|
+
"@mmapp/react": "0.1.0-alpha.21"
|
|
71
72
|
},
|
|
72
73
|
"peerDependencies": {
|
|
73
74
|
"vite": ">=5.0.0"
|
|
@@ -77,7 +78,16 @@
|
|
|
77
78
|
"optional": true
|
|
78
79
|
}
|
|
79
80
|
},
|
|
80
|
-
"
|
|
81
|
-
"
|
|
81
|
+
"devDependencies": {
|
|
82
|
+
"@types/babel__core": "^7.20.5",
|
|
83
|
+
"@types/babel__generator": "^7.27.0",
|
|
84
|
+
"@types/babel__traverse": "^7.20.5",
|
|
85
|
+
"@types/node": "^20.0.0",
|
|
86
|
+
"@types/pg": "^8.18.0",
|
|
87
|
+
"pg": "^8.20.0",
|
|
88
|
+
"prettier": "^3.8.1",
|
|
89
|
+
"tsup": "^8.0.0",
|
|
90
|
+
"typescript": "^5.0.0",
|
|
91
|
+
"vitest": "^2.0.0"
|
|
82
92
|
}
|
|
83
93
|
}
|