6.4.0 Removal of MarkupString in multiple components breaking change #1700

Closed
opened 2026-01-29 17:57:26 +00:00 by claunia · 9 comments
Owner

Originally created by @groogiam on GitHub (Apr 2, 2025).

Describe the bug
The latest release appears to have a breaking change https://github.com/radzenhq/radzen-blazor/pull/2066. This seems like a fairly major change that should have resulted in a new major version. I understand this is your project and how you version is ultimately up to you, but unless I'm mistaken this is going to potentially break alot of users.

Is there still some mechanism and examples for supporting html content in these components, specifically the notification? Thanks.

Expected behavior
Breaking changes should generally be in new major versions.

Originally created by @groogiam on GitHub (Apr 2, 2025). <!-- IMPORTANT: Read this first!!! 1. If you own a Radzen Professional or Еnterprise subscription you can report your issue or ask us a question via email at info@radzen.com. Radzen staff will reply within 24 hours (Professional) or 16 hours (Enterprise) 2. The Radzen staff guarantees a response to issues in this repo only to paid subscribers. 3. If you have a HOW TO question start a new forum thread in the Radzen Community forum: https://forum.radzen.com. Radzen staff will close issues that are HOWTO questions. 4. Please adhere to the issue template. Specify all the steps required to reproduce the issue or link a project which reproduces it easily (without requiring extra steps such as restoring a database). --> **Describe the bug** The latest release appears to have a breaking change https://github.com/radzenhq/radzen-blazor/pull/2066. This seems like a fairly major change that should have resulted in a new major version. I understand this is your project and how you version is ultimately up to you, but unless I'm mistaken this is going to potentially break alot of users. Is there still some mechanism and examples for supporting html content in these components, specifically the notification? Thanks. **Expected behavior** Breaking changes should generally be in new major versions.
Author
Owner

@akorchev commented on GitHub (Apr 3, 2025):

Hi @groogiam,

We are planning to release a new major version soon-ish so we decided against doing that for the removal of MarkupString.

The MarkupString support wasn't documented anywhere so we don't expect it to affect that many users.

Here is how to use HTML content in radzen notification (shown in the custom content demo):

 NotificationService.Notify(new NotificationMessage
        {
                Severity = NotificationSeverity.Warning,
                Duration = 40000,
                SummaryContent = ns =>@<RadzenText TextStyle="TextStyle.H6">Custom summary: <br /> @DateTime.Now</RadzenText>,
                DetailContent = ns => @<RadzenButton Text="Clear" Click="@(args => ns.Messages.Clear())" />
        });
@akorchev commented on GitHub (Apr 3, 2025): Hi @groogiam, We are planning to release a new major version soon-ish so we decided against doing that for the removal of MarkupString. The MarkupString support wasn't documented anywhere so we don't expect it to affect that many users. Here is how to use HTML content in radzen notification (shown in the custom content demo): ``` NotificationService.Notify(new NotificationMessage { Severity = NotificationSeverity.Warning, Duration = 40000, SummaryContent = ns =>@<RadzenText TextStyle="TextStyle.H6">Custom summary: <br /> @DateTime.Now</RadzenText>, DetailContent = ns => @<RadzenButton Text="Clear" Click="@(args => ns.Messages.Clear())" /> }); ```
Author
Owner

@tale80 commented on GitHub (Apr 3, 2025):

Hi @akorchev :

Do you have any tips on how to do the same kind of behavior for pager in datagrid? The style is broken too, even in the documentation :

Image

https://blazor.radzen.com/datagrid-pager-api?theme=material3

