Collect runtime warnings from DotVVM
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.Updateto 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.
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.