Add component parameter support and fix JS runtime

- Emit function parameters in component signature
- JS runtime passes props as positional arguments
- Remove incorrect return value handling (components call js_set_root internally)
- Enables: def Tabs(orientation=0)
- All tests passing (30/30)
This commit is contained in:
Aaron Sinclair committed 2025-11-15 03:39:43 -08:00
1 parent 41474aceda
commit cdddbf675a
5 files changed
+12 -7

No files matched your search

+1 -5
View File
@@ -277,12 +277,8 @@ class RitzLoader {
}
// Pass props as positional arguments
// Components now RETURN the root element ID instead of calling js_set_root
const propValues = Object.values(props);
const rootElementId = renderFn(...propValues);
// Mount the returned element to the DOM
runtime.js_set_root(rootElementId);
renderFn(...propValues);
// Update signals
runtime.updateSignals();
+1 -1
View File
@@ -299,7 +299,7 @@ entry:
}
; Component render function
define void @render_Tabs() {
define void @render_Tabs(i32 %orientation) {
entry:
%var56 = call i32 @js_create_element(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.0, i32 0, i32 0))
call void @js_set_attribute(i32 %var56, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.28, i32 0, i32 0))
Binary file not shown.