@tale80 commented on GitHub (Apr 3, 2025): Hi @akorchev : Do you have any tips on how to do the same kind of behavior for pager in datagrid? The style is broken too, even in the documentation : ![Image](https://github.com/user-attachments/assets/3f22cf1b-d734-44a6-9a2c-6e556b8e6764) https://blazor.radzen.com/datagrid-pager-api?theme=material3
Author
Owner

@akorchev commented on GitHub (Apr 3, 2025):

We will introduce new RenderFragment based API for that. You should use the format without HTML tags for now.

@akorchev commented on GitHub (Apr 3, 2025): We will introduce new RenderFragment based API for that. You should use the format without HTML tags for now.
Author
Owner

@tale80 commented on GitHub (Apr 3, 2025):

@akorchev ok

But I'm joining @groogiam, hard to understand a change like this in a minor version, can be hard for us to manage and rely on Radzen Components if a minor update introduce breaking change. Even if you don't expect it to affect many users, it doesn't feel good to be one of this "not many users"

By the way, hope the render fragment will come soon, thanks for your answer

@tale80 commented on GitHub (Apr 3, 2025): @akorchev ok But I'm joining @groogiam, hard to understand a change like this in a minor version, can be hard for us to manage and rely on Radzen Components if a minor update introduce breaking change. Even if you don't expect it to affect many users, it doesn't feel good to be one of this "not many users" By the way, hope the render fragment will come soon, thanks for your answer
Author
Owner

@akorchev commented on GitHub (Apr 3, 2025):

But I'm joining @groogiam, hard to understand a change like this in a minor version

Your concerns are definitely valid. We would be more careful next time. The sad thing is even with a new major release people would still update and complain that something is broken. We have experienced it recently when we removed the dependency to System.Dynamic.Linq. Such is life of the open source I guess.

By the way, hope the render fragment will come soon, thanks for your answer

@JvanderStad has already submitted a pull request with the implementation. We would merge it soon and release an update.

@akorchev commented on GitHub (Apr 3, 2025): > But I'm joining @groogiam, hard to understand a change like this in a minor version Your concerns are definitely valid. We would be more careful next time. The sad thing is even with a new major release people would still update and complain that something is broken. We have experienced it recently when we removed the dependency to System.Dynamic.Linq. Such is life of the open source I guess. > By the way, hope the render fragment will come soon, thanks for your answer @JvanderStad has already submitted a pull request with the implementation. We would merge it soon and release an update.
Author
Owner

@Koen-Nocore commented on GitHub (Apr 9, 2025):

Hello @akorchev,
We are also using making use of the markupString in our implementation of Radzen. We are using this to replace some of the icons in the component with our own icons. Are there any plans to add support to make this possible again? Now we have a lot of HTML code where Icons were supposed to be. 😅
I also believe MarkupString isn't an issue in places where user input doesn't reach (like with rewriting the icons).

@Koen-Nocore commented on GitHub (Apr 9, 2025): Hello @akorchev, We are also using making use of the markupString in our implementation of Radzen. We are using this to replace some of the icons in the component with our own icons. Are there any plans to add support to make this possible again? Now we have a lot of HTML code where Icons were supposed to be. 😅 I also believe MarkupString isn't an issue in places where user input doesn't reach (like with rewriting the icons).
Author
Owner

@akorchev commented on GitHub (Apr 9, 2025):

Hi @Koen-Nocore,

We won't be bringing support for MarkupString as it imposes a security risk. There are various ways to use custom icons. Here is a form thread: https://forum.radzen.com/t/inject-icons-since-6-4-0/20096/2

@akorchev commented on GitHub (Apr 9, 2025): Hi @Koen-Nocore, We won't be bringing support for MarkupString as it imposes a security risk. There are various ways to use custom icons. Here is a form thread: https://forum.radzen.com/t/inject-icons-since-6-4-0/20096/2
Author
Owner

@groogiam commented on GitHub (Apr 9, 2025):

@Koen-Nocore You can create a render fragment from an html formatted string. This may help converting your existing code if you have not already done so.

E.g.

private static RenderFragment<NotificationService> CreateRenderFragment(string htmlContent)
{
    return _ => builder => { builder.AddMarkupContent(0, htmlContent); };
}
@groogiam commented on GitHub (Apr 9, 2025): @Koen-Nocore You can create a render fragment from an html formatted string. This may help converting your existing code if you have not already done so. E.g. ```csharp private static RenderFragment<NotificationService> CreateRenderFragment(string htmlContent) { return _ => builder => { builder.AddMarkupContent(0, htmlContent); }; } ```
Author
Owner

@ptzedakis commented on GitHub (Apr 9, 2025):

Hi @akorchev For some strange reason,
I cannot make the custom demo example to compile at all (I upgraded to 6.5.1).
I also tried @groogiam code and although it compiles fine, when I try to show a notification, nothing gets displayed.
Am I missing something?

@ptzedakis commented on GitHub (Apr 9, 2025): Hi @akorchev For some strange reason, I cannot make the custom demo example to compile at all (I upgraded to 6.5.1). I also tried @groogiam code and although it compiles fine, when I try to show a notification, nothing gets displayed. Am I missing something?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#1700