-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Fix: custom block view rendering freezes the Backoffice #19962
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
Fix: custom block view rendering freezes the Backoffice #19962
Conversation
Hi there @andrejd22, thank you for this contribution! 👍 While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:
Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution. If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request. Thanks, from your friendly Umbraco GitHub bot 🤖 🙂 |
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.
Pull Request Overview
This PR fixes an issue with custom block view rendering in the Umbraco CMS frontend. The changes ensure that custom block views are properly rendered when no extensions are found, while maintaining fallback to built-in block views.
Key Changes:
- Added a
defaultRenderMethod
property to extension slots for fallback rendering - Modified block grid entry to use the new default render method instead of slot content
- Ensured proper rendering flow when custom block views are not available
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
extension-slot.element.ts | Added defaultRenderMethod property and logic to use it as fallback when no permitted extensions exist |
block-grid-entry.element.ts | Updated to use the new default render method approach instead of slot content for built-in block view rendering |
...ent/src/packages/core/extension-registry/components/extension-slot/extension-slot.element.ts
Show resolved
Hide resolved
…he class so it can run private methods and does not lose its context see also #extensionSlotRenderMethod
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.
- Ran the formatter to ensure the code is in line with the formatting rules.
- Changed the new render method to be a class property instead (#method = () => {}) so it works with private properties (caught in production mode by the e2e tests)
LGTM
Hi @andrejd22 I just wanted to say thanks for the contribution, and mention that the implementation was well done. 👏 Thanks! |
I took the freedom to rename the method and extend the work to the other Block Editors, you can see more on this PR: #20005 |
Prerequisites
If there's an existing issue for this PR then this fixes
Description
Fixes #19297
Fixes #16994