Skip to content
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

NET8 Component rendering to HTML for libraries outside Blazor! #139

Open
A9G-Data-Droid opened this issue Dec 27, 2023 · 4 comments
Open

Comments

@A9G-Data-Droid
Copy link
Contributor

It looks like NET8 brings us a new and improved way to render razor with their HtmlRenderer!

This could be a good opportunity to release a new major version of the RazorEngineCore with breaking changes and the new renderer. This would allow us to close any issues that are blocked due to breaking changes. Leave this version as it for legacy and make a new NET8 version!

https://andrewlock.net/exploring-the-dotnet-8-preview-rendering-blazor-components-to-a-string/

@adoconnection
Copy link
Owner

Thanks for pointing out, this is very interesting!
BlazorEngineCore 😄

@kingxi82
Copy link

kingxi82 commented Dec 27, 2023

This feature can be used to test the following Razor statements to see if they work correctly. Currently, RazorEngineCore does not support this C# 9 syntax

@{
    var ss = new { Qt="test"};
    string result = "";
    switch (ss)
    {
        case {Qt:"test"}:
            result = "show some text";
            break;
    }
    @:@result
}

@A9G-Data-Droid
Copy link
Contributor Author

After looking deeper, I'm early. They are still arguing about the namespace and firming the architecture. I wouldn't experiment with this until they are done with things like this:
dotnet/razor#8400

They are moving the namespace used by this library. After the move to a final location, we can see how the new API fits into the CreateAndCompileToStream workflow.

@kingxi82
Copy link

kingxi82 commented Dec 28, 2023

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

No branches or pull requests

3 participants