Skip to content

Conversation

andrejd22
Copy link
Contributor

@andrejd22 andrejd22 commented Aug 21, 2025

Prerequisites

  • I have added steps to test this contribution in the description below

If there's an existing issue for this PR then this fixes

Description

Fixes #19297
Fixes #16994

@Copilot Copilot AI review requested due to automatic review settings August 21, 2025 10:18
Copy link

github-actions bot commented Aug 21, 2025

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:

  • It's clear what problem this is solving, there's a connected issue or a description of what the changes do and how to test them
  • The automated tests all pass (see "Checks" tab on this PR)
  • The level of security for this contribution is the same or improved
  • The level of performance for this contribution is the same or improved
  • Avoids creating breaking changes; note that behavioral changes might also be perceived as breaking
  • If this is a new feature, Umbraco HQ provided guidance on the implementation beforehand
  • 💡 The contribution looks original and the contributor is presumably allowed to share it

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 🤖 🙂

Copy link
Contributor

@Copilot Copilot AI left a 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

@iOvergaard iOvergaard added community/pr category/performance Fixes for performance (generally cpu or memory) fixes type/bug area/frontend labels Aug 27, 2025
…he class so it can run private methods and does not lose its context

see also #extensionSlotRenderMethod
@iOvergaard iOvergaard enabled auto-merge (squash) August 27, 2025 07:18
@iOvergaard iOvergaard changed the title Fix: custom block view rendering Fix: custom block view rendering freezes the Backoffice Aug 27, 2025
Copy link
Contributor

@iOvergaard iOvergaard left a 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

@iOvergaard iOvergaard merged commit 019563b into umbraco:main Aug 27, 2025
27 checks passed
@andrejd22 andrejd22 deleted the feature/custom-block-view-rendering-fix branch August 27, 2025 07:47
@nielslyngsoe
Copy link
Member

Hi @andrejd22

I just wanted to say thanks for the contribution, and mention that the implementation was well done. 👏

Thanks!

@nielslyngsoe
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants