dotvvm icon indicating copy to clipboard operation
dotvvm copied to clipboard

Collect runtime warnings from DotVVM

Open exyi opened this issue 6 years ago • 1 comments

We could add a mechanism to collect runtime warnings from DotVVM and display them in the browser console (so the dev can actually read it). On ASP.NET Core, these warnings should be propagated to the ILogger.

The warnings could include HTML warnings from HtmlWriter (like table can not contain div)

Then, we could add optional "sanitizers" to help debug common problems with postbacks:

  • add virtual command binding to all controls in the page
  • execute postback and find all the command bindings
  • warn if some command is missing or some is new

Or with control ids (leading to problems Postback.Update or commands in markup controls):

  • add a virtual Postback.Update to all controls (force a generated id)
  • execute postback
  • warn if some control is missing or some is new

Such warning could be pretty expensive, so it should be done only on demand, but it could help find glitches in custom controls.

exyi avatar Aug 23 '19 09:08 exyi

We should also have a sanitizer that checks during client-side serialization, that all objects have ...$options and $type. It is quite easy to miss that when objects are created manually in JS.

exyi avatar Aug 30 '19 13:08 exyi