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

recompose #4650

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

recompose #4650

wants to merge 7 commits into from

Conversation

willmcgugan
Copy link
Collaborator

This is an attempt to allow recompose to keep some widgets.

If a recomposed widget has the same id, it will have its state copied from the newly composed widget, rather than being removed.

@willmcgugan willmcgugan marked this pull request as draft June 14, 2024 16:40
@merriam
Copy link
Contributor

merriam commented Jul 14, 2024

I'm looking at this. I see "let's compose a new widget with stuff from previous widgets" and my analyst hairs rise on the back of my neck.

So, first, what is the use case? I can only think of cases where a hidden widget or ContentSwitcher should be in design time. As the layout is not interactive in the API, I cannot see where 'I need to change what I didn't know'? There are cases for copying trees, in order to keep the code clean, but replacing?

Second, what is state? If I change a Label to a Static does the value stay? The formatting? Only the formatting not derived from DEFAULT_CSS? Current focus? Is this meaning of State different from all other meanings?

Third, is there a more traditional approach? Something like shippingAddressWidget = copy_widgets(prefix='ship-', from_prefix='bill-")?

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