Yew centrally operates on the idea of keeping everything that a reusable piece of UI may need in one place - rust files, while also keeping the underlying technology accessible where necessary.
let document = window.document
let document = window()
.expect_throw("window is undefined")
.expect_throw("document is undefined");