Backports the following commits to 6.x: - Spaces Phase 1 (#21408)
Backports the following commits to 6.x: - [typescript] add typescript support for the server and browser (#19104)