Replies: 1 comment
-
After research, I don't believe there is an answer right now. There is work being done to figure out how to add interactivity to blocks, but most likely not through hydration of blocks into React components. But the Interactivity Experiments are really exciting |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
(Forward: I am new WordPress and still getting my block feet under me, so please excuse any ignorance of the subject matter.)
I just became involved with the Feature Notifications project. I'm really excited about the work they are doing, though there are some issues with rendering notifications with React.
The problem
Page Layout Shift - Rendering a client-only notification at the top of the main content area of a page in Admin causes unacceptable page layout shift, see WordPress/wp-feature-notifications#183. Rendering on the server would solve the issue, but complicates how to provide the interactivity expected from a notification system.
The inspiration
After reading Thinking Through the WordPress Admin Experience by @mtias, I am on board with using blocks outside the editor to create a more dynamic Admin experience. I think using dynamic blocks to render notifications would allow the control to server render and properly translate notification messages on the server, and provide the expected level of interactivity if they can be properly hydrated.
I am also inspired by the Block Interactivity Experiments project being spearheaded by @luisherranz. I think it has real potential that could be applied to notifications. Though the constraint of rendering on the frontend of the site is not the same for notifications in the Admin. The penalty of loading block editor dependencies is not as high because they have likely already been loaded, or will eventually be expected to load.
The Question
I'm researching how to hydrate serialized blocks outside of the block editor, is there already an established way to do this? If not, do you believe this is a valid use of blocks and should we build this functionality?
I am asking the question because I have not seen any documentation on how to do this. If I missed it, please point me in the right direction, thanks!
Edit:
I want to mention this is related to the discussion Universal blocks and block hydration #38224 by @michalczaplinski.
Beta Was this translation helpful? Give feedback.
All reactions