-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Add manual Server Side Rendering (SSR) to the Interactivity API blocks #54343
Add manual Server Side Rendering (SSR) to the Interactivity API blocks #54343
Conversation
As the majority of mobile/tablet devices don't show the PDF embed, I've added a CSS media query instead of the |
Size Change: +483 B (0%) Total Size: 1.52 MB
ℹ️ View Unchanged
|
Flaky tests detected in 1b0c801. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6146364155
|
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.
This looks good to me 🙂
Feel free to review the changes that I made for the File block, and if you like them, merge this PR.
I believe it totally makes sense. Thanks for the update 🙂 Merging this now. |
Came to this PR while testing Twenty Twent-Four.
This seems to be less than ideal. While testing Twenty Twent-Four I noticed that in the desktop view these attribute are rendered, which is incorrect. Any Accessibility automated checker will flag this as an error.
Screenshot of the current markup: These attributes should be entirely omitted when the Navigation block is not rendered within a dialog. I will create a new issue. A small note: |
Thanks a lot for taking a look at it and for the detailed feedback 🙂 I believe we can keep the conversation in the issue you opened, and I can work on fixing that. I'll answer you there.
Totally my fault here. I assumed SSR was a more extended term, but you are totally right that I was wrong. I'll take that into account for future issues. |
For reference, we've reverted the |
What?
Add manual SSR for the attributes needed in the Interactivity API blocks. Covering the File and the Navigation block.
Why?
The Interactivity API has its own logic to handle the Server Side Rendering (SSR): link. With this, it can translate
data-wp-bind--aria-hidden="context.core.navigation.isOpen
and handle the SSR automatically.However, this logic won't be included in WordPress 6.4, while the idea is to include the File and Navigation block using the Interactivity API.
How?
I made sure to define the needed attributes directly in the SSR.
Navigation block
I just had to add the
aria-modal="false"
and therole=""
. The otheraria-expanded
attribute in the submenu was already included in the submenu and page list blocks.File block
It seems that the
hidden
attribute was already included: link.In the file block, it shows the preview when it is a Desktop and hides it when it is mobile. This logic seems complicate to replicate in the server, that's why I guess it was added in the first place. I assume we have two options:
Testing Instructions