fix: collect the hooks and imports of the string form Bare renders for objects

BE
29m ago
+189-64

Bare renders an object or boolean var through to_string(), but _get_vars yields only the original var. Hooks and imports are collected from _get_vars, so when a var subclass overrides to_string() with an expression that needs a hook or an import the original var does not have, the page calls it without declaring it and fails in the browser:

class PickedVar(ObjectVar[Texts], python_types=Texts):
    def to_string(self, use_json: bool = True) -> StringVar:
        return pick(self)  # needs `const [pick_] = usePick()`


rx.text(State.texts)  # renders `pick_(...)`, but usePick is never imported or called

This PR renders through one _rendered_contents() helper and also yields the rendered var from _get_vars when it differs from the contents, so its hooks and imports reach the page. It drops Bare._get_all_imports: Component._get_imports already collects the imports of every var _get_vars yields, and the override replaced each library's list with the original var's, which lost a name the string form imports from the same library. The default to_string() of objects and booleans needs neither, so output for existing apps is unchanged.

The use case is translated data in the i18n PR (#6796): a mapping of locale to text whose string form picks the text for the active locale, so rx.text(product.name) shows one language and follows a locale switch.