@gdholtby@ArmandDoma Another intuitive explanation: If your initial guess was incorrect, then you're guaranteed to be correct if you switch after one goat is revealed. Therefore, since your initial guess will be wrong 2/3 of the time, those become your winning odds.
@DinkoPavicic The overhead during SSR is mostly just the time it takes to JSON-serialize the arguments. If .NET interactivity is enabled, the performance is similar to JS interop using IJSRuntime.
Released a preview of the package I demoed at the recent TrailBlazor conference! It makes using JavaScript in Blazor web apps easy: https://t.co/i50owjLAtY
#blazor
@MrPeterLMorris I'll definitely fix it if something breaks - although it's a small library so I don't anticipate much future work will be required.
The new library also supports the simple use case of dynamically loading a script, if that's all you need to do :)
@rogiervdhee 1) We have an issue tracking exactly this: https://t.co/dYg4CUNUeF. Although I can't personally make any guarantees about this coming in .NET 10.
2) TypeScript has a build step, and we don't want the incurred complexity to be a requirement in building samples or following docs.
@MrPeterLMorris This is similar, except it supports:
1. Per-component JavaScript state + lifecycle method callbacks
2. Argument passing from .NET to JS
3. Any render mode
4. Collocated JS discovery
PageScript was a simple solution for JS in Blazor Web apps - this one explores the idea further.
We published a draft of the planned Blazor work for .NET 9 in the https://t.co/ImlIfvmUQz Core roadmap: https://t.co/ap0b9MCnBD. Let us know what you think in the corresponding GitHub discussion. More details on the rest of the https://t.co/ImlIfvmUQz Core roadmap coming soon.
Just published a video: an update on WASI support in .NET 8, and some prototypes that push the boundaries of what you can do with .NET + WebAssembly https://t.co/bq9YzlYJCo
@jaredpar I believe 1, 2, and 3 all get lowered to the same output (sharplab seems to confirm this). Option 4 is not technically equivalent because it accesses "Model" twice. That difference is meaningful if, e.g., the getter for "Model" had an observable side effect. Did I get it right?
@stevensanderson Agree. Another problem with 3 is that it's not an option if the boolean property were to be replaced with a method, e.g., TryParse().
Maybe option 4 really is the way to go!
IMO, each of these has its downsides:
'1' looks confusing and requires parentheses if more conditions are added.
'2' looks trivially reducible at a glance, but isn't.
'3' has a bunch of syntax.
'4' is long and accesses "Model" twice.
Hmmm...