this repo has no description

feat: wire Widget module into worker message loop

Initialize Widget.set_sender at worker startup so widget view updates
are sent via Worker.post_message. Handle incoming WidgetEvent messages
by routing them through Widget.handle_event. Add WidgetUpdate/WidgetClear
catch-all cases in the OCaml client to suppress non-exhaustive match
warnings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+13
+3
idl/js_top_worker_client_msg.ml
··· 199 199 Hashtbl.remove t.pending_env env_id; 200 200 Lwt.wakeup resolver parsed 201 201 | None -> ()) 202 + | Msg.WidgetUpdate _ | Msg.WidgetClear _ -> 203 + (* Widget messages are handled by the JS client, not the OCaml client *) 204 + () 202 205 203 206 (** Create a new worker client. 204 207 @param timeout Timeout in milliseconds (default: 30000) *)
+1
lib/dune
··· 47 47 (libraries 48 48 js_top_worker 49 49 js_top_worker-rpc.message 50 + js_top_worker-widget 50 51 js_of_ocaml-ppx 51 52 js_of_ocaml-toplevel 52 53 js_of_ocaml-lwt
+9
lib/worker.ml
··· 334 334 | Error (Impl.InternalError msg) -> 335 335 send_message (Msg.InitError { message = msg })) 336 336 337 + | Msg.WidgetEvent { widget_id; handler_id; value; _ } -> 338 + Widget.handle_event ~widget_id ~handler_id ~value; 339 + Lwt.return_unit 340 + 337 341 let run () = 338 342 let open Js_of_ocaml in 339 343 try ··· 341 345 342 346 Logs.set_reporter (Logs_browser.console_reporter ()); 343 347 Logs.set_level (Some Logs.Debug); 348 + 349 + (* Initialize Widget module sender *) 350 + Widget.set_sender (fun json -> 351 + Jslib.log "Widget sending: %s" json; 352 + Js_of_ocaml.Worker.post_message (Js_of_ocaml.Js.string json)); 344 353 345 354 Js_of_ocaml.Worker.set_onmessage (fun x -> 346 355 let s = Js_of_ocaml.Js.to_string x in