This PR reworks _view_tocomponent to prevent needing to constantly pass in frequently used parameters.
Description (OLD)
In Conreq, I am relying on several view_to_component URLs to exist prior to the first render. That meaning, the compatibility registration needs to occur prior to the component's first time rendering.
By moving the iframe registration outside of the hook, this change allows me to arbitrarily call view_to_component(my_view, compatibility=True) as a "preloading" step during Conreq initialization to ensure the URL exists beforehand.
Additionally, a nice benefit of this is now type hints will work. They were previously obfuscated due to the @component decorator.
In my opinion, this feels less obtrusive than a separate API just to register iframes.
Checklist:
Please update this checklist as you complete each item:
[x] Tests have been included for all bug fixes or added functionality.
[X] The changelog.rst has been updated with any significant changes, if necessary.
[X] GitHub Issues which may be closed by this PR have been linked.
Description (NEW)
This PR reworks _view_tocomponent to prevent needing to constantly pass in frequently used parameters.
Description (OLD)
In Conreq, I am relying on several
view_to_component
URLs to exist prior to the first render. That meaning, thecompatibility
registration needs to occur prior to the component's first time rendering.By moving the iframe registration outside of the hook, this change allows me to arbitrarily call
view_to_component(my_view, compatibility=True)
as a "preloading" step during Conreq initialization to ensure the URL exists beforehand.Additionally, a nice benefit of this is now type hints will work. They were previously obfuscated due to the
@component
decorator.In my opinion, this feels less obtrusive than a separate API just to register iframes.
Checklist:
Please update this checklist as you complete each item:
changelog.rst
has been updated with any significant changes, if necessary.