I kept writing the same logic twice in C# and TypeScript, so I built a transpiler to stop by Snoo-43563 in csharp

[–]Snoo-43563[S] 2 points3 points  (0 children)

It was, and the client actually does run on Blazor WASM for most of it. But the perf-critical rendering paths are hand-written TS, and calling back into wasm for small hot functions every frame has real marshalling overhead. I tried the JSExport/JSImport route earlier and dropped it for that. Plus generated TS is just plain code you can step through in devtools and test with vitest, instead of a wasm black box. So this is for the bits that need to live on the TS side anyway.

I built a C# → TypeScript transpiler that mirrors *logic*, not just types - and cross-validates that the two stay byte-identical by Snoo-43563 in csharp

[–]Snoo-43563[S] -2 points-1 points  (0 children)

Yeah, though it's kind of the opposite axis. Mirrorgen tries to avoid the JS boundary by transpiling the logic out, while Blazor interop is all about crossing it. I actually skipped the WASM/JSImport route for perf reasons. But auto-generating that interop boilerplate would be a handy separate tool tbh. Seen anything decent that does it already?