Skip to content
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

Open
wants to merge 1 commit into
base: 01-16-_components_explicitly_pass_params
Choose a base branch
from

Conversation

OwenKephart
Copy link
Contributor

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

Copy link
Contributor Author

OwenKephart commented Jan 16, 2025

@OwenKephart OwenKephart force-pushed the 01-16-_components_refactor_component_load_behavior branch from 977ee0c to 3c6e30f Compare January 16, 2025 23:16
Copy link
Member

@benpankow benpankow left a 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]:
Copy link
Member

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?

Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants