-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[components] Refactor component load behavior #27181
base: 01-16-_components_explicitly_pass_params
Are you sure you want to change the base?
[components] Refactor component load behavior #27181
Conversation
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
977ee0c
to
3c6e30f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems reasonable to me
component_file_model=obj, | ||
source_position_tree=parsed.source_position_tree, | ||
) | ||
|
||
def get_component_type(self, registry: ComponentTypeRegistry) -> type[Component]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: get_
belies that this is doing some real work (parsing python files), maybe resolve_component_type
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be worth a brief docstr to explain that this does local lookup in addition to the expected registry lookup
Summary & Motivation
This moves the load method onto the individual DeclNode classes, which simplifies the logic a bit and just generally is a bit better organized.
The impetus for this is cleaning up the house a bit in preparation for adding a PythonDeclNode
How I Tested These Changes
Changelog
NOCHANGELOG