Did you consider storing the metadata in the `session` reactiveValues? Or at least making `.metadata` itself a reactiveValues?

Whatever approach you like, let's carefully consider whether and how it should be different than the way we currently handle .shinyoutput_foo_width/height. They seem equivalent to me.