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

[REF-2296] Rename recursive functions #2999

Merged
merged 23 commits into from
Apr 4, 2024
Merged

[REF-2296] Rename recursive functions #2999

merged 23 commits into from
Apr 4, 2024

Conversation

martinxu9
Copy link
Contributor

@martinxu9 martinxu9 commented Apr 3, 2024

Summary

  • Rename the current recursive functions, so it is more consistent with common naming conventions, also user unlikely to override them when implementing their components.
    • get_imports -> _get_all_imports
    • get_hooks -> _get_all_hooks
    • get_hooks_internal -> _get_all_hooks_internal
    • add_style -> add_styles_recursive
    • get_custom_code -> _get_all_custom_code
    • get_dynamic_imports -> _get_all_dynamic_imports
    • get_custom_components -> _get_all_custom_components
    • get_app_wrap_components -> _get_all_app_wrap_components
    • get_refs -> _get_all_refs

Copy link

linear bot commented Apr 3, 2024

@martinxu9 martinxu9 changed the title [REF-2296] Rename recursive functions [Do not review][REF-2296] Rename recursive functions Apr 3, 2024
@martinxu9 martinxu9 marked this pull request as ready for review April 3, 2024 23:41
@martinxu9 martinxu9 requested review from masenf and picklelo April 3, 2024 23:41
Copy link
Contributor

@picklelo picklelo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, let's hold off on the _render for now since that will change the public API

reflex/components/component.py Outdated Show resolved Hide resolved
reflex/components/component.py Outdated Show resolved Hide resolved
reflex/components/component.py Outdated Show resolved Hide resolved
@martinxu9 martinxu9 changed the title [Do not review][REF-2296] Rename recursive functions [REF-2296] Rename recursive functions Apr 3, 2024
reflex/components/component.py Outdated Show resolved Hide resolved
reflex/components/chakra/forms/pininput.py Show resolved Hide resolved
reflex/components/component.py Outdated Show resolved Hide resolved
reflex/components/component.py Outdated Show resolved Hide resolved
reflex/components/component.py Show resolved Hide resolved
masenf
masenf previously approved these changes Apr 4, 2024
Copy link
Collaborator

@masenf masenf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me.

My personal preference is _add_style_recursive but i wouldn't push too hard about it. I like _add_style_recursive because it describes exactly what this function is doing: adding the given style recursively down the tree.

reflex/components/component.py Outdated Show resolved Hide resolved
@martinxu9 martinxu9 merged commit 5274f04 into main Apr 4, 2024
46 checks passed
@martinxu9 martinxu9 deleted the mx/rename-recursive branch April 4, 2024 16:26
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.

3 participants