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

[0.4.0] Namespace the Drawer primitive subcomponents #2492

Merged
merged 2 commits into from Jan 31, 2024

Conversation

masenf
Copy link
Collaborator

@masenf masenf commented Jan 31, 2024

Ensure Drawer component uses a SimpleNamespace like the other primitives.

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.

LGTM - an idea on how we can make defining the namespaces cleaner

drawer_close = DrawerClose.create
drawer_title = DrawerTitle.create
drawer_description = DrawerDescription.create
class Drawer(SimpleNamespace):
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can make a subclass of SimpleNamespace such that we can define these like:

class Drawer(NamespaceSubclass):
    root = DrawerRoot
    trigger = DrawerTrigger
    ...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

that would break static analysis and autocomplete i think. i tried making a fancy class first

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

to be clear, i'm not opposed to the idea per-se, but it might be trickier to get the typing right and would definitely need some help from pyi_generator.

i'd prefer to go with the simpler, expliciter route for now, but after we get this all out the door, i'm not opposed to a refactor or cleanup of the namespace classes

@picklelo picklelo merged commit a5302f1 into reflex-0.4.0 Jan 31, 2024
@masenf masenf deleted the masenf/fix-drawer-namespace branch February 2, 2024 17:21
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.

None yet

2 participants