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-1158] Move chakra-only deps to chakra lib #2171

Merged
merged 5 commits into from Nov 28, 2023
Merged

Conversation

masenf
Copy link
Collaborator

@masenf masenf commented Nov 14, 2023

Remove chakra workarounds from other parts of the framework.

This allows for a completely chakra-free and radix-free experience using basic elements and tailwind css.

Module size top 10 with chakra and radix components used

6192	./framer-motion
7280	./@types
7416	./caniuse-lite
8152	./@babel
8952	./react-dom
11976	./tailwindcss
20144	./@radix-ui
28288	./@chakra-ui
177624	./next
214376	./@next
557320	.

Module size top 10 without component lib:

2600	./socket.io-client
3224	./sucrase
3408	./@swc
3824	./jiti
3856	./axios
7416	./caniuse-lite
8952	./react-dom
11976	./tailwindcss
177624	./next
214376	./@next
462112	.

Next itself is still huge, but thankfully this compiles down to a reasonable size for the given functionality!

Base automatically changed from masenf/context-per-substate-rb to main November 21, 2023 21:09
Remove chakra workarounds from other parts of the framework.
I think this was originally a perf optimization... how big is the impact for
the possibility of introduced bugs?
@masenf masenf marked this pull request as ready for review November 22, 2023 06:23
Copy link
Collaborator

@Lendemor Lendemor Nov 22, 2023

Choose a reason for hiding this comment

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

Could we move this to a chakra/base.py or libs/chakra/base.py ?

Though I'm not sure we actually need the libs folder.

picklelo
picklelo previously approved these changes Nov 28, 2023
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 to me! Needs a rebase and we can merge

from reflex.utils.imports import ImportDict, ImportVar

# Imports to be included in every Reflex app.
DEFAULT_IMPORTS: ImportDict = {
Copy link
Contributor

Choose a reason for hiding this comment

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

Awesome :)

Allow DebounceInput to work with both chakra and radix UI components.
@picklelo picklelo merged commit 0c55723 into main Nov 28, 2023
45 checks passed
@masenf masenf deleted the masenf/chakra-duck branch December 6, 2023 22:16
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

3 participants