Skip to content

[Blazor] Error page support for Server Side Rendered Razor Component Applications #50550

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

Merged
merged 22 commits into from
Sep 20, 2023

Conversation

javiercn
Copy link
Member

@javiercn javiercn commented Sep 6, 2023

Description

Adds support for Error pages to Blazor Web application.

  • Includes a small change to the ExceptionHandler middleware to support Blazor Web scenarios.
  • Includes a change in Blazor Web to account for error handling scenarios and disable streaming rendering and interactivity.
  • Includes changes to the Blazor Web template to add an Error page similar to the one in MVC and Razor pages templates.

Fixes #49853, #49854

Customer Impact

  • Customers won't be able to see errors in Blazor Web Applications without having to rely on MVC or Razor Pages for it,
    which adds significant complexity to their setup.

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low
  • If customers hit any issues, we will be able to tell them to simply remove the ErrorPage.razor page from their projects. Luckily, we will have a little bit of time to address any critical feedback in case such comes up. As of right now, this change has been validated and it works.

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

@ghost ghost added the area-blazor Includes: Blazor, Razor Components label Sep 6, 2023
@SteveSandersonMS
Copy link
Member

Looks fantastic. I guess what remains is:

  • E2E tests
  • Update project template

Copy link
Member

@Tratcher Tratcher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems potentially double edged. While Blazor requires a new scope, other components may be expecting the original scope, or the parent / request scope.

If you turn this on by default and run all the CI tests, does anything fail?

@javiercn javiercn force-pushed the javiercn/blazor-error-page branch from cc20ff0 to bd6134c Compare September 7, 2023 15:06
@javiercn
Copy link
Member Author

javiercn commented Sep 7, 2023

This seems potentially double edged. While Blazor requires a new scope, other components may be expecting the original scope, or the parent / request scope.

If you turn this on by default and run all the CI tests, does anything fail?

We can consider the error handling path "a separate request" the moment we send it down the pipeline. In that sense I don't think it'll be common for a component to fail in that situation, as it is "really hard" to distinguish that request from a regular request.

What I mean by that, is that I expect most components to be completely ignorant of the new scope and behave in the same way as if it was the original request scope.

To add to this, I turned on the create new scope by default, and I couldn't see any test fail outside of our existing flaky tests. In any case, as @SteveSandersonMS was quick to mention, this is something that users opt-in to, so it should not impact any existing app.

@javiercn javiercn force-pushed the javiercn/blazor-error-page branch from bd6134c to 4f0f3e3 Compare September 12, 2023 17:06
@javiercn javiercn marked this pull request as ready for review September 13, 2023 13:31
@javiercn javiercn requested review from BrennanConroy and a team as code owners September 13, 2023 13:31
@javiercn
Copy link
Member Author

@Tratcher any other feedback before this goes in?

Copy link
Member

@Tratcher Tratcher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To add to this, I turned on the create new scope by default, and I couldn't see any test fail outside of our existing flaky tests. In any case, as @SteveSandersonMS was quick to mention, this is something that users opt-in to, so it should not impact any existing app.

If we expect it to just work then we should turn it on by default and leave the option for opting out. Users hate having to discover settings to make things work.

@javiercn javiercn force-pushed the javiercn/blazor-error-page branch from 3caaa32 to 5e0ae68 Compare September 19, 2023 19:43
@javiercn javiercn added the Servicing-consider Shiproom approval is required for the issue label Sep 19, 2023
@ghost
Copy link

ghost commented Sep 19, 2023

Hi @javiercn. Please make sure you've updated the PR description to use the Shiproom Template. Also, make sure this PR is not marked as a draft and is ready-to-merge.

To learn more about how to prepare a servicing PR click here.

@mkArtakMSFT mkArtakMSFT added Servicing-approved Shiproom has approved the issue and removed Servicing-consider Shiproom approval is required for the issue labels Sep 19, 2023
@ghost
Copy link

ghost commented Sep 19, 2023

Hi @javiercn. This PR was just approved to be included in the upcoming servicing release. Somebody from the @dotnet/aspnet-build team will get it merged when the branches are open. Until then, please make sure all the CI checks pass and the PR is reviewed.

@wtgodbe
Copy link
Member

wtgodbe commented Sep 19, 2023

@javiercn can you retarget this to the rc2 branch & confirm the test failures are unrelated?

@javiercn javiercn force-pushed the javiercn/blazor-error-page branch from d508293 to 25c7fb4 Compare September 20, 2023 10:24
@javiercn javiercn requested review from wtgodbe and a team as code owners September 20, 2023 10:24
@javiercn javiercn changed the base branch from release/8.0 to release/8.0-rc2 September 20, 2023 10:24
@javiercn javiercn removed the request for review from a team September 20, 2023 10:24
@javiercn javiercn force-pushed the javiercn/blazor-error-page branch from 1865c88 to f7c08bf Compare September 20, 2023 14:13
Copy link
Member

@SteveSandersonMS SteveSandersonMS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

@mkArtakMSFT mkArtakMSFT merged commit a0c7939 into release/8.0-rc2 Sep 20, 2023
@mkArtakMSFT mkArtakMSFT deleted the javiercn/blazor-error-page branch September 20, 2023 20:34
@ghost ghost added this to the 8.0-rc2 milestone Sep 20, 2023
halter73 added a commit that referenced this pull request Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components Servicing-approved Shiproom has approved the issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants