@zenithbuild/compiler 1.0.14 → 1.0.16
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.
|
@@ -46,7 +46,9 @@ export function generateBundleJS(pluginData) {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
catch (e) {
|
|
49
|
-
|
|
49
|
+
if (process.env.ZENITH_DEBUG === 'true') {
|
|
50
|
+
console.warn('[Zenith] Could not load runtime from core, falling back to internal', e);
|
|
51
|
+
}
|
|
50
52
|
}
|
|
51
53
|
// Fallback to internal hydration_runtime.js from native compiler source
|
|
52
54
|
// Use the compiler's own location to find the file, not process.cwd()
|
|
@@ -76,8 +76,10 @@ function parseMapExpression(code) {
|
|
|
76
76
|
// Pattern: source.map((item, index) => body)
|
|
77
77
|
// Find .map(
|
|
78
78
|
const mapIndex = code.indexOf('.map(');
|
|
79
|
-
if (mapIndex === -1)
|
|
79
|
+
if (mapIndex === -1) {
|
|
80
|
+
// console.log('[Classify] No .map( found in:', code.slice(0, 50));
|
|
80
81
|
return null;
|
|
82
|
+
}
|
|
81
83
|
const source = code.slice(0, mapIndex).trim();
|
|
82
84
|
if (!source)
|
|
83
85
|
return null;
|
|
@@ -121,8 +123,11 @@ function parseMapExpression(code) {
|
|
|
121
123
|
body = body.slice(0, -1).trim();
|
|
122
124
|
}
|
|
123
125
|
// Check if body contains JSX
|
|
124
|
-
if (!containsJSX(body))
|
|
126
|
+
if (!containsJSX(body)) {
|
|
127
|
+
console.log('[Classify] Body does not contain JSX:', body.slice(0, 50));
|
|
125
128
|
return null;
|
|
129
|
+
}
|
|
130
|
+
console.log('[Classify] Successfully identified loop for source:', source);
|
|
126
131
|
return { source, itemVar, indexVar, body };
|
|
127
132
|
}
|
|
128
133
|
/**
|
|
@@ -12,10 +12,6 @@ import { resolveComponentsNative } from '../../native/compiler-native';
|
|
|
12
12
|
* Delegates to the Rust native compiler for performance and correctness.
|
|
13
13
|
*/
|
|
14
14
|
export function resolveComponentsInIR(ir, components) {
|
|
15
|
-
console.error(`[ZenithDebug] resolveComponentsInIR called with ${components.size} components`);
|
|
16
|
-
for (const [name, meta] of components) {
|
|
17
|
-
console.error(`[ZenithDebug] Component '${name}': script=${meta.script ? meta.script.length : 'null'} bytes`);
|
|
18
|
-
}
|
|
19
15
|
const irJson = JSON.stringify(ir);
|
|
20
16
|
// Convert Map to record for JSON serialization
|
|
21
17
|
const componentsRecord = {};
|
|
@@ -23,8 +19,6 @@ export function resolveComponentsInIR(ir, components) {
|
|
|
23
19
|
componentsRecord[key] = value;
|
|
24
20
|
}
|
|
25
21
|
const componentsJson = JSON.stringify(componentsRecord);
|
|
26
|
-
console.error(`[ZenithDebug] Calling resolveComponentsNative...`);
|
|
27
22
|
const resolvedJson = resolveComponentsNative(irJson, componentsJson);
|
|
28
|
-
console.error(`[ZenithDebug] resolveComponentsNative returned ${resolvedJson.length} bytes`);
|
|
29
23
|
return JSON.parse(resolvedJson);
|
|
30
24
|
}
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zenithbuild/compiler",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.16",
|
|
4
4
|
"description": "The Iron Heart: Native Compiler for the Zenith Framework",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"esbuild": "^0.20.0",
|
|
29
29
|
"ws": "^8.16.0",
|
|
30
30
|
"rolldown": "latest",
|
|
31
|
-
"@zenithbuild/router": "
|
|
31
|
+
"@zenithbuild/router": "^1.0.8",
|
|
32
32
|
"acorn": "^8.15.0",
|
|
33
33
|
"es-module-lexer": "^2.0.0",
|
|
34
34
|
"marked": "^17.0.1",
|
|
@@ -46,4 +46,4 @@
|
|
|
46
46
|
"typescript": "^5.3.3",
|
|
47
47
|
"bun-types": "latest"
|
|
48
48
|
}
|
|
49
|
-
}
|
|
49
|
+
}
|