Skip to content

Revert "Adding analyzer to warn about JSInterop calls not wrapped in a try catch block" - #67873

Merged
akoeplinger merged 1 commit into
mainfrom
revert-67530-mkirova/unguarded-JSInterop-analyzer
Jul 17, 2026
Merged

akoeplinger merged 1 commit into
mainfrom
revert-67530-mkirova/unguarded-JSInterop-analyzer

Conversation

@ilonatommy

@ilonatommy ilonatommy commented Jul 17, 2026 •

Copy link
Copy Markdown
Member

Reverts #67530. @MayaKirova, my apologies, failures were connected. Templates.Test.RazorClassLibraryTemplateTest.RazorClassLibraryTemplateAsync

build

StdOut: /datadisks/disk1/work/9FB6093B/p/dotnet-cli/sdk/11.0.100-preview.6.26318.108/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.RuntimeIdentifierInference.targets(383,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [/datadisks/disk1/work/9FB6093B/w/97C4087E/e/Templates/BaseFolder/AspNet.tjljlrttfnvr/AspNet.tjljlrttfnvr.csproj]
/datadisks/disk1/work/9FB6093B/w/97C4087E/e/Templates/BaseFolder/AspNet.tjljlrttfnvr/ExampleJsInterop.cs(14,76): error BL0015: JS interop call 'InvokeAsync' is not guarded with a try/catch block. [/datadisks/disk1/work/9FB6093B/w/97C4087E/e/Templates/BaseFolder/AspNet.tjljlrttfnvr/AspNet.tjljlrttfnvr.csproj]
/datadisks/disk1/work/9FB6093B/w/97C4087E/e/Templates/BaseFolder/AspNet.tjljlrttfnvr/ExampleJsInterop.cs(20,22): error BL0015: JS interop call 'InvokeAsync' is not guarded with a try/catch block. [/datadisks/disk1/work/9FB6093B/w/97C4087E/e/Templates/BaseFolder/AspNet.tjljlrttfnvr/AspNet.tjljlrttfnvr.csproj]

I will revert it fast now and could you, please investigate the issue and create a new PR with same code but with template tests fixed?

@ilonatommy ilonatommy self-assigned this Jul 17, 2026
Copilot AI review requested due to automatic review settings July 17, 2026 09:20
@ilonatommy
ilonatommy requested a review from a team as a code owner July 17, 2026 09:20
@ilonatommy ilonatommy added this to the 11.0-preview7 milestone Jul 17, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 reverts the previously-added Blazor analyzer/code fix that warned on JS interop calls not wrapped in a try/catch, because it caused template test failures.

Changes:

  • Removes the JS interop “unguarded call” analyzer and its code fix implementation.
  • Removes the associated unit tests and localized resource strings.
  • Updates diagnostic descriptors/documentation to reflect the reverted diagnostic.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Components/Analyzers/test/JSInteropCodeFixProviderTest.cs Removed tests for the reverted JS interop code fix provider.
src/Components/Analyzers/test/JSInteropAnalyzerTest.cs Removed tests for the reverted JS interop analyzer.
src/Components/Analyzers/src/Resources.resx Removed resource strings related to the reverted diagnostic/code fix.
src/Components/Analyzers/src/JSInteropCodeFixProvider.cs Removed the reverted code fix provider.
src/Components/Analyzers/src/JSInteropAnalyzer.cs Removed the reverted analyzer implementation.
src/Components/Analyzers/src/DiagnosticDescriptors.cs Removed the reverted diagnostic descriptor and adjusted remaining diagnostic ID usage.
docs/list-of-diagnostics.md Updated the public diagnostics list to remove the reverted diagnostic entry.

Comment on lines +60 to 62
### BL (`BL0001-BL0014`)

| Diagnostic ID | Description |
@akoeplinger

Copy link
Copy Markdown
Member

/ba-g fast merge to fix build

@akoeplinger
akoeplinger merged commit 1d0c061 into main Jul 17, 2026
10 of 30 checks passed
@akoeplinger
akoeplinger deleted the revert-67530-mkirova/unguarded-JSInterop-analyzer branch July 17, 2026 09:32
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

Successfully merging this pull request may close these issues.

3 participants