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
Refactor chakra components into separate folder #2315
Conversation
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.
A few changes needed but I'm glad this PR is finally here 😄
reflex/components/chakra/chakra.py
Outdated
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.
To keep with how we do it for radix, maybe this chakra.py file need to be renamed base.py since it's already inside the chakra folder anyway
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.
Good call
reflex/components/chakra/__init__.py
Outdated
from .media.image import Image | ||
|
||
image = Image.create | ||
from .chakra import * |
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.
from .base import *
if we actually rename chakra.py as mentioned in other comment.
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.
Debounce is not chakra specific, it can probably go to core
or it's own folder.
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.
we actually use this for the radix textfield as well
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.
Moving this
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.
since Password
doesn't actually exist in Chakra, this should probably become a high level component only, that specialize an input with type="password"
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.
Agreed, I think these ones are tied to the Chakra Input component, maybe we can leave it for now and abstract it later.
reflex/app.pyi
Outdated
@@ -12,7 +12,7 @@ from reflex.components.component import ( | |||
Component as Component, | |||
ComponentStyle as ComponentStyle, | |||
) | |||
from reflex.components.layout.fragment import Fragment as Fragment | |||
from reflex.components.chakra.layout.fragment import Fragment as Fragment |
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.
from reflex.components.chakra.layout.fragment import Fragment as Fragment | |
from reflex.components.base.fragment import Fragment as Fragment |
i thought this got moved to base
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.
we actually use this for the radix textfield as well
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.
why no pyi
file for this 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.
I'm not sure, I ran the generator
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.
multiselect.py is black-listed in the generator, probably a remnant of when it was broken ?
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.
We can bring it back now I suppose
b4bcf66
to
e664fd6
Compare
from .gridjs import * | ||
from .markdown import * | ||
from .moment import * | ||
from .next import NextLink, next_link |
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.
With this change do we still have access to the namespaced rx.next.image
and rx.next.video
?
This change moves most of the core components into the
reflex/components/chakra
namespace, in order to prepare for the switch to the Radix components.All imports for end-users should work exactly as is, this is just an internal restructuring.