dotnet / dotnet/aspnetcore

Revise JSInterop analzyer

Open
#69,072 2 comments 0 reactions 1 assignee Claimed by @vendasankarsf3945 View on GitHub
analyzer area-blazor
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 5h
Merged PRs (30d)
276

Description

Just want to give a honest feedback on this: you rarely can do anything about failing JS interop calls:
- If it happens in Blazor Server, more likely than not your circuit MUST die, coz the connection isn't there
- JS & Blazor counterparts of components are typically very tightly coupled, so it's unreasonable to expect you write JS interop calls in such a way that a few missing ones (w/ suppressed errors) won't do any permanent harm

As a result, you guys produced an analyzer warning that will either lead to unnecessary code pollution (tons of useless try-catch at worst, custom `SafeInvokeXxx` extensions at best) or will be simply suppressed - for good.

I'm suppressing it in our codebase: it produces 250+ warnings in a codebase where this specific issue was never a problem.

_Originally posted by @alexyakunin in https://github.com/dotnet/aspnetcore/issues/67900#issuecomment-5548358903_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.