-
-
Notifications
You must be signed in to change notification settings - Fork 724
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
Added global form state. #5721
Added global form state. #5721
Conversation
✅ Deploy Preview for plone-components canceled.
|
✅ Deploy Preview for volto canceled.
|
46b4ae1
to
0b01c84
Compare
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.
What's the context here? What problem are you trying to solve?
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.
LGTM so far, let's fix now the tests. Probably we miss some use case out.
26a494d
to
b5762b9
Compare
What's the intention to make the being edited content (data of the edit form) available from global app store? Could BTW the first step for an auto save feature… |
3215bc5
to
8631bd3
Compare
8631bd3
to
1c0b76b
Compare
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.
LGTM!
@ksuess see the description: #5721 (comment) |
@stevepiercy I will merge this right away. I promise docs after we get the right dynamics once we start applying and using this in the wild. |
…bars-et-al * main: (56 commits) Exclude chromewebstore from linkcheck (#5761) (feat):App extras exceptions (#5621) Add VOLTOCONFIG Env Var (#5752) PoC - Vite and Tanstack Router, Query and `@plone/client` in SSR mode. (#5750) Update links to Redux and React developer extensions for Chrome (#5757) Overhaul environment variables documentation (#5736) Mention what version the 'links and references' view was added (#5756) Add wait commands to flaky block-listing tests (#5753) Fix logging in test-acceptance-server commands (#5748) Replaced outdated diff with a link to the current `package.json` on t… (#5728) Listing Block render of initial results in SSR (#5689) Fix @plone/volto-slate path in moduleNameMapper (#5743) Added global form state. (#5721) Release generate-volto 9.0.0-alpha.5 Fix tests in projects that involves TS files (#5738) Reorganize README, merging content into authoritative locations (#5511) Release 18.0.0-alpha.10 Release generate-volto 9.0.0-alpha.4 Release @plone/registry 1.2.2 Enhance release in @plone/registry ...
The main block's form controls the state in the Form component itself. This forces to drill the state and its handlers through all the descendants tree, which is cumbersome. Also, this results in some limitations, since the state can't be access from outside this tree of descendants (eg. the header or footer components).
Having the state lifted to be global and provide the handlers via a React Context would allow: