leptos-rs / leptos

Build fast web applications with Rust.
https://leptos.dev
MIT License
15.97k stars 627 forks source link

[0.7] Investigate effect of adding type erasure in router on build times #2902

Closed gbj closed 5 days ago

gbj commented 1 month ago

0.7 uses static typing everywhere. It seems like the increase in compile time is pretty consistent across the board, and while most projects have 20-30% smaller binaries I've had some reports of larger binaries.

There have also been some reports of recursion depth overflows in the compiler due to the depth of nested types.

I wonder whether the compile-time issue can be improved significantly by erasing types in the router and in some other specific control-flow locations, without too significantly adding to binary size.