-
-
Notifications
You must be signed in to change notification settings - Fork 23
Rework view_to_component #98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Archmonger
merged 22 commits into
reactive-python:main
from
Archmonger:vtc-compat-registration
Oct 14, 2022
Merged
Rework view_to_component #98
Archmonger
merged 22 commits into
reactive-python:main
from
Archmonger:vtc-compat-registration
Oct 14, 2022
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rmorshea
reviewed
Sep 27, 2022
This reverts commit 492721e.
rmorshea
reviewed
Oct 13, 2022
rmorshea
approved these changes
Oct 14, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description (NEW)
This PR reworks view_to_component 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.