core
core copied to clipboard
Allow more ways to get an argument value for `InlineControl`
For example client <@ myClientSideFunction myServerSideModuleValue @> fails with argument #1 is not a literal or local variable.
Workaround is to add a let myLocalValue = myServerSideModuleValue in the same scope. and use that in the quotation.
Improvement: add more recognizers to get argument values, if it is a static property get or method call, execute it to get the value. Optionally: if it has arguments itself, or is not static, use recursion to try to evaluate the quotation.
Similarly for C# version consuming Linq.Expressions.
There has been a related enhancement: pre-compiling any quotation literal passed to ClientSide/client that is not a single static method call, see #853.
Accessing server-side module values still require the value to be brought into local scope, as only that is recognized as a captured value needing serialization.